rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
print name
def set_initial_from_dymola(self,res, hs_init, start_time_init, final_time_init): """ Initialize the optimization vector from an object of either ResultDymolaTextual or ResultDymolaBinary.
if num_name_hits==0: raise Exception("None of the model variables not found in result file.") print(traj.t)
def set_initial_from_dymola(self,res, hs_init, start_time_init, final_time_init): """ Initialize the optimization vector from an object of either ResultDymolaTextual or ResultDymolaBinary.
nlp_ipopt.opt_sim_ipopt_set_int_option("max_iter",500)
nlp_ipopt.opt_coll_ipopt_set_int_option("max_iter",500)
def compute_stationary(Tc_stat): init_model.set('Tc',Tc_stat) # Solve the DAE initialization system with Ipopt init_nlp_ipopt.init_opt_ipopt_solve() return (init_model.get('c'),init_model.get('T'))
nlp_ipopt.opt_sim_ipopt_solve()
nlp_ipopt.opt_coll_ipopt_solve()
def compute_stationary(Tc_stat): init_model.set('Tc',Tc_stat) # Solve the DAE initialization system with Ipopt init_nlp_ipopt.init_opt_ipopt_solve() return (init_model.get('c'),init_model.get('T'))
Tc_ctrl = Tc_res[0]
Tc_ctrl = Tc_res.x[0]
def compute_stationary(Tc_stat): init_model.set('Tc',Tc_stat) # Solve the DAE initialization system with Ipopt init_nlp_ipopt.init_opt_ipopt_solve() return (init_model.get('c'),init_model.get('T'))
def __init__(self, app, buildIcons):
def __init__(self):
def __init__(self, app, buildIcons): self.conf = Config() self.projects_populator = ProjectsPopulator(self.conf) self.app_ui = AppUi(self.conf, buildIcons) self.app_notification = AppNotification() self.projects_populator.add_listener(self.app_notification) self.projects_populator.add_listener(self.app_ui) self.auto_po...
app = QtGui.QApplication(sys.argv) buildIcons = build_icons.BuildIcons() icon = buildIcons.for_status("Success.Sleeping") app.setWindowIcon(icon) if not QtGui.QSystemTrayIcon.isSystemTrayAvailable(): QtGui.QMessageBox.critical(None, "BuildNotify", "I couldn't detect any system tray on this system.") sys.exit(1) QtGui....
BuildNotify()
def check_nodes(self): self.projects_populator.load_from_server(self.conf) self.timer.setInterval(self.conf.check_interval * 1000) self.timer.setSingleShot(True) self.timer.start()
version='0.2.4',
version='0.2.5',
def append_if_valid(target, tuple): if os.path.exists(tuple[0]): target.append(tuple)
data_files = datafiles,
def append_if_valid(target, tuple): if os.path.exists(tuple[0]): target.append(tuple)
version='0.2.3',
version='0.2.4',
def append_if_valid(target, tuple): if os.path.exists(tuple[0]): target.append(tuple)
if pynotify.init(" buildnotify "): self.notification = pynotify.Notification("buildnotify", "buildnotify", None, None)
try: if pynotify.init(" buildnotify "): self.notification = pynotify.Notification("buildnotify", "buildnotify", None, None) except NameError: pass
def __init__(self, widget): self.widget = widget self.notification = None if pynotify.init(" buildnotify "): self.notification = pynotify.Notification("buildnotify", "buildnotify", None, None)
if (str(self.settings.value("misc/settings", "notset").toString()) == "notset"): self.set_defaults() self.timeout = self.settings.value("connection/timeout").toDouble()[0] self.interval = self.settings.value("connection/interval_in_minutes").toInt()[0]
self.timeout = self.get_with_default("connection/timeout", 10).toDouble()[0] self.interval = self.get_with_default("connection/interval_in_minutes", 2).toInt()[0]
def __init__(self): self.settings = QtCore.QSettings("BuildNotify", "BuildNotify") if (str(self.settings.value("misc/settings", "notset").toString()) == "notset"): self.set_defaults() self.timeout = self.settings.value("connection/timeout").toDouble()[0] self.interval = self.settings.value("connection/interval_in_minu...
def set_defaults(self): self.settings.setValue("misc/settings", "0.1") self.settings.setValue("connection/timeout",10) self.settings.setValue("connection/interval_in_minutes", 2) self.settings.setValue("misc/timezone", "US/Central") for key,value in self.default_options.items(): self.settings.setValue("values/%s" % key...
def get_with_default(self, key, default): if (str(self.settings.value(key, "notset").toString()) == "notset"): self.settings.setValue(key, default) return self.settings.value(key)
def set_defaults(self): self.settings.setValue("misc/settings", "0.1") self.settings.setValue("connection/timeout",10) self.settings.setValue("connection/interval_in_minutes", 2) self.settings.setValue("misc/timezone", "US/Central") for key,value in self.default_options.items(): self.settings.setValue("values/%s" % key...
return self.settings.value("values/%s" % key).toBool()
return self.get_with_default("values/%s" % key , self.default_options[key]).toBool()
def get_value(self, key): return self.settings.value("values/%s" % key).toBool()
return str(self.settings.value("misc/timezone").toString())
return str(self.get_with_default("misc/timezone", "US/Central").toString())
def get_timezone(self): return str(self.settings.value("misc/timezone").toString())
winmerge_iss_path = os.path.join(cur_path, 'Installer\\InnoSetup\\WinMerge.iss')
os.chdir('Installer/InnoSetup')
def build_innosetup_installer(target_folder): """Builds the InnoSetup installer for the WinMerge.""" innosetup_exe = os.path.join(prog.innosetup_path, 'iscc.exe') cur_path = os.getcwd() winmerge_iss_path = os.path.join(cur_path, 'Installer\\InnoSetup\\WinMerge.iss') #output_switch = '/O"' + target_folder + '"' prin...
call([innosetup_exe, winmerge_iss_path])
call([innosetup_exe, 'WinMerge.iss']) os.chdir(cur_path)
def build_innosetup_installer(target_folder): """Builds the InnoSetup installer for the WinMerge.""" innosetup_exe = os.path.join(prog.innosetup_path, 'iscc.exe') cur_path = os.getcwd() winmerge_iss_path = os.path.join(cur_path, 'Installer\\InnoSetup\\WinMerge.iss') #output_switch = '/O"' + target_folder + '"' prin...
if hasPictures: self.manifest.addElement(manifest.FileEntry(fullpath="%sPictures/" % folder, mediatype=""))
def _savePictures(self, object, folder): hasPictures = False for arcname, picturerec in object.Pictures.items(): what_it_is, fileobj, mediatype = picturerec self.manifest.addElement(manifest.FileEntry(fullpath="%s%s" % ( folder ,arcname), mediatype=mediatype)) hasPictures = True if what_it_is == IS_FILENAME: self._z.wr...
uf.userSetPassword(user.getUserName(), password)
uf.userSetPassword(user.getUserId(), password)
def resetPassword(self, userid, randomstring, password): """Set the password (in 'password') for the user who maps to the string in 'randomstring' iff the entered 'userid' is equal to the mapped userid. (This can be turned off with the 'toggleUserCheck' method.)
uf.userSetPassword(stored_user, password)
uf.userSetPassword(user.getUserName(), password)
def resetPassword(self, userid, randomstring, password): """Set the password (in 'password') for the user who maps to the string in 'randomstring' iff the entered 'userid' is equal to the mapped userid. (This can be turned off with the 'toggleUserCheck' method.)
raise 'InvalidRequestError'
raise InvalidRequestError
def resetPassword(self, userid, randomstring, password): """Set the password (in 'password') for the user who maps to the string in 'randomstring' iff the entered 'userid' is equal to the mapped userid. (This can be turned off with the 'toggleUserCheck' method.)
raise 'ExpiredRequestError'
raise ExpiredRequestError
def resetPassword(self, userid, randomstring, password): """Set the password (in 'password') for the user who maps to the string in 'randomstring' iff the entered 'userid' is equal to the mapped userid. (This can be turned off with the 'toggleUserCheck' method.)
raise 'InvalidRequestError'
raise InvalidRequestError
def verifyKey(self, key): """Verify a key. Raises an exception if the key is invalid or expired. """
raise 'ExpiredRequestError'
raise ExpiredRequestError
def verifyKey(self, key): """Verify a key. Raises an exception if the key is invalid or expired. """
raise 'InvalidRequestError', 'No such user'
raise InvalidRequestError('No such user')
def verifyKey(self, key): """Verify a key. Raises an exception if the key is invalid or expired. """
exit(0)
sys.exit(0)
def run_tests(argv): clean = 0 printerr = 1 #scan for --help and --clean if len(argv) > 1: for arg in argv: if "--help" in arg: do_help(); exit(0) if "--clean" in arg: clean = 1 if "--error" in arg: if printerr == 0: printerr = 1 if printerr == 1: printerr = 0
exit(err_ct+ex_ct)
sys.exit(err_ct+ex_ct)
def run_tests(argv): clean = 0 printerr = 1 #scan for --help and --clean if len(argv) > 1: for arg in argv: if "--help" in arg: do_help(); exit(0) if "--clean" in arg: clean = 1 if "--error" in arg: if printerr == 0: printerr = 1 if printerr == 1: printerr = 0
os.environ["PATH"]+=os.pathsep+cwd + "\\VS2005\\Win32\\Release" os.environ["GLPATH"]=cwd+"\\VS2005\\Win32\\Release"
if platform.architecture()[0] == '64bit': os.environ["PATH"]+=os.pathsep+cwd + "\\VS2005\\x64\\Release" os.environ["GLPATH"]=cwd+"\\VS2005\\x64\\Release" elif platform.architecture()[0] == '32bit': os.environ["PATH"]+=os.pathsep+cwd + "\\VS2005\\Win32\\Release" os.environ["GLPATH"]=cwd+"\\VS2005\\Win32\\Release"
def run_tests(argv): clean = 0 printerr = 1 there_dir = os.getcwd() err_ct = 0 ex_ct = 0 first_time = time.time() end_time = 0 installed_dir = '/'
if testFile(SF_PATH + filename): os.unlink(SF_PATH + filename)
if testFile(SF_PATH + "\\" +filename): print "delete",SF_PATH + "\\" +filename os.unlink(SF_PATH + "\\" +filename)
def testFile(fileName): ct = int(time.time()) file_time = os.stat(fileName)[stat.ST_CTIME] return (ct - thirty_days) > file_time
os.environ["PATH"]+=os.pathsep+cwd + "\\VS2005\\Win32\\Release") os.environ["GLPATH"]=cwd+"\\VS2005\\Win32\\Release")
os.environ["PATH"]+=os.pathsep+cwd + "\\VS2005\\Win32\\Release" os.environ["GLPATH"]=cwd+"\\VS2005\\Win32\\Release"
def run_tests(argv): clean = 0 printerr = 1 #scan for --help and --clean if len(argv) > 1: for arg in argv: if "--help" in arg: do_help(); exit(0) if "--clean" in arg: clean = 1 if "--error" in arg: if printerr == 0: printerr = 1 if printerr == 1: printerr = 0
self.selected_item += self.view.view_window.height
def move_selection_right(self): self.selected_item += self.view.view_window.height
if self.selected_item == self._num_items() - 1:
if self._is_selection_on_bottom_line() and self._nothing_to_the_right():
def move_selection_right(self): if self._num_items() == 0: self.selected_item = 0 return
def testAtoJ(self):
def testAtoH(self):
def testAtoJ(self): lst = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'] data.list_files = lambda a, b: util.list_of_tuples(lst, b) # Constrain the size, to feed the test data in a controlled manner self.panel.initialize_view_settings(3, 4) self.panel.model.fill_list_by_working_dir('.')
self.assertEquals(self.panel.selected_item, 9)
self.assertEquals(self.panel.selected_item, 7)
def testAtoJ(self): lst = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'] data.list_files = lambda a, b: util.list_of_tuples(lst, b) # Constrain the size, to feed the test data in a controlled manner self.panel.initialize_view_settings(3, 4) self.panel.model.fill_list_by_working_dir('.')
if self.selected_item > self._num_items():
if self.selected_item >= self._num_items():
def move_selection_right(self): self.selected_item += self.view.view_window.height
for c in self.chords: cline += (' '*c[0] + c[1].capitalize())
for c in self.chords: cline += (' '*c[0] + c[1])
def __str__(self): cline = ' ' for c in self.chords: cline += (' '*c[0] + c[1].capitalize()) v = [cline, '%03d %s' % (self.lineno, self.bare)] return '\n'.join(v)
for c in self.chords: cline += (' '*c[0] + c[1].capitalize())
for c in self.chords: cline += (' '*c[0] + c[1])
def as_html(self): cline = '' for c in self.chords: cline += (' '*c[0] + c[1].capitalize()) v = u'<span class="chords">%s</span>\n' % cline v += u'<span class="lyrics">%s</span>\n' % self.bare return v
__version__ = "0.3"
__version__ = "0.3.3"
def handle_data(self, map): if map.has_key("sender") and map.has_key("recipient"): sender = map["sender"] recipient = map["recipient"] action = self.__get_action(recipient, sender) return action else: return DEFER_ACTION
self.value = self.line.split('=')[1]
self.value = self.line.split('=', 1)[1]
def found_terminator(self): if len(self.buffer) is not 0: self.line = self.buffer.pop() logging.debug("parsing: " + self.line) if self.line.find('=') != -1: self.key = self.line.split('=')[0] self.value = self.line.split('=')[1] self.map[self.key] = self.value elif len(self.map) is not 0: try: self.modeler = LdapModel(...
if sender in addresses: return ACCEPT_ACTION else: return REJECT_ACTION else:
for address in addresses: if address.lower() == sender.lower(): return ACCEPT_ACTION
def __get_action(self, listname, sender): listdn, listpolicy = self.__get_list_policy(listname) if listdn == None or listpolicy == None: return None else: if listpolicy == "open": return ACCEPT_ACTION elif listpolicy == "domain": senderdomain = sender.split("@")[1] listdomain = listname.split("@")[1] if listdomain == ...
if sender in addresses: return ACCEPT_ACTION else: return REJECT_ACTION
for address in addresses: if address.lower() == sender.lower(): return ACCEPT_ACTION return REJECT_ACTION
def __get_action(self, listname, sender): listdn, listpolicy = self.__get_list_policy(listname) if listdn == None or listpolicy == None: return None else: if listpolicy == "open": return ACCEPT_ACTION elif listpolicy == "domain": senderdomain = sender.split("@")[1] listdomain = listname.split("@")[1] if listdomain == ...
self.repositories = [] def repository(self, url, fetches): self.repositories += [ self.curProjName ]
def __init__(self): self.roots = [] self.nonroots = [] self.repositories = []
for dep in p.deps: if dep.name in self.roots: self.roots.remove(dep.name) if not dep.name in self.nonroots: self.nonroots += [ dep.name ]
for depName in p.prerequisiteNames([ context.host() ]): if depName in self.roots: self.roots.remove(depName) if not depName in self.nonroots: self.nonroots += [ depName ] if (not p.name in self.nonroots and not p.name in self.roots): self.roots += [ p.name ]
def project(self, p): for dep in p.deps: if dep.name in self.roots: self.roots.remove(dep.name) if not dep.name in self.nonroots: self.nonroots += [ dep.name ]
make(rgen.repositories,[ 'recurse', 'install', 'check' ])
make(rgen.roots,[ 'recurse', 'install', 'check' ])
def pubBuild(args): '''build [remoteIndexFile [localTop]] This bootstrap command will download an index database file from *remoteTop* and starts rebuilding every project listed in it. This command is meant to be used as part of cron jobs on build servers and thus designed to run to completion with no huma...
log.header(name)
def makeProject(name,targets,dependencies={}): '''Create links for prerequisites when necessary, then issue a make command and log output.''' makefile = context.srcDir(os.path.join(name,'Makefile')) objDir = context.objDir(name) if objDir != os.getcwd(): if not os.path.exists(objDir): os.makedirs(objDir) os.chdir(objDi...
default=os.path.normpath(os.path.join(os.path.dirname(sys.argv[0]), '..','share','dws'))),
buildTop,os.path.join('share','dws')),
def __init__(self): siteTop = Pathname('siteTop', 'Root of the tree where the website is generated and thus where *remoteSiteTop* is cached on the local system', default=os.getcwd()) remoteSiteTop = Pathname('remoteSiteTop', 'Root of the remote tree that holds the published website (ex: url:/var/cache).', default='') i...
vars += dgen.projects[projName].repository.vars
if dgen.projects[projName].repository: vars += dgen.projects[projName].repository.vars elif dgen.projects[projName].patch: vars += dgen.projects[projName].patch.vars
def closure(self, dgen): '''Find out all dependencies from a root set of projects as defined by the dependency generator *dgen*.''' while dgen.more(): self.parse(dgen) vars = [] reps, packages, fetches = dgen.topological() projs = reps + packages projs.reverse() for projName in projs: if projName in dgen.projects: if p...
print "* DependencyGenerator.endParse:" print " includes: " + str(self.includePats) print " excludes: " + str(self.excludePats) print " projects: " + str(self.projects) print " reps: " + str(self.repositories) print " patches: " + str(self.patches) print " packages: " + str(self.packages) p...
def endParse(self): # !!! Debugging Prints !!! print "* DependencyGenerator.endParse:" print " includes: " + str(self.includePats) print " excludes: " + str(self.excludePats) print " projects: " + str(self.projects) print " reps: " + str(self.repositories) print " patches: " + str(self.patches)...
print "!!! return topological:" print "\treps: " + str(reps) print "\tpackages: " + str(packages) print "\tfetches: " + str(self.extraFetches)
def topological(self): '''Returns a topological ordering of projects selected.''' sorted = [] for level in range(len(self.levels),0,-1): for name in self.levels[level - 1]: if not name in sorted: sorted += [ name ] reps = [] fetches = [] packages = [] for name in sorted: if name in self.repositories or name in self.pa...
print "Configure.populate with locals=" + str(self.locals)
def populate(self, buildDeps = {}): print "Configure.populate with locals=" + str(self.locals) for local in self.locals: local.populate(buildDeps)
print "!!! findCache.localName=" + localName
def findCache(names): '''Search for the presence of files in the cache directory. *names* is a dictionnary of file names used as key and the associated checksum.''' results = [] version = None for pathname in names: name = os.path.basename(urlparse.urlparse(pathname).path) writetext(name + "... ") log.flush() localName...
complete |= linkPatPath(namePat,absolutePath,
complete &= linkPatPath(namePat,absolutePath,
def linkDependencies(projects, cuts=[]): '''All projects which are dependencies but are not part of *srcTop* are not under development in the current workspace. Links to the required executables, headers, libraries, etc. will be added to the install directories such that projects in *srcTop* can build.''' missings = []...
print "!!! update.fetches=" + str(extraFetches)
def update(reps, extraFetches={}, dbindex = None, force=False): '''Update a list of *reps* within the workspace. The update will either sync with a source rep repository if the project is present in *srcTop* or will install a new binary package through the local package manager. *extraFetches* is a list of extra files ...
raise Error("Trying to read unknown variable " + name + ".\n")
raise Error("Trying to read unknown variable " + name + ".")
def value(self,name): '''returns the value of the workspace variable *name*. If the variable has no value yet, a prompt is displayed for it.''' if not name in self.environ: raise Error("Trying to read unknown variable " + name + ".\n") if (isinstance(self.environ[name],Variable) and self.environ[name].configure()): sel...
makeProject(name,recursiveTargets,{ name: projects[name]})
errcode = makeProject(name,recursiveTargets,{ name: projects[name]}) if errcode > 0: errors += [ name ]
def make(names, targets, dbindex=None): '''invoke the make utility to build a set of projects.''' writetext('### make projects "' + ', '.join(names) \ + '" with targets "' + ', '.join(targets) + '"\n') distHost = context.value('distHost') if 'recurse' in targets: targets.remove('recurse') # Recurse through projects tha...
makeProject(last,targets,{ last: projects[last]})
errcode = makeProject(last,targets,{ last: projects[last]}) if errcode > 0: errors += [ name ]
def make(names, targets, dbindex=None): '''invoke the make utility to build a set of projects.''' writetext('### make projects "' + ', '.join(names) \ + '" with targets "' + ', '.join(targets) + '"\n') distHost = context.value('distHost') if 'recurse' in targets: targets.remove('recurse') # Recurse through projects tha...
makeProject(name,targets)
errcode = makeProject(name,targets) if errcode > 0: errors += [ name ] return errors
def make(names, targets, dbindex=None): '''invoke the make utility to build a set of projects.''' writetext('### make projects "' + ', '.join(names) \ + '" with targets "' + ', '.join(targets) + '"\n') distHost = context.value('distHost') if 'recurse' in targets: targets.remove('recurse') # Recurse through projects tha...
+ commandLine + '\n')
+ commandLine)
def shellCommand(commandLine, admin=False): '''Execute a shell command and throws an exception when the command fails''' if admin: if None: # \todo cannot do this simple check because of a shell variable # setup before call to apt-get. if not commandLine.startswith('/'): raise Error("admin command without a fully quaif...
raise Error("unable to complete: " + ' '.join(cmdline) + '\n',
raise Error("unable to complete: " + ' '.join(cmdline),
def shellCommand(commandLine, admin=False): '''Execute a shell command and throws an exception when the command fails''' if admin: if None: # \todo cannot do this simple check because of a shell variable # setup before call to apt-get. if not commandLine.startswith('/'): raise Error("admin command without a fully quaif...
make(rgen.roots,[ 'recurse', 'install', 'dist' ])
errors = make(rgen.roots,[ 'recurse', 'install', 'dist' ])
def pubBuild(args): '''build [remoteIndexFile [localTop]] This bootstrap command will download an index database file from *remoteTop* and starts issuing make for every project listed in it with targets 'install' and 'dist'. This command is meant to be used as part of cron jobs on build servers and thus de...
make(repositories,args)
errors = make(repositories,args) if len(errors) > 0: raise Error("Found errors while making " + ' '.join(errors))
def pubMake(args): '''make Make projects. "make recurse" will build all dependencies required before a project can be itself built. ''' global log context.environ['siteTop'].default = os.path.dirname(os.path.dirname( os.path.realpath(os.getcwd()))) log = LogFile(context.logname(),nolog) repositories =...
raise Error("unable to complete: " + cmdline + '\n',
raise Error("unable to complete: " + cmdline,
def pubStatus(args): '''status Show status of projects checked out in the workspace with regards to commits. ''' global log log = LogFile(context.logname(),nolog) reps = args recurse = False if 'recurse' in args: recurse = True reps.remove('recurse') if len(reps) == 0: # We try to derive project names f...
self.remoteSiteTop,'db.xml'),
self.remoteSiteTop, os.path.basename(sys.argv[0]) \ + '.xml'),
def __init__(self): self.siteTop = Pathname('siteTop', 'Root of the tree where the website is generated and thus where *remoteSiteTop* is cached on the local system', default=os.getcwd()) self.remoteSiteTop = Pathname('remoteSiteTop', 'Root of the remote tree that holds the published website (ex: url:/var/cache).', def...
filename = self.logPath('dws.log')
filename = os.path.basename(self.value('remoteIndex')) filename = os.path.splitext(filename)[0] + '.log' filename = self.logPath(filename)
def logname(self): '''Name of the XML tagged log file where sys.stdout is captured.''' filename = self.logPath('dws.log') if not os.path.exists(os.path.dirname(filename)): os.makedirs(os.path.dirname(filename)) return filename
os.makedirs(self.value)
if None: os.makedirs(self.value)
def configure(self): '''Generate an interactive prompt to enter a workspace variable *var* value and returns True if the variable value as been set.''' if self.value != None: return False if log: # Configuration of logPath (where the log is stored) # will execute to here before the file is actually open. log.write('\n'...
self.description = None
self.title = None
def __init__(self, name): self.name = name self.description = None self.maintainer = None self.complete = False # *packages* maps a set of tags to *Package* instances. A *Package* # contains dependencies to install a project from a binary distribution. self.packages = {} self.patch = None self.repository = None self.in...
+ '\t' + str(self.description) + '\n' \
+ '\t' + str(self.title) + '\n' \
def __str__(self): result = 'project ' + self.name + '\n' \ + '\t' + str(self.description) + '\n' \ + '\tfound version ' + str(self.installedVersion) \ + ' installed locally\n' \ + '\tcomplete: ' + str(self.complete) + '\n' if len(self.packages) > 0: result = result + '\tpackages\n' for p in self.packages: result = res...
tagDescription = 'description'
tagTitle = 'title'
def prerequisiteNames(self, tags): '''same as *prerequisites* except only returns the names of the prerequisite projects.''' names = [] for prereq in self.prerequisites(tags): names += [ prereq.name ] return names
elif name == self.tagDescription:
elif name == self.tagTitle:
def endElement(self, name): '''Once the element is fully populated, call back the simplified interface on the handler.''' if name == self.tagDb: self.handler.endParse() elif name == self.tagAlternate: depFirst = self.locIndices.pop() tagFirst = self.tagIndices.pop() alternateSet = self.locals[depFirst:] alternates = se...
self.project.description = self.text.strip()
self.project.title = self.text.strip()
def endElement(self, name): '''Once the element is fully populated, call back the simplified interface on the handler.''' if name == self.tagDb: self.handler.endParse() elif name == self.tagAlternate: depFirst = self.locIndices.pop() tagFirst = self.tagIndices.pop() alternateSet = self.locals[depFirst:] alternates = se...
copySrcPackages = ' '.join('rsync',' '.join(srcPackages),srcPackageDir)
copySrcPackages = ' '.join(['rsync', ' '.join(srcPackages), srcPackageDir])
def pubCollect(args): '''collect Consolidate local dependencies information into a global dependency database. Copy all distribution packages built into a platform distribution directory. (example: dws --exclude test collect) ''' # Create the distribution directory, i.e. where packages are stored. packa...
copyBinPackages = ' '.join('rsync',' '.join(binPackages),packageDir)
copyBinPackages = ' '.join(['rsync', ' '.join(binPackages), packageDir])
def pubCollect(args): '''collect Consolidate local dependencies information into a global dependency database. Copy all distribution packages built into a platform distribution directory. (example: dws --exclude test collect) ''' # Create the distribution directory, i.e. where packages are stored. packa...
if os.path.exists(srcDir):
projectName = srcDir[len(srcTop) + 1:] if projectName: reps = [ projectName ] else:
def pubUpdate(args): '''update Update projects installed in the workspace ''' global log log = LogFile(context.logname(),nolog) reps = args recurse = False if 'recurse' in args: recurse = True reps.remove('recurse') if len(reps) == 0: # We try to derive project names from the current directory whever # ...
else: reps = [ context.cwdProject() ]
def pubUpdate(args): '''update Update projects installed in the workspace ''' global log log = LogFile(context.logname(),nolog) reps = args recurse = False if 'recurse' in args: recurse = True reps.remove('recurse') if len(reps) == 0: # We try to derive project names from the current directory whever # ...
'Destination of installed packages on a Darwin local machine. Installing on the "LocalSystem" requires administrator privileges.',
None, descr='Destination of installed packages on a Darwin local machine. Installing on the "LocalSystem" requires administrator privileges.',
def __init__(self): self.siteTop = Pathname('siteTop', 'Root of the tree where the website is generated and thus where *remoteSiteTop* is cached on the local system', default=os.getcwd()) self.remoteSiteTop = Pathname('remoteSiteTop', 'Root of the remote tree that holds the published website (ex: url:/var/cache).', def...
if not os.path.isdir(context.srcDir(name)):
if (not os.path.isdir(context.srcDir(name)) and self.filters(name)):
def candidates(self): '''Returns a triple (repositories, patches, packages) where each element is a list of rows, each row describes a missing prerequisite project. When a missing project can be installed from either a repository, a patch or a package, it will be described in each element of the triplet as appropriate....
if ((newEdge[1] in self.repositories
if (newEdge[1] in self.repositories
def endParse(self): # !!! Debugging Prints !!! # print "* endParse:" # print " includes: " + str(self.includePats) # print " excludes: " + str(self.excludePats) # print " levels: " + str(self.levels) # print " missings: " + str(self.missings)
or newEdge[1] in self.packages) and newEdge[1] in self.projects): self.levels[0] += [ newEdge ]
or newEdge[1] in self.packages): if newEdge[1] in self.projects: self.levels[0] += [ newEdge ]
def endParse(self): # !!! Debugging Prints !!! # print "* endParse:" # print " includes: " + str(self.includePats) # print " excludes: " + str(self.excludePats) # print " levels: " + str(self.levels) # print " missings: " + str(self.missings)
class SingleChoice(Variable):
class MultipleChoice(Variable):
def configure(self): '''Generate an interactive prompt to enter a workspace variable *var* value and returns True if the variable value as been set.''' if self.value != None: return False if log: # Configuration of logDir (where the log is stored) # will execute to here before the file is actually open. log.write('\n' ...
if self.var:
if self.choice: self.choice += [ self.text ] elif self.var:
def endElement(self, name): '''Once the element is fully populated, call back the simplified interface on the handler.''' if name == self.tagDb: self.handler.endParse() elif name == self.tagAlternate: depFirst = self.locIndices.pop() tagFirst = self.tagIndices.pop() alternateSet = self.locals[depFirst:] alternates = se...
results.append((namePat,linked))
results.append((namePat,fullNames[0]))
def findData(dir,names,excludes=[]): '''Search for a list of extra files that can be found from $PATH where bin was replaced by *dir*.''' results = [] for namePat, absolutePath in names: if absolutePath: # absolute paths only occur when the search has already been # executed and completed successfuly. results.append((n...
pathname, ext = os.path.splitext(absolutePath)
ext = '.a' if absolutePath: pathname, ext = os.path.splitext(absolutePath)
def linkPathLib(namePat, absolutePath): '''Normalize a library name to a name that will be used to create a link in buildLib later referenced from Makefiles.''' pathname, ext = os.path.splitext(absolutePath) libname = libPrefix() + namePat + ext return os.path.join(context.value('libDir'),libname), absolutePath
print """<?xml version="1.0"?>
sys.stdout.write("""<?xml version="1.0"?>
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
"""
""")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "</para>" print "</listitem>" print "</varlistentry>"
sys.stdout.write("</para>\n") sys.stdout.write("</listitem>\n") sys.stdout.write("</varlistentry>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "</variablelist>" print "</refsection>"
sys.stdout.write("</variablelist>\n") sys.stdout.write("</refsection>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "<refsection>" print '<title>' + line.strip() + '</title>' print "<variablelist>"
sys.stdout.write("<refsection>\n") sys.stdout.write('<title>' + line.strip() + '</title>\n') sys.stdout.write("<variablelist>")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "<varlistentry>"
sys.stdout.write("<varlistentry>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "<term>" + ' '.join(s[0:2]) + "</term>"
sys.stdout.write("<term>" + ' '.join(s[0:2]) + "</term>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "<term>" + line + "</term>"
sys.stdout.write("<term>" + line + "</term>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "<term xml:id=\"" + s[0] + "\">"
sys.stdout.write("<term xml:id=\"" + s[0] + "\">\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "<term>" print s[0] + "</term>" print "<listitem>" print "<para>"
sys.stdout.write("<term>\n") sys.stdout.write(s[0] + "</term>\n") sys.stdout.write("<listitem>\n") sys.stdout.write("<para>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
print "</variablelist>" print "</refsection>" print """</refentry> """
sys.stdout.write("</variablelist>\n") sys.stdout.write("</refsection>\n") sys.stdout.write("</refentry>\n")
def unpack(pkgfilename): '''unpack a tar[.gz|.bz2] source distribution package.''' if pkgfilename.endswith('.bz2'): d = 'j' elif pkgfilename.endswith('.gz'): d = 'z' shellCommand('tar ' + d + 'xf ' + pkgfilename) return os.path.basename(os.path.splitext(os.path.splitext(pkgfilename)[0]))
context.remoteSiteTop.default = os.path.dirname(remoteCachePath)
context.environ['remoteSiteTop'].default \ = os.path.dirname(remoteCachePath)
def remoteSite(self,indexPath): '''We need to set the remoteIndex to a realpath when we are dealing with a local file else links could end-up generating a different prefix than remoteSiteTop for remoteIndex.''' remoteIndex = indexPath if not ':' in remoteIndex: remoteIndex = os.path.realpath(remoteIndex) context.enviro...
context.remoteSiteTop.default = remoteCachePath
context.environ['remoteSiteTop'].default = remoteCachePath
def remoteSite(self,indexPath): '''We need to set the remoteIndex to a realpath when we are dealing with a local file else links could end-up generating a different prefix than remoteSiteTop for remoteIndex.''' remoteIndex = indexPath if not ':' in remoteIndex: remoteIndex = os.path.realpath(remoteIndex) context.enviro...
index = IndexProjects(context,
dbindex = IndexProjects(context,
def findRSync(): '''Check if rsync is present and install it through the package manager if it is not. rsync is a little special since it is used directly by this script and the script is not always installed through a project.''' rsync = os.path.join(context.value('binBuildDir'),'rsync') if not os.path.exists(rsync): ...
dgen = DependencyGenerator([ 'dws' ],[],[]) index.parse(dgen)
rsyncs, version = findBin([ [ 'rsync', None ] ]) if len(rsyncs) == 0 or not rsyncs[0][1]: install(['rsync'],{},dbindex) name, absolutePath = rsyncs.pop() linkName, linkPath = linkPathBin(name, absolutePath) linkContext(linkPath,linkName)
def findRSync(): '''Check if rsync is present and install it through the package manager if it is not. rsync is a little special since it is used directly by this script and the script is not always installed through a project.''' rsync = os.path.join(context.value('binBuildDir'),'rsync') if not os.path.exists(rsync): ...
print prevLogTestName + " different"
def logAdvance(log): logTestName = None logLineNum = sys.maxint logLine = log.readline() # print "advance log: " + logLine look = re.match('(\d+):@@ test: (\S+) (\S+)? @@',logLine) if look != None: logLineNum = int(look.group(1)) logTestName = look.group(2) # group(3) if present is status return logLineNum, logTestName...
print prevLogTestName + " identical"
def logAdvance(log): logTestName = None logLineNum = sys.maxint logLine = log.readline() # print "advance log: " + logLine look = re.match('(\d+):@@ test: (\S+) (\S+)? @@',logLine) if look != None: logLineNum = int(look.group(1)) logTestName = look.group(2) # group(3) if present is status return logLineNum, logTestName...
print logTestName + " identical"
def logAdvance(log): logTestName = None logLineNum = sys.maxint logLine = log.readline() # print "advance log: " + logLine look = re.match('(\d+):@@ test: (\S+) (\S+)? @@',logLine) if look != None: logLineNum = int(look.group(1)) logTestName = look.group(2) # group(3) if present is status return logLineNum, logTestName...