rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
e[0](*e[1:]) | try: e[0](*e[1:]) except: import pdb; pdb.set_trace() | def handle_events(self): """ check for outstanding events """ if len(self.events) == 0: return if not self._event: #waiting, so do an immediate process e = self.events.pop(0) #stored as [(function, args))] self._event = e e[0](*e[1:]) #call the function with the args |
def stuff_event(self, event, *args): """ stuff an event near the head of the queue """ self.events.insert(0, (event, )+(args)) return args[0] | def queue_event(self, event, *args): | |
self.menu.append(self.items[i]) | if i in self.items: self.menu.append(self.items[i]) else: log.error("Menu item %s not found in MenuItem collection"%i) | def on_set_menu(self, *args): """ add the items in args to the menu """ log.debug("set menu to %s"%list(args)) for i in args: self.menu.append(self.items[i]) self._event_finish() |
if "new game" in [x.name for x in self.menu]: import pdb; pdb.set_trace() for i in self.menu: i.goto((i.hx,i.hy)) log.debug("fadeOut menu %s"%[x.name for x in self.menu]) | for i in self.menu: self.stuff_event(i.on_goto, (i.hx,i.hy)) log.debug("fadeOut menu using goto %s"%[x.name for x in self.menu]) | def on_menu_fadeOut(self): """ animate hiding the menu """ if "new game" in [x.name for x in self.menu]: import pdb; pdb.set_trace() for i in self.menu: i.goto((i.hx,i.hy)) log.debug("fadeOut menu %s"%[x.name for x in self.menu]) self._event_finish() |
for i in self.menu: i.place((i.hx, i.hy)) log.debug("hide menu %s"%[x.name for x in self.menu]) | for i in self.menu: self.stuff_event(i.on_place, (i.hx,i.hy)) log.debug("hide menu using place %s"%[x.name for x in self.menu]) | def on_menu_hide(self): """ hide the menu """ for i in self.menu: i.place((i.hx, i.hy)) log.debug("hide menu %s"%[x.name for x in self.menu]) self._event_finish() |
for i in self.menu: i.place((i.sx, i.sy)) log.debug("show menu %s"%[x.name for x in self.menu]) | for i in self.menu: self.stuff_event(i.on_place, (i.sx,i.sy)) log.debug("show menu using place %s"%[x.name for x in self.menu]) | def on_menu_show(self): """ show the menu """ for i in self.menu: i.place((i.sx, i.sy)) log.debug("show menu %s"%[x.name for x in self.menu]) self._event_finish() |
for i in self.menu: i.goto((i.sx, i.sy)) log.debug("fadeIn menu %s"%[x.name for x in self.menu]) | log.debug("fadeIn menu, telling items to goto %s"%[x.name for x in self.menu]) for i in self.menu: self.stuff_event(i.on_goto, (i.sx,i.sy)) | def on_menu_fadeIn(self): """ animate showing the menu """ for i in self.menu: i.goto((i.sx, i.sy)) log.debug("fadeIn menu %s"%[x.name for x in self.menu]) self._event_finish() |
if not hasattr(self, a): q = getattr(self, "on_%s"%a, None) if q: f = create_event(q) setattr(self, a, f) return f return getattr(self, a) | q = getattr(self, "on_%s"%a, None) if a[:3] != "on_" else None if q: f = create_event(q) setattr(self, a, f) return f raise AttributeError | def __getattr__(self, a): if not hasattr(self, a): #possibly set up a queue function q = getattr(self, "on_%s"%a, None) if q: f = create_event(q) setattr(self, a, f) return f return getattr(self, a) |
self.add(MenuItem("e_save", editor_load, (90, 10), (90,-50), "s").smart(self)) | self.add(MenuItem("e_save", editor_save, (90, 10), (90,-50), "s").smart(self)) | def editor_select_object_close(game, collection, player): game.menu_fadeOut() game.menu_pop() game.menu_fadeIn() |
self._x, self._y = 0,0 self._sx, self._sy = 0,0 self._ax, self._ay = 0, 0 | self._x, self._y = 0,0 self._sx, self._sy = 0,0 self._ax, self._ay = 0, 0 self._tx, _ty = 0,0 | def __init__(self, name=None): self.name = name if name else "Unitled %s"%self.__name__ self._motion_queue = [] #actor's deltas for moving on the screen in the near-future self.action = None self.actions = {} self._alpha = 255 self._alpha_target = 255 self.font_speech = None self._x, self._y = 0,0 # place in... |
self._tx, _ty = 0,0 | def __init__(self, name=None): self.name = name if name else "Unitled %s"%self.__name__ self._motion_queue = [] #actor's deltas for moving on the screen in the near-future self.action = None self.actions = {} self._alpha = 255 self._alpha_target = 255 self.font_speech = None self._x, self._y = 0,0 # place in... | |
scene.add(self) | self.game.stuff_event(scene.on_add, self) | def on_relocate(self, scene, destination=None): # """ relocate this actor to scene at destination instantly """ if type(scene) == str: scene = self.game.scenes[scene] if destination: pt = get_point(self.game, destination) self.x, self.y = pt |
ok.place((900,250)) self._event_finish() | self.game.stuff_event(ok.on_place, (900,250)) self._event_finish() def on_wait(self, data): """ helper function for when we pass control of the event loop to a modal and need user input before we continue """ pass | def close_msgbox(game, actor, player): |
self.gene_dict = euhelpers.fetch_gene_records(self.id)[0] | self.gene_dict = euhelpers.fetch_gene_record(self.id) | def __init__(self,gene_id): self.id = gene_id self.gene_dict = euhelpers.fetch_gene_records(self.id)[0] |
g = Gene(6392) | g = Gene('6392') | def links(self): assert(0) # the following is one source of links # finish this function when other sources are in hand return self.gene_dict['Entrezgene_gene']['Gene-ref']['Gene-ref_db'] |
gene: %(name)s (%(id)d; %(maploc)s) | gene: %(name)s (%(id)s; %(maploc)s) | def links(self): assert(0) # the following is one source of links # finish this function when other sources are in hand return self.gene_dict['Entrezgene_gene']['Gene-ref']['Gene-ref_db'] |
if maybe: | if maybe is not None: | def _model(data, fields=()): """ Models. Will respect the `fields` and/or `exclude` on the handler (see `typemapper`.) """ ret = { } handler = self.in_typemapper(type(data), self.anonymous) get_absolute_uri = False |
self.write(request.nereid_user.id, {'password': 'password'}) | self.write(request.nereid_user.id, {'password': form.password.data}) | def change_password(self): "Changes the password" form = ChangePasswordForm(request.form) if request.method == 'POST' and form.validate(): self.write(request.nereid_user.id, {'password': 'password'}) flash('Your password has been successfully changed!') return render_template('change-password.jinja') |
value = unicode(value) | value = unicode(value, errors='ignore') | def slugify(value): """ Normalizes string, converts to lowercase, removes non-alpha characters, and converts spaces to hyphens. From Django's "django/template/defaultfilters.py". Source : http://code.activestate.com/recipes/577257/ (r2) """ if not isinstance(value, unicode): value = unicode(value) value = unicodedat... |
if isinstance(vals.get('_parent_sale.currency'), (int, long)): | currency = vals.get('_parent_sale.currency') if currency and isinstance(currency, (int, long)): | def on_change_with_amount(self, vals): currency_obj = self.pool.get('currency.currency') if vals.get('type') == 'line': if isinstance(vals.get('_parent_sale.currency'), (int, long)): currency = currency_obj.browse(vals['_parent_sale.currency']) else: currency = vals['_parent_sale.currency'] amount = Decimal(str(vals.ge... |
else: currency = vals['_parent_sale.currency'] | def on_change_with_amount(self, vals): currency_obj = self.pool.get('currency.currency') if vals.get('type') == 'line': if isinstance(vals.get('_parent_sale.currency'), (int, long)): currency = currency_obj.browse(vals['_parent_sale.currency']) else: currency = vals['_parent_sale.currency'] amount = Decimal(str(vals.ge... | |
self.assertRaises(Exception, test_view('sale')) | test_view('sale') | def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('sale')) |
file.write(" template< > const RTTI::ClassInfo* const be_typeid< %s >::type = &%s;\n" % (fullname, classname)) file.write(" template< > const RTTI::ClassInfo* const be_typeid< %s& >::type = &%s;\n" % (fullname, classname)) file.write(" template< > const RTTI::ClassInfo* const be_typeid< %s const >::type = &%s;... | file.write(" template< > const RTTI::ClassInfo* const be_typeid< %s >::klass = &%s;\n" % (fullname, classname)) | def dump(self, file, namespace = '', index = 0): file.write("#include <rtti/stdafx.h>\n") file.write("#include <%s>\n" % self.source) file.write("#include <rtti/typeinfo.hh>\n") file.write("#include <rtti/engine/classinfo.script.hh>\n") file.write("#include <rtti/engine/methodinfo.script.hh>\n") file.wri... |
@extension(['.y', '.yc', '.yy']) def big_bison(self, node): """when it becomes complicated (unlike flex), the old recipes work better (cwd)""" has_h = '-d' in self.env['BISONFLAGS'] | def exec_command_flex(self, *k, **kw): if isinstance(k[0], list): lst = [] carry = '' for a in k[0]: if a == '-o': carry = a else: lst.append(carry + a) carry = '' k = [lst] | def post_run_bison(task): source = task.outputs[0] header = task.outputs[1] env = task.env try: os.stat(header.abspath(env)) except OSError: try: oldheader = source.change_ext(source.suffix()+'.h') os.rename(oldheader.abspath(env), header.abspath(env)) except OSError: pass task.post_run_orig() |
if node.name.endswith('.yc') or node.name.endswith('.yy'): | if node.name.endswith('.ll'): | def big_bison(self, node): """when it becomes complicated (unlike flex), the old recipes work better (cwd)""" has_h = '-d' in self.env['BISONFLAGS'] outs = [] if node.name.endswith('.yc') or node.name.endswith('.yy'): outs.append(node.change_ext('.cc')) if has_h: outs.append(node.change_ext('.hh')) else: outs.append(n... |
if has_h: outs.append(node.change_ext('.hh')) | def big_bison(self, node): """when it becomes complicated (unlike flex), the old recipes work better (cwd)""" has_h = '-d' in self.env['BISONFLAGS'] outs = [] if node.name.endswith('.yc') or node.name.endswith('.yy'): outs.append(node.change_ext('.cc')) if has_h: outs.append(node.change_ext('.hh')) else: outs.append(n... | |
if has_h: outs.append(node.change_ext('.h')) | def big_bison(self, node): """when it becomes complicated (unlike flex), the old recipes work better (cwd)""" has_h = '-d' in self.env['BISONFLAGS'] outs = [] if node.name.endswith('.yc') or node.name.endswith('.yy'): outs.append(node.change_ext('.cc')) if has_h: outs.append(node.change_ext('.hh')) else: outs.append(n... | |
tsk = self.create_task('bison', node, outs) | tsk = self.create_task('flex', node, outs) | def big_bison(self, node): """when it becomes complicated (unlike flex), the old recipes work better (cwd)""" has_h = '-d' in self.env['BISONFLAGS'] outs = [] if node.name.endswith('.yc') or node.name.endswith('.yy'): outs.append(node.change_ext('.cc')) if has_h: outs.append(node.change_ext('.hh')) else: outs.append(n... |
tsk.cwd = node.bld_dir(tsk.env) | def big_bison(self, node): """when it becomes complicated (unlike flex), the old recipes work better (cwd)""" has_h = '-d' in self.env['BISONFLAGS'] outs = [] if node.name.endswith('.yc') or node.name.endswith('.yy'): outs.append(node.change_ext('.cc')) if has_h: outs.append(node.change_ext('.hh')) else: outs.append(n... | |
w("\t%s = {\n" % d.phaseId[-1]) | w("\t%s = {\n" % d.phaseId[0]) | def writePBXSourcesBuildPhase(self): w = self.file.write w("/* Begin PBXSourcesBuildPhase section */\n") for d in self.projects: w("\t%s = {\n" % d.phaseId[-1]) w("\t\tisa = PBXSourcesBuildPhase;\n") w("\t\tbuildActionMask = 2147483647;\n") w("\t\tfiles = (\n") if d.usemaster: w("\t\t\t%s,\n" % d.masterbuildid) self.wr... |
for n,d in tree.directories.iteritems(): w("\t\t\t%s,\n"%d.id) | def pbxDirTree(self, tree, name): w = self.file.write w("\t%s = {\n" % tree.id) w("\t\tisa = PBXGroup;\n") w("\t\tname = \"%s\";\n" % name) w("\t\tsourceTree = \"<group>\";\n") w("\t\tchildren = (\n") for file in tree.files: w("\t\t\t%s,\n"%file.id) for n,d in tree.directories.iteritems(): w("\t\t\t%s,\n"%d.id) w("\t\t... | |
w("\t%s = { isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = %s; path = \"%s\" ; sourceTree = \"<group>\"; };\n" % (file.id, filetype, filename)) | w("\t%s = { isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = %s; name = \"%s\"; path = \"%s\" ; sourceTree = \"<group>\"; };\n" % (file.id, filetype, os.path.split(filename)[1], filename)) | def pbxFileRefTree(self, tree, path=''): w = self.file.write for name,dir in tree.directories.iteritems(): self.pbxFileRefTree(dir, os.path.join(path, tree.prefix)) for file in tree.files: filename = os.path.join(path, tree.prefix, file.filename) if isinstance(file, mak.sources.hsource): filetype = "sourcecode.c.h" eli... |
print self.projects | def writePBXBuildFile(self): w = self.file.write w("/* Begin PBXBuildFile section */\n") print self.projects for d in self.projects: self.pbxBuildTree(d.sourceTree) w("/* End PBXBuildFile section */\n\n") | |
for d in self.projects: | projects = [] for d in self.projects: projects.append((d.projectCategory+'.'+d.projectName, d)) projects.sort(key = lambda i: i[0]) for name, d in projects: | def writePBXGroup(self): w = self.file.write w("/* Begin PBXGroup section */\n") w("\t%s = {\n" % self.mainGroup) w("\t\tisa = PBXGroup;\n") w("\t\tname = BugEngine;\n") w("\t\tsourceTree = \"<group>\";\n") w("\t\tchildren = (\n") for d in self.projects: w("\t\t\t%s,\n"%d.sourceTree.id) w("\t\t);\n") w("\t};\n") for d ... |
for d in self.projects: self.pbxDirTree(d.sourceTree, d.projectName) | for name, d in projects: self.pbxDirTree(d.sourceTree, name) | def writePBXGroup(self): w = self.file.write w("/* Begin PBXGroup section */\n") w("\t%s = {\n" % self.mainGroup) w("\t\tisa = PBXGroup;\n") w("\t\tname = BugEngine;\n") w("\t\tsourceTree = \"<group>\";\n") w("\t\tchildren = (\n") for d in self.projects: w("\t\t\t%s,\n"%d.sourceTree.id) w("\t\t);\n") w("\t};\n") for d ... |
w(" objectVersion = %d;\n" % self.version) | w(" objectVersion = %d;\n" % self.version[1]) | def writeHeader(self): w = self.file.write w("// !$*UTF8*$!\n") w("{\n") w(" archiveVersion = 1;\n") w(" classes = {\n") w(" };\n") w(" objectVersion = %d;\n" % self.version) w(" objects = {\n\n") |
pass | def writePBXBuildFile(self): w = self.file.write w("/* Begin PBXBuildFile section */\n") for d in self.projects: pass w("/* End PBXBuildFile section */\n\n") | |
w("\t\thasScannedForEncodings = 1;\n") | w("\t\tcompatibilityVersion = \"%s\";\n" % self.version[0]) w("\t\tbuildConfigurationList = %s;\n" % self.configurationsID) w("\t\thasScannedForEncodings = 0;\n") | def writePBXProject(self): w = self.file.write w("/* Begin PBXProject section */\n") w("\t%s /* Project object */ = {\n" % self.projectID) w("\t\tisa = PBXProject;\n") w("\t\thasScannedForEncodings = 1;\n") w("\t\tprojectDirPath=\"\";\n") w("\t\ttargets = (\n") w("\t\t);\n") w("\t};\n") for d in self.projects: pass w("... |
for d in self.projects: pass | def writePBXProject(self): w = self.file.write w("/* Begin PBXProject section */\n") w("\t%s /* Project object */ = {\n" % self.projectID) w("\t\tisa = PBXProject;\n") w("\t\thasScannedForEncodings = 1;\n") w("\t\tprojectDirPath=\"\";\n") w("\t\ttargets = (\n") w("\t\t);\n") w("\t};\n") for d in self.projects: pass w("... | |
'xcode2': ('XCode 2.5', 42), | 'xcode2': ('Xcode 2.5', 42), 'xcode3': ('Xcode 3.1', 45), | def __init__(self): pass |
solution.writeXCBuildConfiguration() | def generateProject(task): solution = XCodeProject( task.name, task.outputs[0].bldpath(task.env), task.version, task.projects) solution.writeHeader() solution.writePBXBuildFile() solution.writePBXFileReference() solution.writePBXFrameworksBuildPhase() solution.writePBXBuildGroup() solution.writePBXHeadersBuildPhase() s... | |
solution.version = xcodeprojects[toolName][1] | solution.version = xcodeprojects[toolName] | def create_xcode_project(t): toolName = t.features[0] if not solutions.has_key(toolName): appname = getattr(Utils.g_module, 'APPNAME', 'noname') outname = 'project.pbxproj' solution = GenerateProject(env=t.env) solution.set_outputs(t.path.find_or_declare(outname)) solution.name = appname solution.version = xcodeproject... |
f.write('template< %s > static inline be_create<T> create(%s) { return be_create<T>(new T(%s)); }\n' % (types, params, args)); | f.write('template< int ARENA, %s > static inline be_pointer_<T> create(%s)\n' % (types, params)) f.write('{\n') f.write(' void* mem = BugEngine::Memory<ARENA>::alloc(sizeof(T), be_alignof(T));\n') f.write(' return be_pointer_<T>(new(mem) T(%s), &BugEngine::Memory<ARENA>::free);\n' % args) f.write('}\n'); | def template(f, n, const, types = '', params = '', args = ''): if n > 0: if const: if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: temp... |
f.write('static inline be_create<T> create() { return be_create<T>(new T()); }\n'); | f.write('template< int ARENA > static inline be_pointer_<T> create()\n') f.write('{\n') f.write(' void* mem = BugEngine::Memory<ARENA>::alloc(sizeof(T), be_alignof(T));\n') f.write(' return be_pointer_<T>(new(mem) T, &BugEngine::Memory<ARENA>::free);\n') f.write('}\n'); | def template(f, n, const, types = '', params = '', args = ''): if n > 0: if const: if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: temp... |
conf.env['CCFLAGS_debug'] = ['-save-temps', '-g', '-D_DEBUG'] conf.env['CXXFLAGS_debug'] = ['-save-temps', '-g', '-D_DEBUG', '-Wno-invalid-offsetof'] conf.env['LINKFLAGS_debug'] = ['-g', '-Wl,-x', '-Wl,-O2'] conf.env['ASFLAGS_debug'] = ['-g', '-D_DEBUG'] | conf.env['CCFLAGS_debug'] = ['-pipe', '-g', '-D_DEBUG'] conf.env['CXXFLAGS_debug'] = ['-pipe', '-g', '-D_DEBUG', '-Wno-invalid-offsetof'] conf.env['LINKFLAGS_debug'] = ['-pipe', '-g', '-Wl,-x', '-Wl,-O2'] conf.env['ASFLAGS_debug'] = ['-pipe', '-g', '-D_DEBUG'] | def find_cross_gcc(conf): try: target = Options.options.target except: target = None if not target: target = conf.env['GCC_TARGET'] version = conf.env['GCC_VERSION'] versionsmall = '.'.join(version.split('.')[0:2]) if target: v = conf.env v['GCC_CONFIGURED_PLATFORM'],v['GCC_CONFIGURED_ARCH'] = parse_gcc_target(target) ... |
return self.gobaloptioncache[platform+"-"+arch] | options.merge(self.gobaloptioncache[platform+"-"+arch]) | def getglobaloptions(self, platform, arch): try: return self.gobaloptioncache[platform+"-"+arch] except KeyError: options = coptions() if not platform in self.platforms or not arch in self.archs: return options options.merge(self.globaloptions) for d in self.depends: options.merge(d.getglobaloptions(platform, arch)) fo... |
options = coptions() | def getglobaloptions(self, platform, arch): try: return self.gobaloptioncache[platform+"-"+arch] except KeyError: options = coptions() if not platform in self.platforms or not arch in self.archs: return options options.merge(self.globaloptions) for d in self.depends: options.merge(d.getglobaloptions(platform, arch)) fo... | |
raise Exception("source file and target file are the same: " % sourcefile) | raise Exception("source file and target file are the same: %s" % sourcefile) | def p_error(errtoken): global error error += 1 if errtoken: if hasattr(errtoken,"lineno"): lineno = errtoken.lineno else: lineno = 0 if lineno: sys.stderr.write("yacc: Syntax error at line %d, token=%s\n" % (lineno, errtoken.type)) else: sys.stderr.write("yacc: Syntax error, token=%s" % errtoken.type) else: sys.stderr.... |
w("\t%s = {\n\t\tisa = PBXFileReference;\n\t\tfileEncoding = 4;\n\t\tlastKnownFileType = sourcecode.c.cpp;\n\t\tname = \"%s\";\n\t\tpath = \"%s\";\n\t\tsourceTree = \"SOURCE_ROOT\";\n\t};\n" % (d.masterid, os.path.split(d.masterfilename)[1], d.masterfilename)) | w("\t%s = {\n\t\tisa = PBXFileReference;\n\t\tfileEncoding = 4;\n\t\tlastKnownFileType = sourcecode.cpp.objcpp;\n\t\tname = \"%s\";\n\t\tpath = \"%s\";\n\t\tsourceTree = \"SOURCE_ROOT\";\n\t};\n" % (d.masterid, os.path.split(d.masterfilename)[1], d.masterfilename)) | def writePBXFileReference(self): w = self.file.write w("/* Begin PBXFileReference section */\n") for name, setting, buildfile, fileref in self.buildSettingsId[1]: w("\t%s = {\n\t\tisa = PBXFileReference;\n\t\tfileEncoding = 4;\n\t\tlastKnownFileType = text.xcconfig;\n\t\tname = \"%s\";\n\t\tpath = \"%s\";\n\t\tsourceTr... |
'xcode2': ('Xcode 2.5', 42), 'xcode3': ('Xcode 3.1', 45), | 'xcode': ('Xcode 3.1', 45), | def __init__(self): pass |
filename = "master-%s.cpp" % t.name | filename = "master-%s.mm" % t.name | def create_xcode_project(t): toolName = t.features[0] appname = getattr(Utils.g_module, 'APPNAME', 'noname') if not solutions.has_key(toolName): outname = 'project.pbxproj' solution = GenerateProject(env=t.env) solution.set_outputs(t.path.find_or_declare(outname)) solution.name = appname solution.version = xcodeproject... |
self.output.write(tabs+' CommandLine="set PATH="$(SolutionDir)../../bin";%%PATH%% && (if not exist "%s" mkdir "%s") && bison.exe -o"%s" -d --no-lines "%s""\n' % (os.path.split('$(IntDir)'+source.generatedcpp)[0], os.path.split('$(IntDir)'+source.generat... | self.output.write(tabs+' CommandLine="set PATH="$(SolutionDir)mak/win32/bin";%%PATH%% && (if not exist "%s" mkdir "%s") && bison.exe -o"%s" -d --no-lines "$(ProjectDir)%s""\n' % (os.path.split('$(IntDir)'+source.generatedcpp)[0], os.path.split('$(IntDir... | def addBisonFile(self, path, filename, source, tabs): self.output.write(tabs+'<File RelativePath="%s">\n' % filename) for platform in self.platforms: for config in self.configs: self.output.write(tabs+' <FileConfiguration\n') if VCproj.vcplatforms[platform] not in source.platforms or not source.process: self.output.wri... |
self.output.write(tabs+' CommandLine="set PATH="$(SolutionDir)../../bin";%%PATH%% && (if not exist "%s" mkdir "%s") && flex.exe -o"%s" "%s""\n' % (os.path.split('$(IntDir)'+source.generatedcpp)[0], os.path.split('$(IntDir)'+source.generatedcpp)[0], '$(I... | self.output.write(tabs+' CommandLine="set PATH="$(SolutionDir)mak/win32/bin";%%PATH%% && (if not exist "%s" mkdir "%s") && flex.exe -o"%s" "$(ProjectDir)%s""\n' % (os.path.split('$(IntDir)'+source.generatedcpp)[0], os.path.split('$(IntDir)'+source.gener... | def addFlexFile(self, path, filename, source, tabs): self.output.write(tabs+'<File RelativePath="%s">\n' % filename) for platform in self.platforms: for config in self.configs: self.output.write(tabs+' <FileConfiguration\n') if VCproj.vcplatforms[platform] not in source.platforms or not source.process: self.output.writ... |
def p_extern(t): """ extern : EXTERN STRING LBRACE decls RBRACE | def p_unused(t): """ decl : EXTERN STRING LBRACE decls RBRACE | def p_extern(t): """ extern : EXTERN STRING LBRACE decls RBRACE """ pass |
ext = (Options.platform == 'win32') and '.exe,.com,.bat,.cmd' or '' | ext = (Options.platform == 'win32') and '.exe,.com,.bat,.cmd,' or '' | def find_program_impl(env, filename, path_list=[], var=None, environ=None): """find a program in folders path_lst, and sets env[var] @param env: environment @param filename: name of the program to search for @param path_list: list of directories to search for filename @param var: environment value to be checked for in ... |
if v['GCC_CONFIGURED_PLATFORM'] == 'linux': conf.env.append_unique('CCFLAGS', ['-fPIC']) conf.env.append_unique('CXXFLAGS', ['-fPIC']) conf.env.append_unique('LINKFLAGS', ['-rdynamic']) | def find_cross_gcc(conf): try: target = Options.options.target except: target = None if not target: target = conf.env['GCC_TARGET'] version = conf.env['GCC_VERSION'] versionsmall = '.'.join(version.split('.')[0:2]) if target: v = conf.env v['GCC_CONFIGURED_ARCH'] = parse_gcc_target(target) if not v['CC']: v['CC'] = con... | |
decl : USING NAMESPACE ID SEMI """ pass precedence = ( ("left", "LT", "GT"), ("left", "SCOPE"), ) | decl : USING name SEMI decl : USING NAMESPACE name SEMI """ pass | def p_using(t): """ decl : USING NAMESPACE ID SEMI """ pass |
""" pass | param : function_pointer_with_name param_value_opt param : ELLIPSIS """ pass def p_template_param(t): """ template_param : type param_name_opt array_opt template_param_value_opt template_param : template class param_name_opt array_opt template_param_value_opt template_param : function_pointer_with_name template_param_... | def p_param(t): """ param : type param_name_opt array_opt param_value_opt """ pass |
def p_template_params_list(t): """ template_params_list : template_params_list : cs_template_params_list """ pass | def p_params_list(t): """ params_list : params_list : cs_params_list """ pass | |
""" pass | decl : TYPEDEF function_pointer_with_name """ pass | def p_typedef(t): """ decl : TYPEDEF type ID """ pass |
""" pass | modifier_left : modifier_left FRIEND """ pass | def p_modifier_left(t): """ modifier_left : modifier_left : modifier_left STATIC modifier_left : modifier_left INLINE modifier_left : modifier_left VIRTUAL modifier_left : modifier_left OVERRIDE """ pass |
decl : type name array_opt SEMI decl : FRIEND CLASS name SEMI decl : FRIEND STRUCT name SEMI | decl : type name array_opt param_value_opt SEMI | def p_decl(t): """ decl : SEMI decl : type array_opt SEMI decl : type name array_opt SEMI decl : FRIEND CLASS name SEMI decl : FRIEND STRUCT name SEMI """ pass |
template : TEMPLATE LT params_list GT | template : TEMPLATE LT template_params_list GT | def p_template(t): """ template : TEMPLATE LT params_list GT """ pass |
pass | t[0] = t[1] if len(t) > 2: t[0] += t[2] | def p_name(t): """ name : namelist name : SCOPE namelist """ pass |
name_item : typename_opt template_opt ID template_params_opt """ pass def p_name_operator(t): """ name_operator : OPERATOR operator array_opt name_operator : OPERATOR LT array_opt name_operator : OPERATOR GT array_opt name_operator : OPERATOR type name_operator : OPERATOR LPAREN RPAREN name_operator : OPERATOR LBRACKE... | name_item : typename_opt template_keyword_opt ID template_params_opt """ t[0] = t[3] | def p_name_item(t): """ name_item : typename_opt template_opt ID template_params_opt """ pass |
namelist : name_operator namelist : namelist_items namelist : namelist_items SCOPE name_operator """ pass | namelist : name_item namelist : namelist SCOPE name_item """ t[0] = t[1] if len(t) > 2: t[0] += t[2] + t[3] | def p_namelist(t): """ namelist : name_operator namelist : namelist_items namelist : namelist_items SCOPE name_operator """ pass |
method : type name template_params_opt LPAREN params_list RPAREN method_modifier_right method : name template_params_opt LPAREN params_list RPAREN method_modifier_right | method : type name LPAREN params_list RPAREN method_modifier_right method : name LPAREN params_list RPAREN method_modifier_right """ pass def p_operator_function_namespace(t): """ namespace_opt : namespace_opt : name SCOPE """ pass def p_operator_function(t): """ method : type namespace_opt OPERATOR operator LPAREN p... | def p_method(t): """ method : type name template_params_opt LPAREN params_list RPAREN method_modifier_right method : name template_params_opt LPAREN params_list RPAREN method_modifier_right """ pass |
initializer : ID LPAREN skiplist_all RPAREN | initializer : name LPAREN skiplist_all RPAREN | def p_initializer(t): """ initializer : ID LPAREN skiplist_all RPAREN """ pass |
skiplist : skiplist LT skiplist_comma GT """ pass | skiplist : skiplist LT skiplist_comma GT skiplist """ pass precedence = ( ('right', 'LT', 'GT'), ) | def p_skiplist(t): """ skiplist : skiplist_base skiplist : skiplist LT skiplist_comma GT """ pass |
if len(a) == 3 and a.startswith('/F') or a == '/doc' or a[-1] == ':': | if len(a) == 3 and a.startswith('/F') and a[2] >= 'a' and a[2] <= 'z' or a == '/doc' or a[-1] == ':': | def exec_command_msvc(self, *k, **kw): "instead of quoting all the paths and keep using the shell, we can just join the options msvc is interested in" if self.env['CC_NAME'] == 'msvc': if isinstance(k[0], list): lst = [] carry = '' for a in k[0]: if len(a) == 3 and a.startswith('/F') or a == '/doc' or a[-1] == ':': car... |
param : class param_name_opt array_opt param_value_opt param : TYPENAME param_name_opt array_opt param_value_opt | def p_param(t): """ param : type param_name_opt array_opt param_value_opt param : class param_name_opt array_opt param_value_opt param : TYPENAME param_name_opt array_opt param_value_opt """ pass | |
template_opt : template | template_opt : template_opt template | def p_template_opt(t): """ template_opt : template_opt : template """ pass |
namelist : typename_opt template_opt ID template_params_opt namelist : namelist SCOPE typename_opt template_opt ID template_params_opt | namelist : name_operator namelist : namelist_items namelist : namelist_items SCOPE name_operator | def p_namelist(t): """ namelist : typename_opt template_opt ID template_params_opt namelist : namelist SCOPE typename_opt template_opt ID template_params_opt """ pass |
method : type name LPAREN params_list RPAREN method_modifier_right method : name LPAREN params_list RPAREN method_modifier_right """ pass def p_method_name_opt(t): """ operator_name_opt : operator_name_opt : name SCOPE """ pass def p_method_operator(t): """ method : type operator_name_opt OPERATOR operator LPAREN par... | method : type name template_params_opt LPAREN params_list RPAREN method_modifier_right method : name template_params_opt LPAREN params_list RPAREN method_modifier_right | def p_method(t): """ method : type name LPAREN params_list RPAREN method_modifier_right method : name LPAREN params_list RPAREN method_modifier_right """ pass |
skiplist : skiplist : skiplist LBRACE skiplist_all RBRACE skiplist : skiplist LBRACKET skiplist_all RBRACKET skiplist : skiplist LPAREN skiplist_all RPAREN | skiplist : skiplist_base | def p_skiplist(t): """ skiplist : skiplist : skiplist LBRACE skiplist_all RBRACE skiplist : skiplist LBRACKET skiplist_all RBRACKET skiplist : skiplist LPAREN skiplist_all RPAREN skiplist : skiplist LT skiplist_comma GT skiplist : skiplist operator skiplist : skiplist keyword skiplist : skiplist constant skiplist : ski... |
skiplist : skiplist operator skiplist : skiplist keyword skiplist : skiplist constant skiplist : skiplist ID skiplist : skiplist SCOPE skiplist : skiplist SEMI | def p_skiplist(t): """ skiplist : skiplist : skiplist LBRACE skiplist_all RBRACE skiplist : skiplist LBRACKET skiplist_all RBRACKET skiplist : skiplist LPAREN skiplist_all RPAREN skiplist : skiplist LT skiplist_comma GT skiplist : skiplist operator skiplist : skiplist keyword skiplist : skiplist constant skiplist : ski... | |
skiplist_gt : skiplist skiplist_gt : skiplist_gt LT skiplist skiplist_gt : skiplist_gt GT skiplist | skiplist_gt : skiplist_base skiplist_gt : skiplist_gt LT skiplist_base skiplist_gt : skiplist_gt GT skiplist_base | def p_skiplist_with_gt(t): """ skiplist_gt : skiplist skiplist_gt : skiplist_gt LT skiplist skiplist_gt : skiplist_gt GT skiplist """ pass |
skiplist_all : skiplist skiplist_all : skiplist_all COMMA skiplist skiplist_all : skiplist_all LT skiplist skiplist_all : skiplist_all GT skiplist | skiplist_all : skiplist_base skiplist_all : skiplist_all COMMA skiplist_base skiplist_all : skiplist_all LT skiplist_base skiplist_all : skiplist_all GT skiplist_base | def p_skiplist_all(t): """ skiplist_all : skiplist skiplist_all : skiplist_all COMMA skiplist skiplist_all : skiplist_all LT skiplist skiplist_all : skiplist_all GT skiplist """ pass |
file.write(" static const ::BugEngine::RTTI::ClassInfo s_%sClass = { { s_%sName }, { ::BugEngine::be_typeid< void >::klass }, { 0 }, sizeof(%s), 0, { 0 } };\n" % (decl, decl, self.fullname)) | file.write(" static const ::BugEngine::RTTI::ClassInfo s_%sClass = { { s_%sName }, { ::BugEngine::be_typeid< void >::klass }, { 0 }, { 0 }, { 0 }, sizeof(%s), 0, { 0 } };\n" % (decl, decl, self.fullname)) file.write(" static const ::BugEngine::RTTI::ClassInfoRegistration s_%sClassRegistration (&s_%sClass);\n" % (... | def dump(self, file, namespace, index): file.write("") decl = "class%d" % index self.classes.append((self.fullname, namespace + '::s_' + decl + "Class")) file.write("#line %d\n" % (self.line)) file.write(" static const char * const s_%sName = \"%s\";\n" % (decl, self.fullname)) file.write("#line %d\n" % (self.line))... |
if len(t) > 1: print t[1], t[3] | def p_template_params_opt(t): """ template_params_opt : template_params_opt : LT skiplist_comma GT """ if len(t) > 1: print t[1], t[3] pass | |
print t[3] | def p_name_item(t): """ name_item : typename_opt template_opt ID template_params_opt """ print t[3] pass | |
print t[1] | def p_visibility(t): """ visibility : PUBLIC visibility : PROTECTED visibility : PRIVATE """ print t[1] pass | |
if len(t) > 3: print t[2] | def p_skiplist_base(t): """ skiplist_base : skiplist_base : skiplist_base LBRACE skiplist_all RBRACE skiplist_base : skiplist_base LBRACKET skiplist_all RBRACKET skiplist_base : skiplist_base LPAREN skiplist_all RPAREN skiplist_base : skiplist_base operator skiplist_base : skiplist_base keyword skiplist_base : skiplist... | |
self.configurationsID = newid() self.buildSettingsId = (newid(), [newid()]) | self.buildSettingsId = (newid(), [('debug', newid()), ('profile', newid()), ('final', newid())]) | def __init__(self, name, path, version, projects): self.file = open(path, 'w') self.version = version self.projects = projects self.projectID = newid() self.configurationsID = newid() self.buildSettingsId = (newid(), [newid()]) self.mainGroup = newid() |
w("\t\tbuildConfigurationList = %s;\n" % self.buildSettingsId[0]) | w("\t\tbuildConfigurationList = %s;\n" % d.buildSettingsId[0]) | def writePBXNativeTarget(self): w = self.file.write w("/* Begin PBXNativeTarget section */\n") for d in self.projects: if d.type in ['game', 'tool']: w("\t%s = {\n" % d.targetId) w("\t\tisa = PBXNativeTarget;\n") w("\t\tbuildConfigurationList = %s;\n" % self.buildSettingsId[0]) w("\t\tbuildPhases = (\n") w("\t\t\t%s,\n... |
w("\t\tbuildConfigurationList = %s;\n" % self.configurationsID) | w("\t\tbuildConfigurationList = %s;\n" % self.buildSettingsId[0]) | def writePBXProject(self): w = self.file.write w("/* Begin PBXProject section */\n") w("\t%s /* Project object */ = {\n" % self.projectID) w("\t\tisa = PBXProject;\n") w("\t\tcompatibilityVersion = \"%s\";\n" % self.version[0]) w("\t\tbuildConfigurationList = %s;\n" % self.configurationsID) w("\t\thasScannedForEncoding... |
def writeXCBuildConfiguration(self, project): | def writeXCBuildConfiguration(self): | def writeXCBuildConfiguration(self, project): w = self.file.write w("/* Begin XCBuildConfiguration section */\n") w("\t%s = {\n" % self.buildSettingsId[1][0]) w("\t\tisa = XCBuildConfiguration;\n") w("\t\tbuildSettings = {\n") w("\t\t};\n") w("\t\tname = Default;\n") w("\t};\n") w("/* End XCBuildConfiguration section *... |
w("\t%s = {\n" % self.buildSettingsId[1][0]) w("\t\tisa = XCBuildConfiguration;\n") w("\t\tbuildSettings = {\n") w("\t\t};\n") w("\t\tname = Default;\n") w("\t};\n") | for name, setting in self.buildSettingsId[1]: w("\t%s = {\n" % setting) w("\t\tisa = XCBuildConfiguration;\n") w("\t\tbuildSettings = {\n") w("\t\t};\n") w("\t\tname = %s;\n" % name) w("\t};\n") for d in self.projects: if d.type in ['game', 'tool']: for name, setting in d.buildSettingsId[1]: w("\t%s = {\n" % setting) w... | def writeXCBuildConfiguration(self, project): w = self.file.write w("/* Begin XCBuildConfiguration section */\n") w("\t%s = {\n" % self.buildSettingsId[1][0]) w("\t\tisa = XCBuildConfiguration;\n") w("\t\tbuildSettings = {\n") w("\t\t};\n") w("\t\tname = Default;\n") w("\t};\n") w("/* End XCBuildConfiguration section *... |
w("\t\t\t%s,\n" % self.buildSettingsId[1][0]) | for name, setting in self.buildSettingsId[1]: w("\t\t\t%s,\n" % setting) | def writeXCConfigurationList(self): w = self.file.write w("/* Begin XCConfigurationList section */\n") w("\t%s = {\n" % self.buildSettingsId[0]) w("\t\tisa = XCConfigurationList;\n") w("\t\tbuildConfigurations = (\n") w("\t\t\t%s,\n" % self.buildSettingsId[1][0]) w("\t\t);\n") w("\t\tdefaultConfigurationIsVisible = 0;\... |
w("\t\tdefaultConfigurationName = Default;\n") | w("\t\tdefaultConfigurationName = %s;\n" % self.buildSettingsId[1][0][0]) | def writeXCConfigurationList(self): w = self.file.write w("/* Begin XCConfigurationList section */\n") w("\t%s = {\n" % self.buildSettingsId[0]) w("\t\tisa = XCConfigurationList;\n") w("\t\tbuildConfigurations = (\n") w("\t\t\t%s,\n" % self.buildSettingsId[1][0]) w("\t\t);\n") w("\t\tdefaultConfigurationIsVisible = 0;\... |
self.writeXCBuildConfiguration() | def writeXCConfigurationList(self): w = self.file.write w("/* Begin XCConfigurationList section */\n") w("\t%s = {\n" % self.buildSettingsId[0]) w("\t\tisa = XCConfigurationList;\n") w("\t\tbuildConfigurations = (\n") w("\t\t\t%s,\n" % self.buildSettingsId[1][0]) w("\t\t);\n") w("\t\tdefaultConfigurationIsVisible = 0;\... | |
allconfigs = ['debug','profile','final'] | def __init__(self): pass | |
self.output.write(' <ProjectReference Include="%s">\n' % os.path.split(d.outname)[1]) self.output.write(' <Project>%s</Project>\n' % solution.generateGUID(d.outname, d.name)) self.output.write(' <Private>true</Private>\n') self.output.write(' <ReferenceOutputAssembly>true</ReferenceOutputAssembly>\n')... | if 'win32-x86' in d.platforms or 'win32-amd64' in d.platforms: self.output.write(' <ProjectReference Include="%s">\n' % os.path.split(d.outname)[1]) self.output.write(' <Project>%s</Project>\n' % solution.generateGUID(d.outname, d.name)) self.output.write(' <Private>true</Private>\n') self.output.write(' ... | def addDirectory(self, sources): self.output.write(' <ItemGroup>\n') self.filters.write(' <ItemGroup>\n') for name,subdir in sources.directories.iteritems(): self.addFilter(name, subdir) self.output.write(' </ItemGroup>\n') self.filters.write(' </ItemGroup>\n') |
self.buildSettingsId = (newid(), [('debug', newid()), ('profile', newid()), ('final', newid())]) | self.buildSettingsId = (newid(), [('iphone-debug', newid(), newid(), newid()), ('iphone-profile', newid(), newid(), newid()), ('iphone-final', newid(), newid(), newid()), ('osx-debug', newid(), newid(), newid()), ('osx-profile', newid(), newid(), newid()), ('osx-final', newid(), newid(), newid())]) | def __init__(self, name, path, version, projects): self.file = open(path, 'w') self.version = version self.projects = projects self.projectID = newid() self.buildSettingsId = (newid(), [('debug', newid()), ('profile', newid()), ('final', newid())]) self.mainGroup = newid() |
d.buildSettingsId = (newid(), [('debug', newid()), ('profile', newid()), ('final', newid())]) | d.buildSettingsId = (newid(), [('iphone-debug', newid()), ('iphone-profile', newid()), ('iphone-final', newid()), ('osx-debug', newid()), ('osx-profile', newid()), ('osx-final', newid())]) | def writePBXFileReference(self): w = self.file.write w("/* Begin PBXFileReference section */\n") for d in self.projects: if d.usemaster: w("\t%s = { isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.cpp; name = \"%s\"; path = \"%s\" ; sourceTree = \"SOURCE_ROOT\"; };\n" % (d.masterid, os.path.s... |
for name, setting in self.buildSettingsId[1]: | for name, setting, buildfile, fileref in self.buildSettingsId[1]: | def writeXCBuildConfiguration(self): w = self.file.write w("/* Begin XCBuildConfiguration section */\n") for name, setting in self.buildSettingsId[1]: w("\t%s = {\n" % setting) w("\t\tisa = XCBuildConfiguration;\n") w("\t\tbuildSettings = {\n") w("\t\t};\n") w("\t\tname = %s;\n" % name) w("\t};\n") for d in self.projec... |
for name, setting in self.buildSettingsId[1]: | for name, setting, buildfile, fileref in self.buildSettingsId[1]: | def writeXCConfigurationList(self): self.writeXCBuildConfiguration() w = self.file.write w("/* Begin XCConfigurationList section */\n") w("\t%s = {\n" % self.buildSettingsId[0]) w("\t\tisa = XCConfigurationList;\n") w("\t\tbuildConfigurations = (\n") for name, setting in self.buildSettingsId[1]: w("\t\t\t%s,\n" % setti... |
kw = t.value[1:].lstrip() if kw.startswith("if") or kw.startswith("el") or kw.startswith("endif"): implementation.write(t.value) implementation.write("\n") | def t_preprocessor(t): r'\#([^\\\n]|(\\.)|(\\\n))*' kw = t.value[1:].lstrip() if kw.startswith("if") or kw.startswith("el") or kw.startswith("endif"): implementation.write(t.value) implementation.write("\n") t.lexer.lineno += t.value.count('\n') pass | |
decls : decls decl | decls : decls template_opt modifier_left decl | def p_decls(t): """ decls : decls : decls decl """ pass |
precedence = ( ("left", "LT", "GT"), ("left", "SCOPE"), ) | def p_using(t): """ decl : USING NAMESPACE ID SEMI """ pass |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.