26 import sys, os, inspect, copy
30 return ".".
join(name.replace(
"python/",
"").
replace(
".py",
"").
split(
"/")[-3:])
34 """ANSI escape display sequences"""
37 alternate =
"\033[32m"
39 backlight =
"\033[43m"
41 lessemphasis =
"\033[30m"
42 deemphasis =
"\033[1;30m"
59 self.
module = __import__(name,[],[],
"*")
62 print indent,
"+", Color.info, self.
name, Color.none
64 self.dependencies.sort(key =
lambda x: x.name)
68 """ recursive search for pattern in source files"""
71 for number, line
in enumerate(inspect.getsource(self.
module).splitlines()):
77 self.hit.number = number
78 self.hit.filename = filename
80 self.hit.stacks =
list()
81 result.append(self.
hit)
82 self.hit.stacks.append(copy.copy(_stack))
84 _stack.append(self.
name)
86 package.search(pattern,result)
91 class mymf(modulefinder.ModuleFinder):
99 modulefinder.ModuleFinder.__init__(self,*args,**kwargs)
100 def import_hook(self, name, caller=None, fromlist=None, level=-1):
104 return modulefinder.ModuleFinder.import_hook(self,name,caller,fromlist, level=level)
110 if partnam
in (
"FWCore",
"os"):
113 r = modulefinder.ModuleFinder.import_module(self,partnam,fqname,parent)
118 r = modulefinder.ModuleFinder.import_module(self,partnam,fqname,parent)
121 self._depgraph.setdefault(self._last_caller.__name__,{})[r.__name__] = 1
123 def load_module(self, fqname, fp, pathname, (suffix, mode, type)):
124 r = modulefinder.ModuleFinder.load_module(self, fqname, fp, pathname, (suffix, mode, type))
126 self.
_types[r.__name__] = type
133 packageDict[toplevel] =
Package(toplevel, top =
True)
136 for key, value
in depgraph.iteritems():
137 if key.count(
".") == 2
and key != toplevel:
138 packageDict[key] =
Package(key)
139 for name
in value.keys():
140 if name.count(
".") == 2: packageDict[name] =
Package(name)
142 for key, value
in depgraph.iteritems():
143 if key.count(
".") == 2
or key == toplevel:
144 package = packageDict[key]
145 package.dependencies = [packageDict[name]
for name
in value.keys()
if name.count(
".") == 2]
148 return packageDict[toplevel]
152 modulefinder =
mymf(path)
153 modulefinder.run_script(filename)
154 globalDependencyDict = modulefinder._depgraph
155 globalDependencyDict[toplevelname] = globalDependencyDict[
"__main__"]
156 return globalDependencyDict
166 return dependencyGraph
def getDependenciesFromPythonFile
def packageNameFromFilename
static std::string join(char **cmd)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run