rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
state.set_label(Const.STATE_NAMES[device.properties["State"]]) | def update_tab_device(self, device): """Updates the 'Device' tab given a Device object""" bus = self.xml.get_widget("ns_device_bus") state = self.xml.get_widget("ns_device_status") vendor = self.xml.get_widget("ns_device_vendor") product = self.xml.get_widget("ns_device_name") category = self.xml.get_widget("ns_device_... | |
bcdVersion = device.properties["usb.bcdVersion"] | bcdVersion = device.properties["usb.bcdDevice"] | def update_tab_usb(self, device): """Updates the 'USB' tab given a Device object; may hide it""" page = self.xml.get_widget("device_notebook").get_nth_page(1) if device.properties["Bus"]!="usb": page.hide_all() return |
(tree_model, tree_iter) = tree_selection.get_selected() if tree_iter: device_udi = tree_model.get_value(tree_iter, Const.UDI_COLUMN) | device_udi = self.get_current_focus_udi() if device_udi != None: | def on_device_tree_selection_changed(self, tree_selection): """This method is called when the selection has changed in the device tree""" (tree_model, tree_iter) = tree_selection.get_selected() if tree_iter: device_udi = tree_model.get_value(tree_iter, Const.UDI_COLUMN) device = self.udi_to_device(device_udi) self.upda... |
if self.get_current_focus_udi()==device_udi: self.update_device_notebook(device_obj) | device_focus_udi = self.get_current_focus_udi() if device_focus_udi != None: device = self.udi_to_device(device_udi) if device_focus_udi==device_udi: self.update_device_notebook(device) | def device_changed(self, dbus_if, dbus_member, dbus_svc, dbus_obj_path, dbus_message): """This method is called when properties for a HAL device changes""" [property_name] = dbus_message.get_args_list() # TODO: Update appropriate device #self.update_device_list() if property_name=="Parent": self.update_device_list() el... |
column0 = gtk.TreeViewColumn("Key", gtk.CellRendererText(), text=0) column1 = gtk.TreeViewColumn("Type", gtk.CellRendererText(), text=1) column2 = gtk.TreeViewColumn("Value", gtk.CellRendererText(), text=2) | cell_renderer = gtk.CellRendererText() cell_renderer.set_property("editable", True) column0 = gtk.TreeViewColumn("Key", cell_renderer, text=0) column1 = gtk.TreeViewColumn("Type", cell_renderer, text=1) column2 = gtk.TreeViewColumn("Value", cell_renderer, text=2) | def update_tab_advanced(self, device): """Updates the 'Advanced' tab given a Device object""" store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) keys = device.properties.keys() keys.sort() for p in keys: iter = store.append() val = device.properties[p] ptype = type(val) if ptype==str: ... |
device_udi_obj = self.hal_service.get_object(device_udi, "org.freedesktop.Hal.Device") | device_udi_obj = self.bus.get_object("org.freedesktop.Hal", device_udi) | def property_modified(self, device_udi, num_changes, change_list): """This method is called when signals on the Device interface is received""" |
if device_udi_obj.PropertyExists(property_name): device_obj.properties[property_name] = device_udi_obj.GetProperty(property_name) | if device_udi_obj.PropertyExists(property_name, dbus_interface="org.freedesktop.Hal.Device"): device_obj.properties[property_name] = device_udi_obj.GetProperty(property_name, dbus_interface="org.freedesktop.Hal.Device") | def property_modified(self, device_udi, num_changes, change_list): """This method is called when signals on the Device interface is received""" |
for p in properties: | keys = properties.keys() keys.sort() for p in keys: | def print_devices(): device_names = hal_manager.GetAllDevices() print "" print "===========================================" print "Dumping %d devices from the GDL"%(len(device_names)) print "" for name in device_names: device = hal_service.get_object(name, "org.freedesktop.Hal.Device") print "device_unique_id = %s"%na... |
self.headers['Content-Type'] = mime_type | self.headers['Content-Type'] = header | def setContentType(self, mime_type, charset=None, errors=None): if charset is None: header = mime_type else: header = '%s; charset=%s' % (mime_type, charset) self.charset = charset if errors is None: self.charsetErrors = self.charsetErrorsByType.get( mime_type, self.charsetErrors) else: self.charsetErrors = errors self... |
return '%s' % expr | return '%s' % (expr,) | def evaluateText(self, expr): expr = self.evaluate(expr) if expr in (default, None): return expr else: return '%s' % expr |
from StringIO import StringIO | def process_suite(self): m = suite_match(self.string, self.cur_pos) assert m pos = m.end() suite = self.string[self.cur_pos:pos] if not suite_check_start(suite): self.report_error( 'Embedded suite must start from new line after "...<%"', self.cur_pos) if not suite_check_end(suite): self.report_error( 'Embedded suite mu... | |
self.content = content = StringIO() self.write = write = self.content.write | self.content = content = [] self.write = write = self.content.append | def process(self): parser = Parser(self.source, self.filename) self.content = content = StringIO() self.write = write = self.content.write for state, s in parser.process(): if content.tell(): content.seek(-1, 2) char = content.read() if char not in ' \n\t;': write('; ') getattr(self, 'process_'+state)(s) source = self.... |
if content.tell(): content.seek(-1, 2) char = content.read() if char not in ' \n\t;': | if content and content[-1]: if content[-1][-1] not in ' \n\t;': | def process(self): parser = Parser(self.source, self.filename) self.content = content = StringIO() self.write = write = self.content.write for state, s in parser.process(): if content.tell(): content.seek(-1, 2) char = content.read() if char not in ' \n\t;': write('; ') getattr(self, 'process_'+state)(s) source = self.... |
source = self.content.getvalue()+'\n' | content.append('\n') source = ''.join(content) | def process(self): parser = Parser(self.source, self.filename) self.content = content = StringIO() self.write = write = self.content.write for state, s in parser.process(): if content.tell(): content.seek(-1, 2) char = content.read() if char not in ' \n\t;': write('; ') getattr(self, 'process_'+state)(s) source = self.... |
return ' '.join(self._headers_map[key.lower()]) | return ', '.join(self._headers_map[key.lower()]) | def __getitem__(self, key): '''Get header. If there are several header with the same key, their values are joined.''' return ' '.join(self._headers_map[key.lower()]) |
def __init__(self, engines_by_type = enginesByType): self._engines_by_type = enginesByType | def __init__(self, engines_by_type=enginesByType): self._engines_by_type = engines_by_type | def __init__(self, engines_by_type = enginesByType): self._engines_by_type = enginesByType |
for converter in self.chain: | for converter in reversed(self.chain): | def toForm(self, field_type, value): for converter in self.chain: value = converter.toForm(field_type, value) return value |
def interpret(self, fp=sys.stdout, globals={}, locals={}, | def interpret(self, fp=sys.stdout, globals=None, locals=None, | def interpret(self, fp=sys.stdout, globals={}, locals={}, _recursion_limit=TEMPLATE_RECURSION_LIMIT): # _recursion_limit is for internal use only interpret_dep_reg = self._create_interpret_dep_reg(_recursion_limit-1) try: self._engine.interpret(self._program, fp, globals, locals, interpret_dep_reg.getTemplate) except T... |
self._engine.interpret(self._program, fp, globals, locals, | self._engine.interpret(self._program, fp, globals or {}, locals or {}, | def interpret(self, fp=sys.stdout, globals={}, locals={}, _recursion_limit=TEMPLATE_RECURSION_LIMIT): # _recursion_limit is for internal use only interpret_dep_reg = self._create_interpret_dep_reg(_recursion_limit-1) try: self._engine.interpret(self._program, fp, globals, locals, interpret_dep_reg.getTemplate) except T... |
def toFile(self, fp, globals={}, locals={}): | def toFile(self, fp, globals=None, locals=None): | def toFile(self, fp, globals={}, locals={}): '''Renders template into file-like object.''' self.interpret(fp, globals, locals) |
def toString(self, globals={}, locals={}): | def toString(self, globals=None, locals=None): | def toString(self, globals={}, locals={}): '''Renders template and returns result as string.''' fp = _Writer() self.toFile(fp, globals, locals) return fp.getvalue() |
if charset is None: self.reader = file self.writer = StringIO else: self.reader = lambda fn: codecs.getreader(charset)(file(fn)) self.writer = lambda: codecs.getwriter(charset)(StringIO()) | writer = StringIO if charset is not None: templates_path = TemplateDirectory(templates_path, charset) writer = lambda: codecs.getwriter(charset)(StringIO()) self.writer = writer | def __init__(self, template_name, template_type, charset, globals, locals, templates_path, results_path): unittest.TestCase.__init__(self) self.template_name = template_name self.template_type = template_type if charset is None: self.reader = file self.writer = StringIO else: self.reader = lambda fn: codecs.getreader(c... |
source_finder = FileSourceFinder([self.templates_path], file=self.reader) | source_finder = FileSourceFinder([self.templates_path]) | def runTest(self): source_finder = FileSourceFinder([self.templates_path], file=self.reader) controller = TemplateController(source_finder=source_finder) template = controller.getTemplate(self.template_name, self.template_type) fp = self.writer() template.interpret(fp, self.globals, self.locals) got_result = fp.getvalu... |
params)) | params) | def accept(self, form, value=None, filter=ACFilter(), params=None): if value is None: value = self.fieldGroup.getDefault(FieldName(), Context({}), params) context = Context(value) form_content, new_value, errors = \ self.fieldGroup.accept(form, FieldName(), context, filter, params) if errors: logging.info('Errors: %r',... |
if expr in (default, None): | if expr is default or expr is None: | def evaluateText(self, expr): expr = self.evaluate(expr) if expr in (default, None): return expr else: return '%s' % (expr,) |
self.assertEqual(h['key1'], 'value1 VALUE1') | self.assertEqual(h['key1'], 'value1, VALUE1') | def testGetSet(self): '''Getting/setting/deleting item in Headers''' h = Headers([('key1', 'value1'), ('key2', 'value2'), ('KEY1', 'VALUE1')]) self.assertEqual(len(h), 3) self.assertSameItems(h.keys(), ['key1', 'key2']) self.assertEqual(h['key2'], 'value2') self.assertEqual(h['key1'], 'value1 VALUE1') h['KEY2'] = 'Valu... |
txt = part.get_payload(decode=True) | txt = part.get_payload() if txt: txt = part.get_payload(decode=True) | def analyzeMessage(ds,fp,headeronly=0,maxstat=15): msg = mime.MimeMessage(fp) for part in msg.walk(): if part.get_main_type() == 'text': txt = part.get_payload(decode=True) #del msg["content-transfer-encoding"] msg.set_payload(txt) fp.close() msg = msg.as_string() if headeronly: hdr,body = msg.split('\n\n',1) del msg b... |
pPos[1] = pPos[1] + 1.8 | def findDirection(self,entity,dt,env): mPos = entity.pos pPos = self.getPlayerPos(env) pPos[1] = pPos[1] + 1.8 self.direction = self.normalize(pPos-mPos) self.stopPoint = mPos + self.direction*10 | |
action = Action() entity.behavior.addAction(action) | def attacking(self, entity, dt, env): self.moveDirection(entity,dt) if self.distToPlayer(entity,env) < 2: #attack!!!!! self.state = "running" elif self.distToPlayer(entity,env) > self.sightrange+1: self.state = "scanning" | |
self.model.loadSkeleton('walk1.csf') | self.model.loadSkeleton('c:/src/pyrdata/walk1.csf') | def OnFileOpenSkeleton(self, event): self.model.loadSkeleton('walk1.csf') |
self.model.loadMesh('walk1.cmf') | self.model.loadMesh('c:/src/pyrdata/walk1.cmf') def OnFileOpenAnim(self, event): anim = self.model.loadAnim('c:/src/pyrdata/walk1.caf') | def OnFileOpenMesh(self, event): self.model.loadMesh('walk1.cmf') |
def main(): | def main2(): | def main(): app = PyrApp(0) app.MainLoop() |
self.physics = PhysicsBehaviorSlot() | def __init__(self): Behavior.__init__(self) self.physics = PhysicsBehaviorSlot() self.setSlot(self.physics) | |
open('/dev/tty', 'w').write('-----\n') | def equal_stats(x,y): x = os.stat(x) y = os.stat(y) return (stat.S_IMODE(x[stat.ST_MODE]) == stat.S_IMODE(y[stat.ST_MODE]) and x[stat.ST_ATIME] == y[stat.ST_ATIME] and x[stat.ST_MTIME] == y[stat.ST_MTIME]) | |
print test.stdout() | def equal_stats(x,y): x = os.stat(x) y = os.stat(y) return (stat.S_IMODE(x[stat.ST_MODE]) == stat.S_IMODE(y[stat.ST_MODE]) and x[stat.ST_ATIME] == y[stat.ST_ATIME] and x[stat.ST_MTIME] == y[stat.ST_MTIME]) | |
def _main(args): | def _main(args, parser): | def _main(args): targets = [] # Enable deprecated warnings by default. SCons.Warnings._warningOut = _scons_internal_warning SCons.Warnings.enableWarningClass(SCons.Warnings.DeprecatedWarning) SCons.Warnings.enableWarningClass(SCons.Warnings.CorruptSConsignWarning) global ssoptions ssoptions = SConscriptSettableOption... |
pdb.Pdb().runcall(_main, args) | pdb.Pdb().runcall(_main, args, parser) | def _exec_main(): all_args = sys.argv[1:] try: all_args = string.split(os.environ['SCONSFLAGS']) + all_args except KeyError: # it's OK if there's no SCONSFLAGS pass parser = OptParser() global options options, args = parser.parse_args(all_args) if options.debug == "pdb": import pdb pdb.Pdb().runcall(_main, args) else: ... |
_main(args) | _main(args, parser) | def _exec_main(): all_args = sys.argv[1:] try: all_args = string.split(os.environ['SCONSFLAGS']) + all_args except KeyError: # it's OK if there's no SCONSFLAGS pass parser = OptParser() global options options, args = parser.parse_args(all_args) if options.debug == "pdb": import pdb pdb.Pdb().runcall(_main, args) else: ... |
def get_xlc(env, xlc, xlc_r, packages): | def get_xlc(env, xlc=None, xlc_r=None, packages=[]): | def get_xlc(env, xlc, xlc_r, packages): # Use the AIX package installer tool lslpp to figure out where a # given xl* compiler is installed and what version it is. xlcPath = None xlcVersion = None xlc = env.get('CC', 'xlc') for package in packages: cmd = "lslpp -fc " + package + " 2>/dev/null | egrep '" + xlc + "([^-_a... |
xlc = env.get('CC', 'xlc') | if xlc is None: xlc = env.get('CC', 'xlc') if xlc_r is None: xlc_r = xlc + '_r' | def get_xlc(env, xlc, xlc_r, packages): # Use the AIX package installer tool lslpp to figure out where a # given xl* compiler is installed and what version it is. xlcPath = None xlcVersion = None xlc = env.get('CC', 'xlc') for package in packages: cmd = "lslpp -fc " + package + " 2>/dev/null | egrep '" + xlc + "([^-_a... |
if arg == "tree": | if arg == "pdb": if sys.platform == 'win32': lib_dir = os.path.join(sys.exec_prefix, "lib") else: lib_dir = os.path.join(sys.exec_prefix, "lib", "python" + sys.version[0:3]) args = [ sys.executable, os.path.join(lib_dir, "pdb.py") ] + \ filter(lambda x: x != "--debug=pdb", sys.argv) if sys.platform == 'win32': ret = os... | def opt_debug(opt, arg): global print_tree if arg == "tree": print_tree = 1 else: sys.stderr.write("Warning: %s is not a valid debug type\n" % arg) |
version = '__VERSION__' | version = '0.12' | def installed(self, lib): lines = string.split(self.stdout(), '\n') return lines[-3] == 'Installed SCons library modules into %s' % lib |
Get list of visualstudio versions from the Windows registry. Return a list of strings containing version numbers; an exception will be raised if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. | Get list of visualstudio versions from the Windows registry. Returns a list of strings containing version numbers. An empty list is returned if we were unable to accees the register (for example, we couldn't import the registry-access module) or the appropriate registry keys weren't found. | def get_visualstudio_versions(): """ Get list of visualstudio versions from the Windows registry. Return a list of strings containing version numbers; an exception will be raised if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. """ ... |
"exactly one task should have been iterated") self.failUnless(taskmaster.num_failed == 1, "exactly one task should have failed") | "one or more task should have been iterated") self.failUnless(taskmaster.num_failed >= 1, "one or more tasks should have failed") | def runTest(self): "test parallel jobs with tasks that raise exceptions" |
'PROGSUFFIX' : '', | 'PROGSUFFIX' : (sys.platform == 'cygwin') and '.exe' or '', | def make_win32_env(version): """ Build a dictionary of construction variables for a win32 platform. ver - the version string of DevStudio to use (e.g. "6.0") """ return make_win32_env_from_paths(get_msvc_path("include", version), get_msvc_path("lib", version), get_msvc_path("path", version) + ";" + os.environ[PATH]) |
def get_intel_compiler_top(version=None, abi=None): | def get_intel_compiler_top(version, abi): | def get_intel_compiler_top(version=None, abi=None): """ Return the main path to the top-level dir of the Intel compiler, using the given version or latest if None. The compiler will be in <top>/bin/icl.exe (icc on linux), the include dir is <top>/include, etc. """ if is_win32: if not SCons.Util.can_read_reg: raise NoR... |
using the given version or latest if None. | using the given version. | def get_intel_compiler_top(version=None, abi=None): """ Return the main path to the top-level dir of the Intel compiler, using the given version or latest if None. The compiler will be in <top>/bin/icl.exe (icc on linux), the include dir is <top>/include, etc. """ if is_win32: if not SCons.Util.can_read_reg: raise NoR... |
strsub = env.subst(self.cmdline) | strsub = env.subst(self.cmdline, target=target, source=source) | def __call__(self, env, target, source, for_signature): if for_signature: # Expand the contents of any linker command files recursively subs = 1 strsub = env.subst(self.cmdline) while subs: strsub, subs = _re_linker_command.subn(repl_linker_command, strsub) return strsub else: return "${TEMPFILE('" + self.cmdline + "')... |
def repl(match): | def repl(match, paths=paths): | def repl(match): key = string.upper(match.group(1)) if paths.has_key(key): return paths[key] else: return '---Unknown Location %s---' % match.group() |
os.environ['PYTHONPATH'] = lib_dir + os.pathsep + os.path.join(cwd, 'etc') | os.environ['PYTHONPATH'] = lib_dir + \ os.pathsep + \ os.path.join(cwd, 'build', 'etc') | def find_py(arg, dirname, names): |
def implicit_factory(self, path): """ Turn a cache implicit dependency path into a node. This is called so many times that doing caching here is a significant performance boost. __cacheable__ """ env = self.get_build_env() return env.get_factory(self.builder.source_factory)(path) | def implicit_factory(self, path): """ Turn a cache implicit dependency path into a node. This is called so many times that doing caching here is a significant performance boost. __cacheable__ """ env = self.get_build_env() return env.get_factory(self.builder.source_factory)(path) | |
implicit = map(self.implicit_factory, implicit) | factory = build_env.get_factory(self.builder.source_factory) implicit = map(factory, implicit) | def scan(self): """Scan this node's dependents for implicit dependencies.""" # Don't bother scanning non-derived files, because we don't # care what their dependencies are. # Don't scan again, if we already have scanned. if not self.implicit is None: return self.implicit = [] self.implicit_dict = {} self._children_rese... |
test.run(arguments='.') | def emit2(t, s, e): return (t + ['emit.2'], s) | |
test.must_exist(test.workpath('src', 'f.out')) test.must_exist(test.workpath('src', 'f.out.foo')) test.must_exist(test.workpath('var1', 'f.out')) test.must_exist(test.workpath('var1', 'f.out.foo')) | test.run(arguments='var2') | def emit2(t, s, e): return (t + ['emit.2'], s) |
test.must_exist(test.workpath('src', 'g.out')) test.must_exist(test.workpath('src', 'g.out.foo')) test.must_exist(test.workpath('var1', 'g.out')) test.must_exist(test.workpath('var1', 'g.out.foo')) | def emit2(t, s, e): return (t + ['emit.2'], s) | |
test.must_exist(test.workpath('src', 'h.out')) test.must_exist(test.workpath('src', 'emit.1')) test.must_exist(test.workpath('src', 'emit.2')) test.must_exist(test.workpath('var1', 'h.out')) test.must_exist(test.workpath('var1', 'emit.1')) test.must_exist(test.workpath('var1', 'emit.2')) | def emit2(t, s, e): return (t + ['emit.2'], s) | |
return os.system(s) >> 8 | stat = os.system(s) if stat & 0xff: return stat | 0x80 return stat >> 8 | def env_spawn(sh, escape, cmd, args, env): if env: s = 'env -i ' for key in env.keys(): s = s + '%s=%s '%(key, escape(env[key])) s = s + sh + ' -c ' s = s + escape(string.join(args)) else: s = string.join(args) return os.system(s) >> 8 |
ret = stat >> 8 return ret | if stat & 0xff: return stat | 0x80 return stat >> 8 | def fork_spawn(sh, escape, cmd, args, env): pid = os.fork() if not pid: # Child process. exitval = 127 args = [sh, '-c', string.join(args)] try: os.execvpe(sh, args, env) except OSError, e: exitval = exitvalmap[e[0]] sys.stderr.write("scons: %s: %s\n" % (cmd, e[1])) os._exit(exitval) else: # Parent process. pid, stat =... |
assert is_String(UserString.UserString()) | assert is_String(UserString.UserString('')) | def test_is_String(self): assert is_String("") try: import UserString except: pass else: assert is_String(UserString.UserString()) assert not is_String({}) assert not is_String([]) |
env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, locals(), globals(), RDirs)} $)' | env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs)} $)' | def generate(env): mingw = find(env) if mingw: dir = os.path.dirname(mingw) # The mingw bin directory must be added to the path: path = env['ENV'].get('PATH', []) if not path: path = [] if SCons.Util.is_String(path): path = string.split(path, os.pathsep) env['ENV']['PATH'] = string.join([dir] + path, os.pathsep) # ... |
drive_path = _my_normcase(drive) | drive = _my_normcase(drive) | def __doLookup(self, fsclass, name, directory = None, create = 1): """This method differs from the File and Dir factory methods in one important way: the meaning of the directory parameter. In this method, if directory is None or not supplied, the supplied name is expected to be an absolute path. If you try to look up... |
directory = self.Root[drive_path] | directory = self.Root[drive] | def __doLookup(self, fsclass, name, directory = None, create = 1): """This method differs from the File and Dir factory methods in one important way: the meaning of the directory parameter. In this method, if directory is None or not supplied, the supplied name is expected to be an absolute path. If you try to look up... |
self.Root[drive_path] = dir | self.Root[drive] = dir | def __doLookup(self, fsclass, name, directory = None, create = 1): """This method differs from the File and Dir factory methods in one important way: the meaning of the directory parameter. In this method, if directory is None or not supplied, the supplied name is expected to be an absolute path. If you try to look up... |
sp = [] spe = [] | def whereis(file): for dir in string.split(os.environ['PATH'], os.pathsep): f = os.path.join(dir, file) if os.path.isfile(f): try: st = os.stat(f) except OSError: continue if stat.S_IMODE(st[stat.ST_MODE]) & 0111: return f return None | |
if os.path.isfile(entry): | if not os.path.exists(entry) or os.path.isfile(entry): | def delete_func(entry, must_exist=0): if not must_exist and not os.path.exists(entry): return None if os.path.isfile(entry): return os.unlink(entry) else: return shutil.rmtree(entry, 1) |
tmp = os.path.normpath(tempfile.mktemp()) | tmp = os.path.normpath(tempfile.mktemp('.lnk')) | def __call__(self, target, source, env, for_signature): cmd = env.subst_list(self.cmd, 0, target, source)[0] if for_signature or \ (reduce(lambda x, y: x + len(y), cmd, 0) + len(cmd)) <= 2048: return self.cmd else: # In Cygwin, we want to use rm to delete the temporary file, # because del does not exist in the sh shell... |
comps = comps + '\\Microsoft\\VisualStudio\\' + version + '\\VSComponents.dat' | comps = comps + '\\Microsoft\\VisualStudio\\' + version + '\\VCComponents.dat' | def _parse_msvc7_overrides(version): """ Parse any overridden defaults for MSVS directory locations in MSVS .NET. """ # First, we get the shell folder for this user: if not SCons.Util.can_read_reg: raise SCons.Errors.InternalError, "No Windows registry module was found" comps = "" try: (comps, t) = SCons.Util.RegGetV... |
if print_tree: print print SCons.Util.render_tree(self.target, get_children) | def execute(self): if self.target.get_state() == SCons.Node.up_to_date: if self.top: print 'scons: "%s" is up to date.' % str(self.target) if print_tree: print print SCons.Util.render_tree(self.target, get_children) else: try: self.target.build() if self.top and print_tree: print print SCons.Util.render_tree(self.targe... | |
if self.top and print_tree: print print SCons.Util.render_tree(self.target, get_children) | def execute(self): if self.target.get_state() == SCons.Node.up_to_date: if self.top: print 'scons: "%s" is up to date.' % str(self.target) if print_tree: print print SCons.Util.render_tree(self.target, get_children) else: try: self.target.build() if self.top and print_tree: print print SCons.Util.render_tree(self.targe... | |
env['ASPPCOM'] = '$CC $ASFLAGS $CPPFLAGS -o $TARGET $SOURCES' | env['ASPPCOM'] = '$CC $ASFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES' | def generate(env, platform): """Add Builders and construction variables for as to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) for suffix in ASSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASAction) for suffix in ASPPSuffixes: static_obj.add_action(suffix, SCons.Defaults.ASPP... |
build("f2.out", "f2.in") | build(["f2.out"], ["f2.in"]) | def build(env, target, source): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) |
build("f4.out", "f4.in") | build(["f4.out"], ["f4.in"]) | def build(env, target, source): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) |
build("f1.out", "f1.in") | build(["f1.out"], ["f1.in"]) | def build(env, target, source): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) |
build("f3.out", "f3.in") | build(["f3.out"], ["f3.in"]) | def build(env, target, source): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) |
if sys.platform == 'win32': foo = 'foo.exe' else: foo = 'foo' test.run(arguments = "--debug=tree " + foo) | test.run(arguments = "--debug=tree foo.xxx") | #ifndef BAR_H |
+-%s +-foo%s | +-foo.xxx +-foo.ooo | #ifndef BAR_H |
+-bar%s | +-bar.ooo | #ifndef BAR_H |
""" % (foo, obj,obj) | """ | #ifndef BAR_H |
test.run(arguments = "--debug=tree " + foo) | test.run(arguments = "--debug=tree foo.xxx") | #ifndef BAR_H |
+-%s +-foo%s +-bar%s """ % (foo, obj,obj) | +-foo.xxx +-foo.ooo +-bar.ooo """ | #ifndef BAR_H |
test.run(arguments = "--debug=dtree " + foo) | test.run(arguments = "--debug=dtree foo.xxx") | #ifndef BAR_H |
+-bar%(obj)s | +-bar.ooo | #ifndef BAR_H |
+-%(foo)s | +-foo%(obj)s | | +-foo.c | | +-foo.h | | +-bar.h | +-bar%(obj)s | +-bar.c | +-bar.h | +-foo.h | #ifndef BAR_H | |
+-foo%(obj)s +-foo.c +-foo.h +-bar.h """ % globals() | +-foo.ooo | +-foo.c | +-foo.h | +-bar.h +-foo.xxx +-foo.ooo | +-foo.c | +-foo.h | +-bar.h +-bar.ooo +-bar.c +-bar.h +-foo.h """ | #ifndef BAR_H |
return listCmd | return [ listCmd ] | # Treat this source as a .def file. |
def opt_debug(option, opt, value, parser): if value in ["count", "dtree", "includes", "memory", "objects", "pdb", "presub", "time", "tree"]: | debug_options = ["count", "dtree", "includes", "memory", "objects", "pdb", "presub", "time", "tree"] def opt_debug(option, opt, value, parser, debug_options=debug_options): if value in debug_options: | def opt_debug(option, opt, value, parser): if value in ["count", "dtree", "includes", "memory", "objects", "pdb", "presub", "time", "tree"]: setattr(parser.values, 'debug', value) else: raise OptionValueError("Warning: %s is not a valid debug type" % value) |
"count, dtree, includes, memory, objects, pdb, time, tree.") | "%s." % string.join(debug_options, ", ")) | def opt_debug(option, opt, value, parser): if value in ["count", "dtree", "includes", "memory", "objects", "pdb", "presub", "time", "tree"]: setattr(parser.values, 'debug', value) else: raise OptionValueError("Warning: %s is not a valid debug type" % value) |
open("/dev/tty", "w").write("lib: self.install_dir = %s\n" % self.install_dir) | def finalize_options(self): | |
if scons: os.environ['SCONS'] = scons if scons_exec: os.environ['SCONS_EXEC'] = '1' | def find_py(arg, dirname, names): | |
args[1] = os.path.join(sys.exec_prefix, "lib", "pdb.py") | args[1] = os.path.join(sys.prefix, "lib", "pdb.py") | def opt_debug(opt, arg): global print_tree global print_dtree global print_time if arg == "pdb": args = [ sys.executable, "pdb.py" ] + \ filter(lambda x: x != "--debug=pdb", sys.argv) if sys.platform == 'win32': args[1] = os.path.join(sys.exec_prefix, "lib", "pdb.py") sys.exit(os.spawnve(os.P_WAIT, args[0], args, os.en... |
args[1] = os.path.join(sys.exec_prefix, | args[1] = os.path.join(sys.prefix, | def opt_debug(opt, arg): global print_tree global print_dtree global print_time if arg == "pdb": args = [ sys.executable, "pdb.py" ] + \ filter(lambda x: x != "--debug=pdb", sys.argv) if sys.platform == 'win32': args[1] = os.path.join(sys.exec_prefix, "lib", "pdb.py") sys.exit(os.spawnve(os.P_WAIT, args[0], args, os.en... |
return "rebuilding `%s' for unknown reasons" % self | return "rebuilding `%s' for unknown reasons\n" % self | def fmt_with_title(title, strlines): lines = string.split(strlines, '\n') sep = '\n' + ' '*(15 + len(title)) return ' '*15 + title + string.join(lines, sep) + '\n' |
return os.path.normpath(path) | path = os.path.normpath(path) drive, path = os.path.splitdrive(path) return string.lower(drive) + path | def normalize_path(path, drive=drive): if path[0] in '\\/': path = drive + path return os.path.normpath(path) |
int foo(void) | void foo(void) | def copy(target, source, env): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) |
sp = os.popen("aesub '$sp' 2>/dev/null", "r").read()[:-1] sp = string.split(sp, os.pathsep) | paths = os.popen("aesub '$sp' 2>/dev/null", "r").read()[:-1] sp.extend(string.split(paths, os.pathsep)) | def whereis(file): for dir in string.split(os.environ['PATH'], os.pathsep): f = os.path.join(dir, file) if os.path.isfile(f): try: st = os.stat(f) except OSError: continue if stat.S_IMODE(st[stat.ST_MODE]) & 0111: return f return None |
sp = [cwd] | def whereis(file): for dir in string.split(os.environ['PATH'], os.pathsep): f = os.path.join(dir, file) if os.path.isfile(f): try: st = os.stat(f) except OSError: continue if stat.S_IMODE(st[stat.ST_MODE]) & 0111: return f return None | |
def build_dir_target_climb(self, dir, tail): | def build_dir_target_climb(self, orig, dir, tail): | def build_dir_target_climb(self, dir, tail): """Create targets in corresponding build directories |
start_tail = tail[:] | def build_dir_target_climb(self, dir, tail): """Create targets in corresponding build directories | |
e = start_dir if start_tail: e = e.Entry(start_tail[0]) targets.append(e) continue | return [orig], fmt % str(orig) | def build_dir_target_climb(self, dir, tail): """Create targets in corresponding build directories |
message = "building associated BuildDir targets: %s" % string.join(map(str, targets)) | message = fmt % string.join(map(str, targets)) | def build_dir_target_climb(self, dir, tail): """Create targets in corresponding build directories |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.