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


Python usage.Options類代碼示例

本文整理匯總了Python中twisted.python.usage.Options的典型用法代碼示例。如果您正苦於以下問題:Python Options類的具體用法?Python Options怎麽用?Python Options使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: __init__

 def __init__(self, top_level):
     """
     :param FilePath top_level: The top-level of the flocker repository.
     """
     Options.__init__(self)
     self.top_level = top_level
     self['variants'] = []
開發者ID:aminembarki,項目名稱:flocker,代碼行數:7,代碼來源:acceptance.py

示例2: __init__

	def __init__(self):
		Options.__init__(self)

		self['winds'] = ConfigParser.winds
		self['node'] = ConfigParser.node
		self['overlay'] = ConfigParser.overlay
		self['components'] = ConfigParser.components
開發者ID:ComputerNetworks-UFRGS,項目名稱:ManP2P-ng,代碼行數:7,代碼來源:configparser.py

示例3: __init__

 def __init__(self, top_level):
     """
     :param FilePath top_level: The top-level of the flocker repository.
     """
     Options.__init__(self)
     self.docs["provider"] = self.docs["provider"].format(self._get_provider_names())
     self.top_level = top_level
     self["variants"] = []
開發者ID:scollison,項目名稱:flocker,代碼行數:8,代碼來源:acceptance.py

示例4: parseOptions

 def parseOptions(self, options=None):
     """
     Don't upcall L{ServerOptions.parseOptions}, but L{Options.parseOptions}
     directly.
     """
     if options is None:
         options = sys.argv[1:]
     Options.parseOptions(self, options=options)
開發者ID:fluidinfo,項目名稱:fluiddb,代碼行數:8,代碼來源:twistd.py

示例5: initializeDB

def initializeDB(Store: store.Store, options: usage.Options):
    username = options.get('username')
    password = options.get('password')
    employees = commandFinder(Store)("Check For New Employees").doCheckForEmployees()
    for emp in employees:
        un = runWithConnection(findUsername, username, password, args=(emp, options))
        if un:
            emp.active_directory_name = un
開發者ID:UnionGospelMission,項目名稱:TimeClock,代碼行數:8,代碼來源:initialize.py

示例6: findUsername

def findUsername(conn, emp: IEmployee, options: usage.Options) -> str:
    ise = ISolomonEmployee(emp)
    name = ise.name
    if '~' in name:
        name = name.split('~')
        ln = name[0]
        fn = name[1].split()[0]
    else:
        name = name.split()
        fn = name[0]
        ln = name[-1]
    if conn.search('dc=ugm, dc=local', '(&(givenName=%s) (sn=%s))' % (fn, ln), attributes=['sAMAccountName']):
        if len(conn.response) == 4 and 'attributes' in conn.response[0]:
            if conn.response[0]['attributes']['sAMAccountName']:
                return conn.response[0]['attributes']['sAMAccountName'][0]
        if options.get('resolve'):
            print("AD username not found for %s, searching by last name only" % ise.name)
            if conn.search('dc=ugm, dc=local', '(&(givenName=*) (sn=%s))' % (ln,), attributes=['sAMAccountName',
                                                                                               'givenName',
                                                                                               'sn']):
                while len(conn.response) > 3:
                    resp = conn.response.pop(0)
                    if 'attributes' not in resp:
                        break
                    print("Possible match found")
                    print("FN:", resp['attributes']['givenName'])
                    print("LN:", resp['attributes']['sn'])
                    if 'Y' in input("Is this a match? (yN)").upper():
                        return resp['attributes']['sAMAccountName'][0]
            if options.get('resolve') == 'firstname':
                print("AD username not found, searching by first name only")
                if conn.search('dc=ugm, dc=local', '(&(givenName=%s) (sn=*))' % (fn,),
                               attributes=['sAMAccountName', 'givenName', 'sn']):
                    while len(conn.response) > 3:
                        resp = conn.response.pop(0)
                        if 'attributes' not in resp:
                            break
                        print("Possible match found")
                        print("FN:", resp['attributes']['givenName'])
                        print("LN:", resp['attributes']['sn'])
                        if 'Y' in input("Is this a match? (yN)").upper():
                            return resp['attributes']['sAMAccountName'][0]
開發者ID:UnionGospelMission,項目名稱:TimeClock,代碼行數:42,代碼來源:initialize.py

示例7: __init__

 def __init__(self):
     Options.__init__(self)
     self['parameters'] = {}
開發者ID:svn2github,項目名稱:calendarserver-raw,代碼行數:3,代碼來源:benchmark.py

示例8: __init__

 def __init__(self):
     Options.__init__(self)
     self.portIdentifiers = []
開發者ID:rcarmo,項目名稱:divmod.org,代碼行數:3,代碼來源:port.py

示例9: __init__

 def __init__(self, reactor):
     Options.__init__(self)
     self.reactor = reactor
     self["secure-ports"] = []
     self["insecure-ports"] = []
開發者ID:LeastAuthority,項目名稱:leastauthority.com,代碼行數:5,代碼來源:main.py

示例10: postOptions

    def postOptions(self) -> None:
        Options.postOptions(self)

        self.initConfig()
開發者ID:burningmantech,項目名稱:ranger-ims-server,代碼行數:4,代碼來源:_options.py

示例11: parseOptions

    def parseOptions(self, options=None):
        self.installReactor()
        self.selectDefaultLogObserver()

        Options.parseOptions(self, options=options)
開發者ID:alfonsjose,項目名稱:international-orders-app,代碼行數:5,代碼來源:_options.py

示例12: parseOptions

 def parseOptions(self, options=None):
     if options is None or ('txdevserver' not in sys.argv):
         options = ['txdevserver'] + sys.argv[1:]
     return Options.parseOptions(self, options)
開發者ID:tehasdf,項目名稱:txdevserver,代碼行數:4,代碼來源:runner.py

示例13: getSynopsis

 def getSynopsis(self):
     return "{} plugin [plugin_options]".format(
         Options.getSynopsis(self)
     )
開發者ID:alfonsjose,項目名稱:international-orders-app,代碼行數:4,代碼來源:_options.py

示例14: __init__

    def __init__(self):
        Options.__init__(self)

        self["reactorName"] = "default"
        self["logLevel"] = self.defaultLogLevel
        self["logFile"] = stdout
開發者ID:alfonsjose,項目名稱:international-orders-app,代碼行數:6,代碼來源:_options.py

示例15: postOptions

    def postOptions(self):
        Options.postOptions(self)

        if self.subCommand is None:
            raise UsageError("No plugin specified.")
開發者ID:alfonsjose,項目名稱:international-orders-app,代碼行數:5,代碼來源:_options.py


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