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

		self['winds'] = ConfigParser.winds
		self['node'] = ConfigParser.node
		self['overlay'] = ConfigParser.overlay
		self['components'] = ConfigParser.components
예제 #2
0
 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'] = []
예제 #3
0
파일: twistd.py 프로젝트: fluidinfo/fluiddb
 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)
예제 #4
0
 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"] = []
예제 #5
0
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
예제 #6
0
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]
예제 #7
0
 def __init__(self, reactor):
     Options.__init__(self)
     self.reactor = reactor
     self["secure-ports"] = []
     self["insecure-ports"] = []
예제 #8
0
    def postOptions(self) -> None:
        Options.postOptions(self)

        self.initConfig()
예제 #9
0
    def parseOptions(self, options: Optional[Sequence[str]] = None) -> None:
        Options.parseOptions(self, options=options)

        self.selectDefaultLogObserver()
예제 #10
0
    def parseOptions(self, options=None):
        self.installReactor()
        self.selectDefaultLogObserver()

        Options.parseOptions(self, options=options)
예제 #11
0
    def __init__(self):
        Options.__init__(self)

        self["reactorName"] = "default"
        self["logLevel"] = self.defaultLogLevel
        self["logFile"] = stdout
예제 #12
0
파일: client.py 프로젝트: sloblee/flocker
 def __init__(self, top_level):
     """
     :param FilePath top_level: The top-level of the flocker repository.
     """
     Options.__init__(self)
     self.top_level = top_level
예제 #13
0
 def __init__(self, *a, **k):
     Options.__init__(self, *a, **k)
     self.pushers = []
예제 #14
0
 def __init__(self, reactor):
     Options.__init__(self)
     self.reactor = reactor
     self["secure-ports"] = []
     self["insecure-ports"] = []
예제 #15
0
 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)
예제 #16
0
파일: port.py 프로젝트: jonathanj/mantissa
 def __init__(self):
     Options.__init__(self)
     self.portIdentifiers = []
 def getSynopsis(self):
     return "{} plugin [plugin_options]".format(
         Options.getSynopsis(self)
     )
예제 #18
0
    def __init__(self) -> None:
        Options.__init__(self)

        self["reactorName"] = self.defaultReactorName
        self["logLevel"] = self.defaultLogLevel
        self["logFile"] = stdout
예제 #19
0
 def getSynopsis(self) -> str:
     return "{} plugin [plugin_options]".format(Options.getSynopsis(self))
예제 #20
0
 def __init__(self):
     Options.__init__(self)
     self['parameters'] = {}
예제 #21
0
    def postOptions(self) -> None:
        Options.postOptions(self)

        if self.subCommand is None:
            raise UsageError("No plugin specified.")
예제 #22
0
 def __init__(self):
     self.running = False
     self.parentPid = os.getpid()
     Options.__init__(self)
     self.parseOptions() # Automatically parse command line
예제 #23
0
파일: port.py 프로젝트: rcarmo/divmod.org
 def __init__(self):
     Options.__init__(self)
     self.portIdentifiers = []
    def postOptions(self):
        Options.postOptions(self)

        if self.subCommand is None:
            raise UsageError("No plugin specified.")
예제 #25
0
    def parseOptions(self, options: Optional[Sequence[str]] = None) -> None:
        Options.parseOptions(self, options=options)

        self.selectDefaultLogObserver()
예제 #26
0
    def postOptions(self) -> None:
        Options.postOptions(self)

        self.initConfig()
예제 #27
0
 def __init__(self, *a, **k):
     Options.__init__(self,*a,**k)
     self.pushers = []
예제 #28
0
 def __init__(self):
     self.running = False
     self.parentPid = os.getpid()
     Options.__init__(self)
     self.parseOptions()  # Automatically parse command line