當前位置: 首頁>>代碼示例>>Python>>正文


Python LDIFParser.__init__方法代碼示例

本文整理匯總了Python中ldif.LDIFParser.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python LDIFParser.__init__方法的具體用法?Python LDIFParser.__init__怎麽用?Python LDIFParser.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ldif.LDIFParser的用法示例。


在下文中一共展示了LDIFParser.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 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']}
開發者ID:GuillaumeFromage,項目名稱:ldif2zones,代碼行數:36,代碼來源:ldif2zone.py

示例2: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 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
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:10,代碼來源:import23.py

示例3: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 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
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:10,代碼來源:remove_inum.py

示例4: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
  def __init__(self, input, vipGroups, debug=False):

    self.vipGroups = {}
    for g in vipGroups:
      self.vipGroups[g] = []

    self.debug = debug
    LDIFParser.__init__(self, input)
開發者ID:pamapa,項目名稱:python-fritzbox,代碼行數:10,代碼來源:LDIF.py

示例5: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 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)
開發者ID:syakesaba,項目名稱:john,代碼行數:12,代碼來源:ldif2john.py

示例6: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 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 = []
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:13,代碼來源:export3031.py

示例7: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
    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()
開發者ID:Bitlancer,項目名稱:strings-datasync,代碼行數:13,代碼來源:ldiff.py

示例8: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 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)
開發者ID:yvess,項目名稱:desk,代碼行數:13,代碼來源:importer.py

示例9: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
	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 = []
開發者ID:Licorn,項目名稱:licorn,代碼行數:26,代碼來源:ldaputils.py

示例10: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 def __init__(self,input,output):
     LDIFParser.__init__(self,input)
     self.writer = LDIFWriter(output)
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:5,代碼來源:update_config.py

示例11: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 def __init__(self, input, output, password):
     LDIFParser.__init__(self, input)
     self.writer = LDIFWriter(output)
     self.password = password
開發者ID:chenjie4255,項目名稱:active-directory-to-openldap,代碼行數:6,代碼來源:add-default-user-password.py

示例12: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 def __init__(self, input, output):
     LDIFParser.__init__(self, input)
     self.writer = OpenLdapSchemaWriter(output)
開發者ID:chenjie4255,項目名稱:active-directory-to-openldap,代碼行數:5,代碼來源:ad-schema-to-open-ldap.py

示例13: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 def __init__(self, descriptor):
     self.users = {}
     LDIFParser.__init__(self, descriptor)
開發者ID:eaudeweb,項目名稱:naaya.edw.circaimport,代碼行數:5,代碼來源:ldif_extract.py

示例14: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 def __init__(self, inputFile, group):
     LDIFParser.__init__(self, inputFile)
     self.group = SysGroup.objects.get(group_name=group)
     self.PROCESS_ONLY = 'CN=Users,DC=zsplana,DC=cz'
開發者ID:vencax,項目名稱:django-sql-nss-admin,代碼行數:6,代碼來源:import_from_ldif_OU_based.py

示例15: __init__

# 需要導入模塊: from ldif import LDIFParser [as 別名]
# 或者: from ldif.LDIFParser import __init__ [as 別名]
 def __init__(self, fobj):
     LDIFParser.__init__(self, fobj)
開發者ID:umax,項目名稱:diabetto,代碼行數:4,代碼來源:test_ldif.py


注:本文中的ldif.LDIFParser.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。