本文整理汇总了Python中ldif.LDIFParser类的典型用法代码示例。如果您正苦于以下问题:Python LDIFParser类的具体用法?Python LDIFParser怎么用?Python LDIFParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LDIFParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,input,output,root,ns1,ns2,outputdir='.'):
LDIFParser.__init__(self,input)
rantoday = open('.rantoday', 'r')
try:
serial = rantoday.readline()
print serial
if serial != '':
serial = int(serial)
else:
serial = 0
serialNum = serial + 1
rantoday.close()
rantoday = open('.rantoday', 'w+')
rantoday.write(str(serialNum))
print serialNum
rantoday.close()
except IOError:
exit("couldn't read local directory, to create a .rantoday file to help counting the reruns to get the serial to increase")
self.serial = serialNum
self.writer = LDIFWriter(output)
self.megaArray = {}
self.cnamed = []
self.valueInEntries = []
self.megaTree = {}
self.subDomainRecords = {}
self.root = root
self.ns1 = ns1
self.ns2 = ns2
self.zoneSubDirectory = outputdir
self.megaWeirdArray= {}
self.zoneArray = {}
self.zoneArray = {}
self.managedZones = {}
self.exempted = {2: ['co.uk', 'org.ua', 'com.ar']}
示例2: __init__
def __init__(self, input, output):
LDIFParser.__init__(self, input)
self.targetDN = None
self.targetAttr = None
self.targetEntry = None
self.DNs = []
self.lastDN = None
self.lastEntry = None
示例3: __init__
def __init__(self, input_fd):
LDIFParser.__init__(self, input_fd)
self.DNs = []
self.entries = {}
self.inumOrg = None
self.inumOrg_dn = None
self.inumApllience = None
self.inumApllience_dn = None
示例4: __init__
def __init__(self, input, vipGroups, debug=False):
self.vipGroups = {}
for g in vipGroups:
self.vipGroups[g] = []
self.debug = debug
LDIFParser.__init__(self, input)
示例5: __init__
def __init__(self, infile=None, outfile=None):
if infile:
self._if = open(infile, "r")
else:
self._if = sys.stdin
if outfile:
self._of = open(outfile, "w")
else:
self._of = sys.stdout
LDIFParser.__init__(self, self._if)
示例6: __init__
def __init__(self, input, output, settings, clients_ldif=None, editor=None):
LDIFParser.__init__(self, input)
self.domains = {}
self.domains_lookup = (
clients_ldif.domains_lookup if clients_ldif else None
)
self.editor = editor
self.a_record_ips = set([])
self.a_record_hosts = {}
self.server = Server(settings.couchdb_uri)
self.db = self.server.get_db(settings.couchdb_db)
示例7: __init__
def __init__(self, input, output, keep_dn=False):
LDIFParser.__init__(self, input)
self.keep_dn = keep_dn
self.targetDN = None
self.targetAttr = None
self.targetEntry = None
self.DNs = []
self.lastDN = None
self.lastEntry = None
self.entries = []
self.dn_entry = []
示例8: __init__
def __init__(self, ldif_fil, ldif_entries):
"""
`ldif_fil`: The file-like object from which to read ldif
entries.
`ldif_entries`: the queue into which to dump the entries as
DnEntry namedtuples.
"""
LDIFParser.__init__(self, ldif_fil)
self.ldif_entries = ldif_entries
self.sort_enforcer = SortEnforcer()
示例9: __init__
def __init__(self, input_name, replacement_table=None):
replacement_table = replacement_table if replacement_table else {}
# we must keep this one handy because the LDIFParser
# will not access it immediately, and it must stay open.
self.stringio = cStringIO.StringIO()
with open('%s/schemas/%s.ldif'
% ('/usr/share/licorn', input_name), 'rb') as ldapf:
data = ldapf.read()
for key, value in replacement_table.iteritems():
data = data.replace(key, value)
self.stringio.write(data)
self.stringio.seek(0)
LDIFParser.__init__(self, self.stringio)
#print '%s/schemas/%s.ldif' % (
# os.path.dirname(__file__),input_name)
self.ldap_data = []
示例10: __init__
def __init__(self,input,output):
LDIFParser.__init__(self,input)
self.writer = LDIFWriter(output)
示例11: __init__
def __init__(self, input, output, password):
LDIFParser.__init__(self, input)
self.writer = LDIFWriter(output)
self.password = password
示例12: __init__
def __init__(self, input, output):
LDIFParser.__init__(self, input)
self.writer = OpenLdapSchemaWriter(output)
示例13: __init__
def __init__(self, descriptor):
self.users = {}
LDIFParser.__init__(self, descriptor)
示例14: __init__
def __init__(self, input):
LDIFParser.__init__(self, input)
self.objectclasses = {}
self.attributes = {}
示例15: parseAttrTypeandValue
def parseAttrTypeandValue(self):
return LDIFParser._parseAttrTypeandValue(self)