• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python usage.Options类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中twisted.python.usage.Options的典型用法代码示例。如果您正苦于以下问题:Python Options类的具体用法?Python Options怎么用?Python Options使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Options类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: __init__

 def __init__(self):
     self.running = False
     self.parentPid = os.getpid()
     Options.__init__(self)
     self.parseOptions() # Automatically parse command line
开发者ID:mleinart,项目名称:droned,代码行数:5,代码来源:droned-daemon.py


示例17: __init__

 def __init__(self, *a, **k):
     Options.__init__(self,*a,**k)
     self.pushers = []
开发者ID:rcarmo,项目名称:divmod.org,代码行数:3,代码来源:q2qclient.py


示例18: parseOptions

    def parseOptions(self, options: Optional[Sequence[str]] = None) -> None:
        Options.parseOptions(self, options=options)

        self.selectDefaultLogObserver()
开发者ID:burningmantech,项目名称:ranger-ims-server,代码行数:4,代码来源:_options.py



注:本文中的twisted.python.usage.Options类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.initgroups函数代码示例发布时间:2022-05-27
下一篇:
Python threadpool.ThreadPool类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap