bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,300
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
15,301
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
15,302
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
15,303
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
15,304
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
15,305
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
15,306
def _subdomain_check(config, kargs): if config.mapper.sub_domains: subdomain = kargs.pop('sub_domain', None) hostmatch = config.environ['HTTP_HOST'].split(':') host = hostmatch[0] port = '' if len(hostmatch) > 1: port += ':' + hostmatch[1] sub_match = re.compile('^.+?\.(%s)$' % config.mapper.domain_match) domain = re.sub(sub_match, r'\1', host) if subdomain and not host.startswith(subdomain) and \ subdomain not in config.mapper.sub_domains_ignore: kargs['_host'] = subdomain + '.' + domain + port elif (subdomain in config.mapper.sub_domains_ignore or subdomain is None) and domain != host: kargs['_host'] = domain + port return kargs else: return kargs
def _subdomain_check(config, kargs): if config.mapper.sub_domains: subdomain = kargs.pop('sub_domain', None) fullhost = config.environ.get('HTTP_HOST') or config.environ.get('SERVER_NAME') hostmatch = fullhost.split(':') host = hostmatch[0] port = '' if len(hostmatch) > 1: port += ':' + hostmatch[1] sub_match = re.compile('^.+?\.(%s)$' % config.mapper.domain_match) domain = re.sub(sub_match, r'\1', host) if subdomain and not host.startswith(subdomain) and \ subdomain not in config.mapper.sub_domains_ignore: kargs['_host'] = subdomain + '.' + domain + port elif (subdomain in config.mapper.sub_domains_ignore or subdomain is None) and domain != host: kargs['_host'] = domain + port return kargs else: return kargs
15,307
def find_controllers(dirname, prefix=''): controllers = [] for fname in os.listdir(dirname): filename = dirname + '/' + fname if os.path.isfile(filename) and re.match('^[^_]{1,1}.*\.py$', fname): controllers.append(prefix + fname[:-3]) elif os.path.isdir(filename): controllers.extend(find_controllers(filename, prefix=fname+'/')) return controllers
def find_controllers(dirname, prefix=''): controllers = [] for fname in os.listdir(dirname): filename = dirname + '/' + fname if os.path.isfile(filename) and re.match('^[^_]{1,1}.*\.py$', fname): controllers.append(prefix + fname[:-3]) elif os.path.isdir(filename): controllers.extend(find_controllers(filename, prefix=prefix+fname+'/')) return controllers
15,308
def keysort(a, b): am = a.minkeys a = a.maxkeys b = b.maxkeys lendiffa = len(keys^a) lendiffb = len(keys^b) # If they both match, don't switch them if lendiffa == 0 and lendiffb == 0: return 0 # First, if a matches exactly, use it if lendiffa == 0: return -1 # Or b matches exactly, use it if lendiffb == 0: return 1 # Neither matches exactly, return the one with the most in common if cmp(lendiffa,lendiffb) != 0: return cmp(lendiffa,lendiffb) # Neither matches exactly, but if they both have just as much in common if len(keys&b) == len(keys&a): return cmp(len(a),len(b)) # Then we return the shortest of the two # Otherwise, we return the one that has the most in common else: return cmp(len(keys&b), len(keys&a))
def keysort(a, b): am = a.minkeys a = a.maxkeys b = b.maxkeys lendiffa = len(keys^a) lendiffb = len(keys^b) # If they both match, don't switch them if lendiffa == 0 and lendiffb == 0: return 0 # First, if a matches exactly, use it if lendiffa == 0: return -1 # Or b matches exactly, use it if lendiffb == 0: return 1 # Neither matches exactly, return the one with the most in common if cmp(lendiffa,lendiffb) != 0: return cmp(lendiffa,lendiffb) # Neither matches exactly, but if they both have just as much in common if len(keys&b) == len(keys&a): return cmp(len(a),len(b)) # Then we return the shortest of the two # Otherwise, we return the one that has the most in common else: return cmp(len(keys&b), len(keys&a))
15,309
def keysort(a, b): am = a.minkeys a = a.maxkeys b = b.maxkeys lendiffa = len(keys^a) lendiffb = len(keys^b) # If they both match, don't switch them if lendiffa == 0 and lendiffb == 0: return 0 # First, if a matches exactly, use it if lendiffa == 0: return -1 # Or b matches exactly, use it if lendiffb == 0: return 1 # Neither matches exactly, return the one with the most in common if cmp(lendiffa,lendiffb) != 0: return cmp(lendiffa,lendiffb) # Neither matches exactly, but if they both have just as much in common if len(keys&b) == len(keys&a): return cmp(len(a),len(b)) # Then we return the shortest of the two # Otherwise, we return the one that has the most in common else: return cmp(len(keys&b), len(keys&a))
def keysort(a, b): am = a.minkeys a = a.maxkeys b = b.maxkeys lendiffa = len(keys^a) lendiffb = len(keys^b) # If they both match, don't switch them if lendiffa == 0 and lendiffb == 0: return 0 # First, if a matches exactly, use it if lendiffa == 0: return -1 # Or b matches exactly, use it if lendiffb == 0: return 1 # Neither matches exactly, return the one with the most in common if cmp(lendiffa,lendiffb) != 0: return cmp(lendiffa,lendiffb) # Neither matches exactly, but if they both have just as much in common if len(keys&b) == len(keys&a): return cmp(len(a),len(b)) # Then we return the shortest of the two # Otherwise, we return the one that has the most in common else: return cmp(len(keys&b), len(keys&a))
15,310
def __getattr__(self, name): return self._shared_state.__getattr__(name)
def __getattr__(self, name): return self.__shared_state.__getattr__(name)
15,311
def __setattr__(self, name, value): return self._shared_state.__setattr__(name, value)
def __setattr__(self, name, value): return self.__shared_state.__setattr__(name, value)
15,312
def url_for(*args, **kargs): """Generates a URL All keys given to url_for are sent to the Routes Mapper instance for generation except for:: anchor specified the anchor name to be appened to the path host overrides the default (current) host if provided protocol overrides the default (current) protocol if provided The URL is generated based on the rest of the keys. When generating a new URL, values will be used from the current request's parameters (if present). The following rules are used to determine when and how to keep the current requests parameters: * If the controller is present and begins with '/', no defaults are used * If the controller is changed, action is set to 'index' unless otherwise specified For example, if the current request yielded a dict of {'controller': 'blog', 'action': 'view', 'id': 2}, with the standard ':controller/:action/:id' route, you'd get the following results:: url_for(id=4) => '/blog/view/4', url_for(controller='/admin') => '/admin', url_for(controller='admin') => '/admin/index/4' url_for(action='edit') => '/blog/post/4', url_for(action='list', id=None) => '/blog/list' **Static and Named Routes** If there is a string present as the first argument, a lookup is done against the named routes table to see if there's any matching routes. The keyword defaults used with static routes will be sent in as GET query arg's if a route matches. If no route by that name is found, the string is assumed to be a raw URL. Should the raw URL begin with ``/`` then appropriate SCRIPT_NAME data will be added if present, otherwise the string will be used as the url with keyword args becoming GET query args. """ anchor = kargs.get('anchor') host = kargs.get('host') protocol = kargs.get('protocol') # Remove special words from kargs, convert placeholders for key in ['anchor', 'host', 'protocol']: if kargs.get(key): del kargs[key] if kargs.has_key(key+'_'): kargs[key] = kargs[key+'_'] del kargs[key+'_'] config = request_config() route = None static = False url = '' if len(args) > 0: route = config.mapper._routenames.get(args[0]) if route and route.defaults.has_key('_static'): static = True newargs = route.defaults.copy() host = newargs.pop('host', '') protocol = newargs.pop('protocol', '') del newargs['_static'] newargs.update(kargs) url = route.generate(_ignore_req_list=True, **newargs) if not url: url = '' kargs = None #url = route.routepath # No named route found, assume the argument is a relative path if not route: static = True url = args[0] if url.startswith('/') and hasattr(config, 'environ') \ and config.environ.get('SCRIPT_NAME'): url = config.environ.get('SCRIPT_NAME') + url if static: if kargs: url += '?' url += urllib.urlencode(kargs) if not static: if route: newargs = route.defaults.copy() newargs.update(kargs) # If this route has a filter, apply it if route.filter: newargs = route.filter(newargs) else: newargs = _screenargs(kargs) url = config.mapper.generate(**newargs) if config.mapper.append_slash and not url.endswith('/'): url += '/' if anchor: url += '#' + _url_quote(anchor) if host or protocol: if not host: host = config.host if not protocol: protocol = config.protocol url = protocol + '://' + host + url return url
def url_for(*args, **kargs): """Generates a URL All keys given to url_for are sent to the Routes Mapper instance for generation except for:: anchor specified the anchor name to be appened to the path host overrides the default (current) host if provided protocol overrides the default (current) protocol if provided The URL is generated based on the rest of the keys. When generating a new URL, values will be used from the current request's parameters (if present). The following rules are used to determine when and how to keep the current requests parameters: * If the controller is present and begins with '/', no defaults are used * If the controller is changed, action is set to 'index' unless otherwise specified For example, if the current request yielded a dict of {'controller': 'blog', 'action': 'view', 'id': 2}, with the standard ':controller/:action/:id' route, you'd get the following results:: url_for(id=4) => '/blog/view/4', url_for(controller='/admin') => '/admin', url_for(controller='admin') => '/admin/index/4' url_for(action='edit') => '/blog/post/4', url_for(action='list', id=None) => '/blog/list' **Static and Named Routes** If there is a string present as the first argument, a lookup is done against the named routes table to see if there's any matching routes. The keyword defaults used with static routes will be sent in as GET query arg's if a route matches. If no route by that name is found, the string is assumed to be a raw URL. Should the raw URL begin with ``/`` then appropriate SCRIPT_NAME data will be added if present, otherwise the string will be used as the url with keyword args becoming GET query args. """ anchor = kargs.get('anchor') host = kargs.get('host') protocol = kargs.get('protocol') # Remove special words from kargs, convert placeholders for key in ['anchor', 'host', 'protocol']: if kargs.get(key): del kargs[key] if kargs.has_key(key+'_'): kargs[key] = kargs[key+'_'] del kargs[key+'_'] config = request_config() route = None static = False url = '' if len(args) > 0: route = config.mapper._routenames.get(args[0]) if route and route.defaults.has_key('_static'): static = True newargs = route.defaults.copy() host = newargs.pop('host', '') protocol = newargs.pop('protocol', '') del newargs['_static'] newargs.update(kargs) url = route.generate(_ignore_req_list=True, **newargs) if not url: url = '' kargs = None #url = route.routepath # No named route found, assume the argument is a relative path if not route: static = True url = args[0] if url.startswith('/') and hasattr(config, 'environ') \ and config.environ.get('SCRIPT_NAME'): url = config.environ.get('SCRIPT_NAME') + url if static: if kargs: url += '?' url += urllib.urlencode(kargs) if not static: if route: newargs = route.defaults.copy() newargs.update(kargs) # If this route has a filter, apply it if route.filter: newargs = route.filter(newargs) else: newargs = _screenargs(kargs) url = config.mapper.generate(**newargs) if config.mapper.append_slash and not url.endswith('/'): url += '/' if anchor: url += '#' + _url_quote(anchor) if host or protocol: if not host: host = config.host if not protocol: protocol = config.protocol url = protocol + '://' + host + url return url
15,313
def match(self, url, environ=None, sub_domains=False, sub_domains_ignore=None, domain_match=''): """Match a url to our regexp. While the regexp might match, this operation isn't guaranteed as there's other factors that can cause a match to fail even though the regexp succeeds (Default that was relied on wasn't given, requirement regexp doesn't pass, etc.). Therefore the calling function shouldn't assume this will return a valid dict, the other possible return is False if a match doesn't work out. """ # Static routes don't match, they generate only if self.static: return False if url.endswith('/') and len(url) > 1: url = url[:-1] m = self.regmatch.match(url) if not m: return False if not environ: environ = {} sub_domain = None if environ.get('HTTP_HOST') and sub_domains: host = environ['HTTP_HOST'].split(':')[0] sub_match = re.compile('^(.+?)\.%s$' % domain_match) subdomain = re.sub(sub_match, r'\1', host) if subdomain not in sub_domains_ignore and host != subdomain: sub_domain = subdomain if self.conditions: if self.conditions.has_key('method') and \ environ.get('REQUEST_METHOD') not in self.conditions['method']: return False # Check sub-domains? use_sd = self.conditions.get('sub_domain') if use_sd and not sub_domain: return False if isinsance(use_sd, list) and sub_domain not in use_sd: return False matchdict = m.groupdict() result = {} extras = frozenset(self.defaults.keys()) - frozenset(matchdict.keys()) for key,val in matchdict.iteritems(): if not val and self.defaults.has_key(key) and self.defaults[key]: result[key] = self.defaults[key] else: result[key] = val for key in extras: result[key] = self.defaults[key] # If there's a function, call it with environ and expire if it # returns False if self.conditions and self.conditions.has_key('function') and \ not self.conditions['function'](environ, result): return False if sub_domain: result['sub_domain'] = sub_domain return result
def match(self, url, environ=None, sub_domains=False, sub_domains_ignore=None, domain_match=''): """Match a url to our regexp. While the regexp might match, this operation isn't guaranteed as there's other factors that can cause a match to fail even though the regexp succeeds (Default that was relied on wasn't given, requirement regexp doesn't pass, etc.). Therefore the calling function shouldn't assume this will return a valid dict, the other possible return is False if a match doesn't work out. """ # Static routes don't match, they generate only if self.static: return False if url.endswith('/') and len(url) > 1: url = url[:-1] m = self.regmatch.match(url) if not m: return False if not environ: environ = {} sub_domain = None if environ.get('HTTP_HOST') and sub_domains: host = environ['HTTP_HOST'].split(':')[0] sub_match = re.compile('^(.+?)\.%s$' % domain_match) subdomain = re.sub(sub_match, r'\1', host) if subdomain not in sub_domains_ignore and host != subdomain: sub_domain = subdomain if self.conditions: if self.conditions.has_key('method') and \ environ.get('REQUEST_METHOD') not in self.conditions['method']: return False # Check sub-domains? use_sd = self.conditions.get('sub_domain') if use_sd and not sub_domain: return False if isinstance(use_sd, list) and sub_domain not in use_sd: return False matchdict = m.groupdict() result = {} extras = frozenset(self.defaults.keys()) - frozenset(matchdict.keys()) for key,val in matchdict.iteritems(): if not val and self.defaults.has_key(key) and self.defaults[key]: result[key] = self.defaults[key] else: result[key] = val for key in extras: result[key] = self.defaults[key] # If there's a function, call it with environ and expire if it # returns False if self.conditions and self.conditions.has_key('function') and \ not self.conditions['function'](environ, result): return False if sub_domain: result['sub_domain'] = sub_domain return result
15,314
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = re.escape(part['name']) partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = re.escape(part['name']) if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
15,315
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(map(re.escape, clist)) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
15,316
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = re.escape(part[:-1]) + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
15,317
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = re.escape(part) + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = re.escape(part) + rest return (reg, noreqs, allblank)
15,318
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = part + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = part + rest return (reg, noreqs, allblank)
def buildnextreg(self, path, clist): """Recursively build our regexp given a path, and a controller list. Returns the regular expression string, and two booleans that can be ignored as they're only used internally by buildnextreg """ if path: part = path[0] else: part = '' reg = '' # noreqs will remember whether the remainder has either a string match, or a non-defaulted # regexp match on a key, allblank remembers if the rest could possible be completely empty (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if isinstance(part, dict) and part['type'] == ':': var = part['name'] partreg = '' # First we plug in the proper part matcher if self.reqs.has_key(var): partreg = '(?P<' + var + '>' + self.reqs[var] + ')' elif var == 'controller': partreg = '(?P<' + var + '>' + '|'.join(clist) + ')' else: if len(path) > 1: partreg = '(?P<' + var + '>[^' + path[1][0] +']+)' else: partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if not self.defaults.has_key(var): allblank = False noreqs = False # Now we determine if its optional, or required. This changes depending on what is in # the rest of the match. If noreqs is true, then its possible the entire thing is optional # as there's no reqs or string matches. if noreqs: # The rest is optional, but now we have an optional with a regexp. Wrap to ensure that if we match # anything, we match our regexp first. It's still possible we could be completely blank as we have # a default if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Or we have a regexp match with no default, so now being completely blank form here on out isn't # possible elif self.reqs.has_key(var): allblank = False reg = partreg + rest # Or we have a default with no regexp, don't touch the allblank elif self.defaults.has_key(var): reg = partreg + '?' + rest # Or we have a key with no default, and no reqs. Not possible to be all blank from here else: allblank = False reg = partreg + rest # In this case, we have something dangling that might need to be matched else: # If they can all be blank, and we have a default here, we know its # safe to make everything from here optional. Since something else in # the chain does have req's though, we have to make the partreg here # required to continue matching if allblank and self.defaults.has_key(var): reg = '(' + partreg + rest + ')?' # Same as before, but they can't all be blank, so we have to require it all to ensure # our matches line up right else: reg = partreg + rest elif isinstance(part, dict) and part['type'] == '*': var = part['name'] if noreqs: if self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: reg = '(?P<' + var + '>.*)' + rest allblank = False noreqs = False else: if allblank and self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest elif self.defaults.has_key(var): reg = '(?P<' + var + '>.*)' + rest else: allblank = False noreqs = False reg = '(?P<' + var + '>.*)' + rest elif part.endswith('/'): if allblank: reg = part[:-1] + '(/' + rest + ')?' else: allblank = False reg = re.escape(part) + rest # We have a normal string here, this is a req, and it prevents us from being all blank else: noreqs = False allblank = False reg = re.escape(part) + rest return (reg, noreqs, allblank)
15,319
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,320
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,321
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,322
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,323
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,324
def __init__(self, conf, mapfactory, opsonlineresource): self.conf = conf self.mapfactory = mapfactory if self.conf.has_option('service', 'epsg'): self.crs = CRS('EPSG', self.conf.get('service', 'epsg')) else: ServerConfigurationError('EPSG code not properly configured.')
def __init__(self, conf, mapfactory, opsonlineresource): self.conf = conf self.mapfactory = mapfactory if self.conf.has_option('service', 'epsg'): self.crs = CRS('EPSG', self.conf.get('service', 'epsg')) else: ServerConfigurationError('EPSG code not properly configured.')
15,325
def __init__(self): """Init database""" #Get repos present on machine self.repos = os.listdir("/var/lib/pacman")
def __init__(self): """Init database""" #Get repos present on machine self.repos = os.listdir("/var/lib/pacman")
15,326
def _set_filelist(self, pac, path): """Set installed files list for the given pac""" if not pac.installed: return _("%s is not installed") %pac.name files = open("%s/files" %path).read() begin = files.index("%FILES%") + len("%FILES%") end = files.find("%", begin) - len("%") filelist = files[begin:end].strip() pac.filelist = filelist return
def _set_filelist(self, pac, path): """Set installed files list for the given pac""" if not pac.installed: return _("%s is not installed") %pac.name files = open("%s/files" %path).read() begin = files.index("%FILES%") + len("%FILES%") end = files.find("%", begin) - len("%") filelist = files[begin:end].strip() pac.filelist = filelist return
15,327
def run(self): self.show_all() self.terminal.fork_command() self.terminal.feed_child("pacman -Sy;exit\n")
def run(self): self.show() self.terminal.fork_command() self.terminal.feed_child("pacman -Sy;exit\n")
15,328
def _setup_layout(self):
def _setup_layout(self):
15,329
def run(self):
def run(self):
15,330
def run(self): self.show_all() self.terminal.do_upgrade()
def run(self): self.show() self.terminal.do_upgrade()
15,331
def _setup_pacs_models(self): self.models = {}
def _setup_pacs_models(self): self.models = {}
15,332
def _setup_pacs_models(self): self.models = {}
def _setup_pacs_models(self): self.models = {}
15,333
def get_by_keywords(self, keywords): """Return pacs which have keywords as name or in description""" keys = [] #Split keywords by '+' or spaces if keywords.count("+") and keywords.count(" "): keys_1 = keywords.split("+") for key in keys_1: keys = key.split(" ") elif keywords.count(" "): keys = keywords.split() elif keyword.count("+"): keys = keyword.split("+") else: keys = keywords
def get_by_keywords(self, keywords): """Return pacs which have keywords as name or in description""" keys = [] #Split keywords by '+' or spaces if keywords.count("+") and keywords.count(" "): keys_1 = keywords.split("+") for key in keys_1: keys = key.split(" ") elif keywords.count(" "): keys = keywords.split() elif keywords.count("+"): keys = keywords.split("+") else: keys = keywords
15,334
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
15,335
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
15,336
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
15,337
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
def _setup_notebook(self): """Setup the notebook""" notebook = self.gld.get_widget("notebook")
15,338
def _get_selected_page(self, repo_tree): model, tree_iter = repo_tree.get_selection().get_selected() if tree_iter is None: tree_iter = model.get_iter_from_string("0")
def _get_selected_page(self, repo_tree, toggle=None): model, tree_iter = repo_tree.get_selection().get_selected() if tree_iter is None: tree_iter = model.get_iter_from_string("0")
15,339
def add_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
def add_install(self, widget=None, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
15,340
def add_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
def add_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
15,341
def remove_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
def remove_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
15,342
def remove_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
def remove_install(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
15,343
def add_remove(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
def add_remove(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
15,344
def add_remove(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
def add_remove(self, widget, data=None): repos_tree = self.gld.get_widget("treeview") page = self._get_selected_page(repos_tree)
15,345
def quit(self, widget, event=None, data=None): main_quit()
def quit(self, widget, event=None, data=None): main_quit()
15,346
def _setup_columns(self):
def _setup_columns(self):
15,347
def _setup_columns(self):
def _setup_columns(self):
15,348
def _setup_columns(self):
def _setup_columns(self):
15,349
def __init__(self, packages, repo, node):
def __init__(self, packages, repo, node):
15,350
def __init__(self, fname, icons): """Create the XML Object and connect handlers, then setup notebook""" self.gld = XML(fname, "main_win")
def __init__(self, fname, icons): """Create the XML Object and connect handlers, then setup notebook""" self.gld = XML(fname, "main_win")
15,351
def __init__(self): """Init database""" #Get repos present on machine self.repos = os.listdir("/var/lib/pacman")
def __init__(self): """Init database""" #Get repos present on machine self.repos = os.listdir("/var/lib/pacman")
15,352
def matchTargets(self): rePatternedTargets = {} for pattern in self.patternedTargets.keys(): rePatternedTargets[pattern] = re.compile(pattern)
def matchTargets(self): rePatternedTargets = {} for pattern in self.patternedTargets.keys(): rePatternedTargets[pattern] = re.compile(pattern)
15,353
def filterNodes(self, seedsIn, seedsOut = None, allInBetween = False):
def filterNodes(self, seedsIn, seedsOut = None, allInBetween = False):
15,354
def filterNodes(self, seedsIn, seedsOut = None, allInBetween = False):
def filterNodes(self, seedsIn, seedsOut = None, allInBetween = False):
15,355
def filterNodes(self, seedsIn, seedsOut = None, allInBetween = False):
def filterNodes(self, seedsIn, seedsOut = None, allInBetween = False):
15,356
def DoxyfileParse(file_contents, dir, data = None): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ try: if data is None : data = {} import shlex lex = shlex.shlex(instream = file_contents, posix = True) lex.wordchars += "*+./-:" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno token = lex.get_token() key = None last_token = "" key_token = True next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: if key == '@' : key += token else : key = token if token != '@' : key_token = False else: if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True if key == '@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : DoxyfileParse(open(inc).read(),dir,data) last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES"]: continue if len(v) == 1: data[k] = v[0] return data except: return {}
def DoxyfileParse(file): data = DoxyfileParse_(file,{}) for (k,v) in data.items(): if not v : del data[k] elif k in ("INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES") : continue elif len(v)==1 : data[k] = v[0] return data def DoxyfileParse_(file, data): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ try: if data is None : data = {} import shlex lex = shlex.shlex(instream = file_contents, posix = True) lex.wordchars += "*+./-:" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno token = lex.get_token() key = None last_token = "" key_token = True next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: if key == '@' : key += token else : key = token if token != '@' : key_token = False else: if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True if key == '@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : DoxyfileParse(open(inc).read(),dir,data) last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES"]: continue if len(v) == 1: data[k] = v[0] return data except: return {}
15,357
def DoxyfileParse(file_contents, dir, data = None): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ try: if data is None : data = {} import shlex lex = shlex.shlex(instream = file_contents, posix = True) lex.wordchars += "*+./-:" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno token = lex.get_token() key = None last_token = "" key_token = True next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: if key == '@' : key += token else : key = token if token != '@' : key_token = False else: if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True if key == '@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : DoxyfileParse(open(inc).read(),dir,data) last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES"]: continue if len(v) == 1: data[k] = v[0] return data except: return {}
def DoxyfileParse(file_contents, dir, data = None): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ try: dir = os.path.dirname(file) import shlex lex = shlex.shlex(instream = file_contents, posix = True) lex.wordchars += "*+./-:" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno token = lex.get_token() key = None last_token = "" key_token = True next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: if key == '@' : key += token else : key = token if token != '@' : key_token = False else: if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True if key == '@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : DoxyfileParse(open(inc).read(),dir,data) last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES"]: continue if len(v) == 1: data[k] = v[0] return data except: return {}
15,358
def DoxyfileParse(file_contents, dir, data = None): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ try: if data is None : data = {} import shlex lex = shlex.shlex(instream = file_contents, posix = True) lex.wordchars += "*+./-:" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno token = lex.get_token() key = None last_token = "" key_token = True next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: if key == '@' : key += token else : key = token if token != '@' : key_token = False else: if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True if key == '@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : DoxyfileParse(open(inc).read(),dir,data) last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES"]: continue if len(v) == 1: data[k] = v[0] return data except: return {}
def DoxyfileParse(file_contents, dir, data = None): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. """ try: if data is None : data = {} import shlex lex = shlex.shlex(instream=open(file), posix=True) lex.wordchars += "*+./-:@~" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "" lineno = lex.lineno token = lex.get_token() key = None last_token = "" key_token = True next_key = False new_data = True def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token while token: if token in ['\n']: if last_token not in ['\\']: key_token = True elif token in ['\\']: pass elif key_token: if key == '@' : key += token else : key = token if token != '@' : key_token = False else: if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": data[key] = list() else: append_data( data, key, new_data, token ) new_data = True if key == '@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : DoxyfileParse(open(inc).read(),dir,data) last_token = token token = lex.get_token() if last_token == '\\' and token != '\n': new_data = False append_data( data, key, new_data, '\\' ) # compress lists of len 1 into single strings for (k, v) in data.items(): if len(v) == 0: data.pop(k) # items in the following list will be kept as lists and not converted to strings if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES"]: continue if len(v) == 1: data[k] = v[0] return data except: return {}
15,359
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,360
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,361
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,362
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,363
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,364
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,365
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,366
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,367
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,368
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,369
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
def append_data(data, key, new_data, token): if new_data or len(data[key]) == 0: data[key].append(token) else: data[key][-1] += token
15,370
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = ( '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
15,371
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ) default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ) default_exclude_patterns = [ '*~', ) sources = [) basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ) for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key) if type(elt) is type ("") : elt = [ elt ) sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
15,372
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = ( '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
15,373
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ) default_exclude_patterns = ( '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
15,374
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ) default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ) default_exclude_patterns = [ '*~', ) sources = [) basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ) for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key) if type(elt) is type ("") : elt = [ elt ) sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
15,375
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = str(node.dir) data = DoxyfileParse(node.get_contents(), basedir) recursive = ( data.get("RECURSIVE", "NO") == "YES" ) file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
def DoxySourceScan(node, env, path): """ Doxygen Doxyfile source scanner. This should scan the Doxygen file and add any files used to generate docs to the list of source files. """ dep_add_keys = [ '@INCLUDE', 'HTML_HEADER', 'HTML_FOOTER', 'TAGFILES' ] default_file_patterns = [ '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx', '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++', '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm', '*.py', ] default_exclude_patterns = [ '*~', ] sources = [] basedir = node.dir.abspath data = DoxyfileParse(node.abspath) recursive = data.get("RECURSIVE", "NO").upper()=="YES" file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for i in data.get("INPUT", [ "." ]): input = os.path.normpath(os.path.join(basedir,i)) if os.path.isfile(input): sources.append(input) elif os.path.isdir(input): if recursive : entries = os.walk(input) else : entries = [ (input, [], os.listdir(input)) ] for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) if ( reduce(lambda x, y: x or fnmatch(filename, y), file_patterns, False) and not reduce(lambda x, y: x or fnmatch(filename, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: if data.has_key(key): elt = data[key] if type(elt) is type ("") : elt = [ elt ] sources.extend([ os.path.normpath(os.path.join(basedir,f)) for f in elt ]) sources = map( lambda path: env.File(path), sources ) return sources
15,376
def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source)
def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML" : ("YES", "html"), "LATEX" : ("YES", "latex"), "RTF" : ("NO", "rtf"), "MAN" : ("YES", "man"), "XML" : ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source)
15,377
def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source)
def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].abspath) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source)
15,378
def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source)
def DoxyEmitter(source, target, env): """Doxygen Doxyfile emitter""" # possible output formats and their default values and output locations output_formats = { "HTML": ("YES", "html"), "LATEX": ("YES", "latex"), "RTF": ("NO", "rtf"), "MAN": ("YES", "man"), "XML": ("NO", "xml"), } data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") # add our output locations for (k, v) in output_formats.iteritems(): if data.get("GENERATE_" + k, v[0]).upper() == "YES": # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) node = env.File( os.path.join(str(dir), ".stamp" ) ) env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): targets.append(env.File( os.path.join(str(source[0].dir), data["GENERATE_TAGFILE"]) )) # don't clobber targets for node in targets: env.Precious(node) return (targets, source)
15,379
def doxyNodeHtmlDir(node): if not node.sources : return None data = DoxyfileParse(node.sources[0].get_contents(), str(node.sources[0].dir)) if data.get("GENERATE_HTML",'YES') != 'YES' : return None return os.path.normpath(os.path.join( str(node.sources[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") ))
def doxyNodeHtmlDir(node): if not node.sources : return None data = DoxyfileParse(node.sources[0].abspath) if data.get("GENERATE_HTML",'YES').upper() != 'YES' : return None return os.path.normpath(os.path.join( node.sources[0].abspath, data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") ))
15,380
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].abspath) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
15,381
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES').upper() == "YES": output_dir = os.path.normpath(os.path.join( source[0].dir.abspath, data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
15,382
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join(str(source[0].dir), tagfile)))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
15,383
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
def DoxyGenerator(source, target, env, for_signature): data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] # This will add automatic 'installdox' calls. # # For every referenced tagfile, the generator first checks for the # existence of a construction variable '<name>_DOXY_URL' where # '<name>' is the uppercased name of the tagfile sans extension # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, # it must contain the url or path to the installed documentation # corresponding to the tag file. # # Is the variable is not found and if a referenced tag file is a # target within this same build, the generator will parse the # 'Doxyfile' from which the tag file is built. It will # automatically create the html directory from the information in # that 'Doxyfile'. # # If for any referenced tagfile no url can be found, 'installdox' # will *not* be called and a warning about the missing url is # generated. if data.get('GENERATE_HTML','YES') == "YES": output_dir = os.path.normpath(os.path.join( str(source[0].dir), data.get("OUTPUT_DIRECTORY","."), data.get("HTML_OUTPUT","html") )) args = [] for tagfile in data.get('TAGFILES',[]): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) if url : url = relpath(output_dir, url) if not url: print "WARNING:",source[0].abspath, ": missing tagfile url for", tagfile args = None if args is not None and url: args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) if args: actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) actions.append(env.Action([ "touch $TARGETS" ])) return actions
15,384
def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): path, name = os.path.split(target) if test_source: if type(test_source) is not type([]): test_source = [ test_source ] else: test_source = [] testEnv = env.Copy(**kw) testEnv.Append(LIBS = '$BOOSTTESTLIB') testEnv.Append(LIBS = LIBS) sources = [] if source: sources = sources + env.Object(source) sources = sources + test_source binName = os.path.join(path,'.' + os.path.splitext(name)[0]+'.bin') testRunner = testEnv.Program(binName, sources) if DEPENDS: env.Depends(testRunner, DEPENDS) return env.Command(target, testRunner, [ './$SOURCE $BOOSTTESTARGS | tee $TARGET' ])
def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): path, name = os.path.split(target) if test_source: if type(test_source) is not type([]): test_source = [ test_source ] else: test_source = [] testEnv = env.Copy(**kw) testEnv.Append(LIBS = '$BOOSTTESTLIB') testEnv.Append(LIBS = LIBS) sources = [] if source: sources = sources + env.Object(source) sources = sources + test_source binName = os.path.join(path,'.' + os.path.splitext(name)[0]+'.bin') testRunner = testEnv.Program(binName, sources) if DEPENDS: env.Depends(testRunner, DEPENDS) return env.Command([ target, stamp ], testRunner, [ '( $SOURCE $BOOSTTESTARGS 2>&1 && touch ${TARGETS[1]} ) | tee ${TARGETS[0]}' ])
15,385
def FinalizeBoost(env): env.Tool('BoostUnitTests', [os.path.split(__file__)[0]]) if env['BOOST_TOOLSET']: runtime = "" if not env['final'] : runtime += "gd" if env['STLPORT_LIB'] : runtime += "p" if runtime: runtime = "-" + runtime env['BOOST_VARIANT'] = "-" + env['BOOST_TOOLSET'] + runtime env['BOOSTTESTLIB'] = 'libboost_unit_test_framework' + env['BOOST_VARIANT'] env.Append(LIBPATH = [ '$BOOST_LIBDIR' ], CPPPATH = [ '$BOOST_INCLUDES' ])
def FinalizeBoost(env): env.Tool('BoostUnitTests', [os.path.split(__file__)[0]]) if env['BOOST_TOOLSET']: runtime = "" if not env['final'] : runtime += "gd" if env['STLPORT_LIB'] : runtime += "p" if runtime: runtime = "-" + runtime env['BOOST_VARIANT'] = "-" + env['BOOST_TOOLSET'] + runtime env['BOOSTTESTLIB'] = 'libboost_unit_test_framework' + env['BOOST_VARIANT'] env.Append(LIBPATH = [ '$BOOST_LIBDIR' ], CPPPATH = [ '$BOOST_INCLUDES' ])
15,386
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3', '-g' ], LINKFLAGS = [ '-g' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3', '-g' ], LINKFLAGS = [ '-g' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
15,387
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3', '-g' ], LINKFLAGS = [ '-g' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3' ], CPPDEFINES = [ 'NDEBUG' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
15,388
def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): path, name = os.path.split(target) if test_source: if type(test_source) is not type([]): test_source = [ test_source ] else: test_source = [] testEnv = env.Copy(**kw) testEnv.Append(LIBS = '$BOOSTTESTLIB') testEnv.Append(LIBS = LIBS) sources = [] if source: sources = sources + env.Object(source) sources = sources + test_source binName = os.path.join(path,'.' + os.path.splitext(name)[0]+'.bin') testRunner = testEnv.Program(binName, sources) stamp = os.path.join(path,'.' + os.path.splitext(name)[0]+'.stamp') if DEPENDS: env.Depends(testRunner, DEPENDS) return env.Command([ target, stamp ], testRunner, [ '( $SOURCE $BOOSTTESTARGS 2>&1 && touch ${TARGETS[1]} ) | tee ${TARGETS[0]}' ])
def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): path, name = os.path.split(target) if test_source: if type(test_source) is not type([]): test_source = [ test_source ] else: test_source = [] testEnv = env.Copy(**kw) testEnv.Prepend(LIBS = '$BOOSTTESTLIB') testEnv.Prepend(LIBS = LIBS) sources = [] if source: sources = sources + env.Object(source) sources = sources + test_source binName = os.path.join(path,'.' + os.path.splitext(name)[0]+'.bin') testRunner = testEnv.Program(binName, sources) stamp = os.path.join(path,'.' + os.path.splitext(name)[0]+'.stamp') if DEPENDS: env.Depends(testRunner, DEPENDS) return env.Command([ target, stamp ], testRunner, [ '( $SOURCE $BOOSTTESTARGS 2>&1 && touch ${TARGETS[1]} ) | tee ${TARGETS[0]}' ])
15,389
def FinalizeBoost(env): env.Tool('BoostUnitTests', [os.path.split(__file__)[0]]) if env['BOOST_TOOLSET']: runtime = "" if not env['final'] : runtime += "gd" if env['STLPORT_LIB'] : runtime += "p" if runtime: runtime = "-" + runtime env['BOOST_VARIANT'] = "-" + env['BOOST_TOOLSET'] + runtime env['BOOSTTESTLIB'] = 'libboost_unit_test_framework' + env['BOOST_VARIANT'] env.Append(LIBPATH = [ '$BOOST_LIBDIR' ], CPPPATH = [ '$BOOST_INCLUDES' ])
def FinalizeBoost(env): env.Tool('BoostUnitTests', [os.path.split(__file__)[0]]) if env['BOOST_TOOLSET']: runtime = "" if env['final'] : runtime += env.get('BOOST_RUNTIME','') else : runtime += env.get('BOOST_DEBUG_RUNTIME','gd') if env['STLPORT_LIB'] : runtime += "p" if runtime: runtime = "-" + runtime env['BOOST_VARIANT'] = "-" + env['BOOST_TOOLSET'] + runtime env['BOOSTTESTLIB'] = 'libboost_unit_test_framework' + env['BOOST_VARIANT'] env.Append(LIBPATH = [ '$BOOST_LIBDIR' ], CPPPATH = [ '$BOOST_INCLUDES' ])
15,390
def FinalizeSTLPort(env): env['STLPORT_DEBUGLIB'] = '' if env['STLPORT_LIB']: env['STLPORT_DEBUGLIB'] = env['STLPORT_LIB'] + '_stldebug' env.Append(LIBPATH = [ '$STLPORT_LIBDIR' ], CPPPATH = [ '$STLPORT_INCLUDES' ]) if env['final']: env.Append(LIBS = [ '$STLPORT_LIB' ]) else: env.Append(LIBS = [ '$STLPORT_DEBUGLIB' ], CPPDEFINES = [ '_STLP_DEBUG' ])
def FinalizeSTLPort(env): if env['STLPORT_LIB']: env['STLPORT_DEBUGLIB'] = env['STLPORT_LIB'] + '_stldebug' env.Append(LIBPATH = [ '$STLPORT_LIBDIR' ], CPPPATH = [ '$STLPORT_INCLUDES' ]) if env['final']: env.Append(LIBS = [ '$STLPORT_LIB' ]) else: env.Append(LIBS = [ '$STLPORT_DEBUGLIB' ], CPPDEFINES = [ '_STLP_DEBUG' ])
15,391
def FinalizeSTLPort(env): env['STLPORT_DEBUGLIB'] = '' if env['STLPORT_LIB']: env['STLPORT_DEBUGLIB'] = env['STLPORT_LIB'] + '_stldebug' env.Append(LIBPATH = [ '$STLPORT_LIBDIR' ], CPPPATH = [ '$STLPORT_INCLUDES' ]) if env['final']: env.Append(LIBS = [ '$STLPORT_LIB' ]) else: env.Append(LIBS = [ '$STLPORT_DEBUGLIB' ], CPPDEFINES = [ '_STLP_DEBUG' ])
def FinalizeSTLPort(env): env['STLPORT_DEBUGLIB'] = '' if env['STLPORT_LIB']: if not env['STLPORT_DEBUGLIB']: env['STLPORT_DEBUGLIB'] = env['STLPORT_LIB'] + '_stldebug' env.Append(LIBPATH = [ '$STLPORT_LIBDIR' ], CPPPATH = [ '$STLPORT_INCLUDES' ]) if env['final']: env.Append(LIBS = [ '$STLPORT_LIB' ]) else: env.Append(LIBS = [ '$STLPORT_DEBUGLIB' ], CPPDEFINES = [ '_STLP_DEBUG' ])
15,392
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3' ], CPPDEFINES = [ 'NDEBUG' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3' ], CPPDEFINES = [ 'NDEBUG' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
15,393
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3' ], CPPDEFINES = [ 'NDEBUG' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) #return conf.Finish() return env
def MakeEnvironment(): global opts, finalizers InitOpts() env = SCons.Environment.Environment(options=opts) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 env.Help(opts.GenerateHelpText(env)) #conf = env.Configure() #env = conf.env if os.environ.has_key('SSH_AUTH_SOCK'): env.Append( ENV = { 'SSH_AUTH_SOCK': os.environ['SSH_AUTH_SOCK'] } ) for finalizer in finalizers: finalizer(env) env.Append(CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '-pedantic', '-ansi' ], LOCALLIBDIR = [ '#' ], LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: env.Append(CXXFLAGS = [ '-O3' ], CPPDEFINES = [ 'NDEBUG' ]) else: env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS = [ '-g' ]) env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ], LIBS = [ '$EXTRA_LIBS' ]) #return conf.Finish() return env
15,394
def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): path, name = os.path.split(target) if test_source: if type(test_source) is not type([]): test_source = [ test_source ] else: test_source = [] testEnv = env.Copy(**kw) testEnv.Prepend(LIBS = '$BOOSTTESTLIB') testEnv.Prepend(LIBS = LIBS) sources = [] if source: sources = sources + env.Object(source) sources = sources + test_source binName = os.path.join(path,'.' + os.path.splitext(name)[0]+'.bin') testRunner = testEnv.Program(binName, sources) stamp = os.path.join(path,'.' + os.path.splitext(name)[0]+'.stamp') if DEPENDS: env.Depends(testRunner, DEPENDS) return env.Command([ target, stamp ], testRunner, [ '( $SOURCE $BOOSTTESTARGS 2>&1 && touch ${TARGETS[1]} ) | tee ${TARGETS[0]}' ])
def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): path, name = os.path.split(target) if test_source: if type(test_source) is not type([]): test_source = [ test_source ] else: test_source = [] testEnv = env.Copy(**kw) testEnv.Prepend(LIBS = '$BOOSTTESTLIB') testEnv.Prepend(LIBS = LIBS) sources = [] if source: sources = sources + env.Object(source) sources = sources + test_source binName = os.path.join(path,'.' + os.path.splitext(name)[0]+'.bin') testRunner = testEnv.Program(binName, sources) stamp = os.path.join(path,'.' + os.path.splitext(name)[0]+'.stamp') if DEPENDS: env.Depends(testRunner, DEPENDS) return env.Command([ target, stamp ], testRunner, [ '( $SOURCE $BOOSTTESTARGS 2>&1 && touch ${TARGETS[1]} ) | tee ${TARGETS[0]}; exit $$PIPESTATUS[0]' ])
15,395
def __init__(self, storedir, repoid, callback=None):
def __init__(self, storedir, repoid, callback=None):
15,396
def getPrimary(self, location, checksum): """Load primary.xml.gz from an sqlite cache and update it if required""" return self.open_database(_sqlitecache.update_primary(location, checksum))
def getPrimary(self, location, checksum): """Load primary.xml.gz from an sqlite cache and update it if required""" return self.open_database(_sqlitecache.update_primary(location, checksum))
15,397
def getFilelists(self, location, checksum): """Load filelist.xml.gz from an sqlite cache and update it if required""" return self.open_database(_sqlitecache.update_filelist(location, checksum))
def getFilelists(self, location, checksum): """Load filelist.xml.gz from an sqlite cache and update it if required""" return self.open_database(_sqlitecache.update_filelist(location, checksum))
15,398
def url_fix_host (urlparts): """ Unquote and fix hostname. Returns is_idn. """ urlparts[1], is_idn = idna_encode(urllib.unquote(urlparts[1]).lower()) # a leading backslash in path causes urlsplit() to add the # path components up to the first slash to host # try to find this case... i = urlparts[1].find("\\") if i != -1: # ...and fix it by prepending the misplaced components to the path comps = urlparts[1][i:] # note: still has leading backslash if not urlparts[2] or urlparts[2] == '/': urlparts[2] = comps else: urlparts[2] = "%s%s" % (comps, urllib.unquote(urlparts[2])) urlparts[1] = urlparts[1][:i] else: # a leading ? in path causes urlsplit() to add the query to the # host name i = urlparts[1].find("?") if i != -1: urlparts[1], urlparts[3] = urlparts[1].split('?', 1) # path urlparts[2] = urllib.unquote(urlparts[2]) if urlparts[1]: userpass, host = urllib.splituser(urlparts[1]) if userpass: # append AT for easy concatenation userpass += "@" else: userpass = "" host, port = urllib.splitnport(host) # remove trailing dot if host.endswith("."): host = host[:-1] # remove a default (or invalid) port if port in [-1, None, default_ports.get(urlparts[0])]: urlparts[1] = userpass+host else: urlparts[1] = "%s%s:%d" % (userpass, host, port)
def url_fix_host (urlparts): """ Unquote and fix hostname. Returns is_idn. """ urlparts[1], is_idn = idna_encode(urllib.unquote(urlparts[1]).lower()) # a leading backslash in path causes urlsplit() to add the # path components up to the first slash to host # try to find this case... i = urlparts[1].find("\\") if i != -1: # ...and fix it by prepending the misplaced components to the path comps = urlparts[1][i:] # note: still has leading backslash if not urlparts[2] or urlparts[2] == '/': urlparts[2] = comps else: urlparts[2] = "%s%s" % (comps, urllib.unquote(urlparts[2])) urlparts[1] = urlparts[1][:i] else: # a leading ? in path causes urlsplit() to add the query to the # host name i = urlparts[1].find("?") if i != -1: urlparts[1], urlparts[3] = urlparts[1].split('?', 1) # path urlparts[2] = urllib.unquote(urlparts[2]) if urlparts[1]: userpass, host = urllib.splituser(urlparts[1]) if userpass: # append AT for easy concatenation userpass += "@" else: userpass = "" newhost, port = urllib.splitnport(host) if port is not None: host = newhost # remove trailing dot if host.endswith("."): host = host[:-1] # remove a default (or invalid) port if port in [-1, None, default_ports.get(urlparts[0])]: urlparts[1] = userpass+host else: urlparts[1] = "%s%s:%d" % (userpass, host, port)
15,399