bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def action(self, discriminator, callable=None, args=(), kw=None, order=0): """ Register an action which will be executed when :meth:`pyramid.config.Configuration.commit` is called (or executed immediately if ``autocommit`` is ``True``). | def action(self, discriminator, callable=None, args=(), kw=None, order=0): """ Register an action which will be executed when :meth:`pyramid.config.Configuration.commit` is called (or executed immediately if ``autocommit`` is ``True``). | 476,900 |
def commit(self): """ Commit any pending configuration actions added. If a configuration conflict has occurred, this method will raise a :exc:`ConfigurationConflictError`; within the traceback of this error will be information about the source of the conflict, usually including file names and line numbers of the cause ... | def commit(self): """ Commit any pending configuration actions. If a configuration conflict is detected in the pending configuration actins, this method will raise a :exc:`ConfigurationConflictError`; within the traceback of this error will be information about the source of the conflict, usually including file names a... | 476,901 |
def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | 476,902 |
def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | 476,903 |
def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | 476,904 |
def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure') | 476,905 |
def test_spec_notyetregistered(self): import os from pyramid import tests module_name = tests.__name__ relpath = 'test_renderers.py' renderer = {} factory = DummyFactory(renderer) spec = '%s:%s' % (module_name, relpath) info = DummyRendererInfo({ 'name':spec, 'package':None, 'registry':self.config.registry, 'settings':... | def test_spec_notyetregistered(self): import os from pyramid import tests module_name = tests.__name__ relpath = 'test_renderers.py' renderer = {} factory = DummyFactory(renderer) spec = '%s:%s' % (module_name, relpath) info = DummyRendererInfo({ 'name':spec, 'package':None, 'registry':self.config.registry, 'settings':... | 476,906 |
def get_app(config_file, name, loadapp=loadapp): """ Return the WSGI application named ``name`` in the PasteDeploy config file ``config_file``""" config_name = 'config:%s' % config_file here_dir = os.getcwd() app = loadapp(config_name, name=name, relative_to=here_dir) return app | def get_app(config_file, name, loadapp=loadapp): """ Return the WSGI application named ``name`` in the PasteDeploy config file ``config_file``""" config_name = 'config:%s' % config_file here_dir = os.getcwd() app = loadapp(config_name, name=name, relative_to=here_dir) return app | 476,907 |
def route_path(route_name, request, *elements, **kw): """Generates a path (aka a 'relative URL', a URL minus the host, scheme, and port) for a named :app:`Pyramid` :term:`route configuration`. .. note:: Calling :meth:`pyramid.Request.route_path` can be used to achieve the same result as :func:`pyramid.url.route_path`.... | def route_path(route_name, request, *elements, **kw): """Generates a path (aka a 'relative URL', a URL minus the host, scheme, and port) for a named :app:`Pyramid` :term:`route configuration`. .. note:: Calling :meth:`pyramid.Request.route_path` can be used to achieve the same result as :func:`pyramid.url.route_path`.... | 476,908 |
def register(): config = Configurator(reg, package=_context.package) config.add_view( permission=permission, context=context, view=view, name=name, request_type=request_type, route_name=route_name, request_method=request_method, request_param=request_param, containment=containment, attr=attr, renderer=renderer, wrapper... | def register(): config = Configurator(reg, package=_context.package) config.add_view( permission=permission, context=context, view=view, name=name, request_type=request_type, route_name=route_name, request_method=request_method, request_param=request_param, containment=containment, attr=attr, renderer=renderer, wrapper... | 476,909 |
def test_setup_registry_locale_negotiator(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import ILocaleNegotiator reg = Registry() config = self._makeOne(reg) config.setup_registry(locale_negotiator='abc') utility = reg.getUtility(ILocaleNegotiator) self.assertEqual(utility, 'abc') | def test_setup_registry_locale_negotiator(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import ILocaleNegotiator reg = Registry() config = self._makeOne(reg) negotiator = object() config.setup_registry(locale_negotiator=negotiator) utility = reg.getUtility(ILocaleNegotiator) self.assertEqua... | 476,910 |
def test_setup_registry_locale_negotiator(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import ILocaleNegotiator reg = Registry() config = self._makeOne(reg) config.setup_registry(locale_negotiator='abc') utility = reg.getUtility(ILocaleNegotiator) self.assertEqual(utility, 'abc') | def test_setup_registry_locale_negotiator(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import ILocaleNegotiator reg = Registry() config = self._makeOne(reg) config.setup_registry(locale_negotiator='abc') utility = reg.getUtility(ILocaleNegotiator) self.assertEqual(utility, 'abc') | 476,911 |
def test_setup_registry_request_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRequestFactory reg = Registry() config = self._makeOne(reg) config.setup_registry(request_factory='abc') utility = reg.getUtility(IRequestFactory) self.assertEqual(utility, 'abc') | def test_setup_registry_request_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRequestFactory reg = Registry() config = self._makeOne(reg) factory = object() config.setup_registry(request_factory=factory) utility = reg.getUtility(IRequestFactory) self.assertEqual(utility, 'ab... | 476,912 |
def test_setup_registry_request_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRequestFactory reg = Registry() config = self._makeOne(reg) config.setup_registry(request_factory='abc') utility = reg.getUtility(IRequestFactory) self.assertEqual(utility, 'abc') | def test_setup_registry_request_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRequestFactory reg = Registry() config = self._makeOne(reg) config.setup_registry(request_factory='abc') utility = reg.getUtility(IRequestFactory) self.assertEqual(utility, 'abc') | 476,913 |
def test_setup_registry_renderer_globals_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRendererGlobalsFactory reg = Registry() config = self._makeOne(reg) config.setup_registry(renderer_globals_factory='abc') utility = reg.getUtility(IRendererGlobalsFactory) self.assertEqual... | def test_setup_registry_renderer_globals_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRendererGlobalsFactory reg = Registry() config = self._makeOne(reg) factory = object() config.setup_registry(renderer_globals_factory=factory) utility = reg.getUtility(IRendererGlobalsFact... | 476,914 |
def test_setup_registry_renderer_globals_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRendererGlobalsFactory reg = Registry() config = self._makeOne(reg) config.setup_registry(renderer_globals_factory='abc') utility = reg.getUtility(IRendererGlobalsFactory) self.assertEqual... | def test_setup_registry_renderer_globals_factory(self): from repoze.bfg.registry import Registry from repoze.bfg.interfaces import IRendererGlobalsFactory reg = Registry() config = self._makeOne(reg) config.setup_registry(renderer_globals_factory='abc') utility = reg.getUtility(IRendererGlobalsFactory) self.assertEqual... | 476,915 |
def test_set_request_factory(self): from repoze.bfg.interfaces import IRequestFactory config = self._makeOne() config.set_request_factory('abc') self.assertEqual(config.registry.getUtility(IRequestFactory), 'abc') | def test_set_request_factory(self): from repoze.bfg.interfaces import IRequestFactory config = self._makeOne() config.set_request_factory('abc') self.assertEqual(config.registry.getUtility(IRequestFactory), 'abc') | 476,916 |
def forget(self, request): return [] | def forget(self, request): return [] | 476,917 |
def renderer_factory(info): path = info.name registry = info.registry settings = info.settings lookup = registry.queryUtility(IMakoLookup) if lookup is None: reload_templates = settings.get('reload_templates', False) directories = settings.get('mako.directories') module_directory = settings.get('mako.module_directory')... | def renderer_factory(info): path = info.name registry = info.registry settings = info.settings lookup = registry.queryUtility(IMakoLookup) if lookup is None: reload_templates = settings.get('reload_templates', False) directories = settings.get('mako.directories') module_directory = settings.get('mako.module_directory')... | 476,918 |
def template_renderer_factory(spec, impl): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: renderer = impl(spec) reg.regi... | registry_lock = threading.Lock() def template_renderer_factory(spec, impl, lock=registry_lock): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=... | 476,919 |
def template_renderer_factory(spec, impl): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: renderer = impl(spec) reg.regi... | def template_renderer_factory(spec, impl): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: renderer = impl(spec) try: lo... | 476,920 |
def template_renderer_factory(spec, impl): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: renderer = impl(spec) reg.regi... | def template_renderer_factory(spec, impl): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: renderer = impl(spec) try: loc... | 476,921 |
def __call__(self, request): environ = request.environ try: # empty if mounted under a path in mod_wsgi, for example path = environ['PATH_INFO'] or '/' except KeyError: path = '/' | def __call__(self, request): environ = request.environ try: # empty if mounted under a path in mod_wsgi, for example path = environ['PATH_INFO'] or '/' except KeyError: path = '/' | 476,922 |
def test_directories_list(self): from pyramid.mako_templating import IMakoLookup settings = {'mako.directories':['a', 'b']} info = DummyRendererInfo({ 'name':'helloworld.mak', 'package':None, 'registry':self.config.registry, 'settings':settings, }) self._callFUT(info) lookup = self.config.registry.getUtility(IMakoLooku... | def test_directories_list(self): from pyramid.mako_templating import IMakoLookup settings = {'mako.directories':['a', 'b']} info = DummyRendererInfo({ 'name':'helloworld.mak', 'package':None, 'registry':self.config.registry, 'settings':settings, }) self._callFUT(info) lookup = self.config.registry.getUtility(IMakoLooku... | 476,923 |
def caller_package(level=2, caller_module=caller_module): # caller_module in arglist for tests module = caller_module(level+1) if '__init__.py' in getattr(module, '__file__', ''): # empty at >>> # Module is a package return module # Go up one level to get package package_name = module.__name__.rsplit('.', 1)[0] return ... | def caller_package(level=2, caller_module=caller_module): # caller_module in arglist for tests module = caller_module(level+1) f = getattr(module, '__file__', '') if (('__init__.py' in f) or ('__init__$py' in f)): # empty at >>> # Module is a package return module # Go up one level to get package package_name = module.... | 476,924 |
def pre(self, command, output_dir, vars): # pragma: no cover vars['random_string'] = os.urandom(20).encode('hex') return Template.pre(self, command, output_dir, vars) | def pre(self, command, output_dir, vars): # pragma: no cover vars['random_string'] = os.urandom(20).encode('hex') return Template.pre(self, command, output_dir, vars) | 476,925 |
def restore_point(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] return mysqldump_command ("-u%s %s%s --add-drop-table --default-character-set=utf8 %s" % (user, "-p" if password else "", password, db)) | def restore_point(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] host = config["db_host"] return mysqldump_command ("-u%s %s%s %s --add-drop-table --default-character-set=utf8 %s" % (user, "-p" if password else "", password, "-h"+host if host <> '... | 476,926 |
def dump(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] return mysqldump_command ("--no-data --compact -u%s %s%s --default-character-set=utf8 %s" % (user, "-p" if password else "", password, db)) | def dump(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] host = config["db_host"] return mysqldump_command ("--no-data --add-lock=false --compact -u%s %s%s %s --default-character-set=utf8 %s" % (user, "-p" if password else "", password, "-h"+host i... | 476,927 |
def load (sql): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] tempfile = ".temp-mygrate-%s" % str(datetime.time()).replace (':', '_') f = open (tempfile, 'w') f.write (sql) f.close() (output, errors) = mysql_command ("-u%s %s%s --default-character-set... | def load (sql): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] tempfile = ".temp-mygrate-%s" % str(datetime.time()).replace (':', '_') f = open (tempfile, 'w') f.write (sql) f.close() (output, errors) = mysql_command ("-u%s %s%s %s --default-character-... | 476,928 |
def _toText(self): if self.type == OPERAND_IMMEDIATE: if self.value >= 0: return "0x%x" % self.value else: return "-0x%x" % abs(self.value) elif self.type == OPERAND_REGISTER: return self.GetName() elif self.type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self.disp elif self.type == OPERAND_FAR_MEMORY: return '%s:%... | def _toText(self): if self.type == OPERAND_IMMEDIATE: if self.value >= 0: return "0x%x" % self.value else: return "-0x%x" % abs(self.value) elif self.type == OPERAND_REGISTER: return self.name elif self.type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self.disp elif self.type == OPERAND_FAR_MEMORY: return '%s:%s' % ... | 476,929 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,930 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,931 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,932 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,933 |
def init_INTEGER(self): Set = lambda *args: self.SetCallback(ISetClass.INTEGER, *args) | def init_INTEGER(self): Set = lambda *args: self.SetCallback(ISetClass.INTEGER, *args) | 476,934 |
def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | def _toText(self): if self.type == OPERAND_IMMEDIATE: if self.value >= 0: return "0x%x" % self.value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: return ... | 476,935 |
def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self.value) elif self.type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: return... | 476,936 |
def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self.type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self.disp elif self.type == OPERAND_FAR_MEMORY: return ... | 476,937 |
def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | 476,938 |
def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | def _toText(self): if self._type == OPERAND_IMMEDIATE: if self._value >= 0: return "0x%x" % self._value else: return "-0x%x" % abs(self._value) elif self._type == OPERAND_REGISTER: return self.GetName() elif self._type == OPERAND_ABSOLUTE_ADDRESS: return '[0x%x]' % self._disp elif self._type == OPERAND_FAR_MEMORY: retu... | 476,939 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,940 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,941 |
def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | def __init__(self, type, *args): self.type = type self.index = None self.name = "" self.size = 0 self.value = 0 self.disp = 0 self.dispSize = 0 self.base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] self._name... | 476,942 |
def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self.value = int(args[0]) self.size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] self... | 476,943 |
def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self.index = args[0] self.size = args[1] self... | 476,944 |
def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | 476,945 |
def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | 476,946 |
def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] se... | 476,947 |
def __init__(self, di): "Expects a filled _DInst structure" self.opcode = di.opcode self.operands = [] self.flags = [] self.instructionClass = _getISC(0) self.flowControl = _getFC(0) self.address = di.addr self.size = di.size flags = di.flags | def __init__(self, di, instructionBytes): "Expects a filled _DInst structure, and the corresponding byte code of the whole instruction" flags = di.flags self.instructionBytes = instructionBytes self.opcode = di.opcode self.operands = [] self.flags = [] self.instructionClass = _getISC(0) self.flowControl = _getFC(0) se... | 476,948 |
def __init__(self, di): "Expects a filled _DInst structure" self.opcode = di.opcode self.operands = [] self.flags = [] self.instructionClass = _getISC(0) self.flowControl = _getFC(0) self.address = di.addr self.size = di.size flags = di.flags | def __init__(self, di): "Expects a filled _DInst structure" self.opcode = di.opcode self.operands = [] self.flags = [] self.instructionClass = _getISC(0) self.flowControl = _getFC(0) self.address = di.addr self.size = di.size flags = di.flags | 476,949 |
def _toText(self): opcodeFmt = "%-10s %s" paramsText = ", ".join(["%s" % i for i in self.operands]) return opcodeFmt % (self.mnemonic, paramsText) | def _toText(self): opcodeFmt = "%-10s %s" paramsText = ", ".join(["%s" % i for i in self.operands]) return opcodeFmt % (self.mnemonic, paramsText) | 476,950 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | defyield Instruction(di, code[codeOffset + delta : codeOffset + delta + di.size]) DecomposeGenerator(codeOffset,yield Instruction(di, code[codeOffset + delta : codeOffset + delta + di.size]) code,yield Instruction(di, code[codeOffset + delta : codeOffset + delta + di.size]) dt):yield Instruction(di, code[codeOffset + d... | 476,951 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,952 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,953 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,954 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,955 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,956 |
def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | def DecodeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly ty... | 476,957 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,958 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,959 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,960 |
def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | def DecomposeGenerator(codeOffset, code, dt): """ @type codeOffset: long @param codeOffset: Memory address where the code is located. This is B{not} an offset into the code! It's the actual memory address where it was read from. @type code: str @param code: Code to disassemble. @type dt: int @param dt: Disassembly... | 476,961 |
def get_sources(): """Returns a list of C source files that should be compiled to create the libdistorm3 library. """ return glob('src/*.c') + glob('include/*.c') | def get_sources(): """Returns a list of C source files that should be compiled to create the libdistorm3 library. """ return glob('src/*.c') | 476,962 |
def nn(self, pts, qpts, num_neighbors = 1, **kwargs): """ Returns the num_neighbors nearest points in dataset for each point in testset. """ if not pts.dtype.type in allowed_types: raise FLANNException("Cannot handle type: %s"%pts.dtype) | def nn(self, pts, qpts, num_neighbors = 1, **kwargs): """ Returns the num_neighbors nearest points in dataset for each point in testset. """ if not pts.dtype.type in allowed_types: raise FLANNException("Cannot handle type: %s"%pts.dtype) | 476,963 |
def ensure_2d_array(array, flags, **kwargs): array = require(array, requirements = flags, **kwargs) if len(array.shape) == 1: array.shape = (-1,array.size) return array | def ensure_2d_array(array, flags, **kwargs): array = require(array, requirements = flags, **kwargs) if len(array.shape) == 1: array = array.reshape(-1,array.size) return array | 476,964 |
def load_flann_library(): root_dir = os.path.abspath(os.path.dirname(__file__)) libname = 'libflann' if sys.platform == 'win32': libname = 'flann' flann = None loaded = False while (not loaded) and root_dir!="/": try: flann = load_library(libname, os.path.join(root_dir,'lib')) loaded = True except: root_dir = os.pat... | def load_flann_library(): root_dir = os.path.abspath(os.path.dirname(__file__)) libname = 'libflann' if sys.platform == 'win32': libname = 'flann' flann = None loaded = False while (not loaded) and root_dir!="/": try: flann = load_library(libname, os.path.join(root_dir,'lib')) loaded = True except Exception as e: pr... | 476,965 |
def kmeans(self, pts, num_clusters, centers_init = "random", max_iterations = None, dtype = None, **kwargs): """ Runs kmeans on pts with num_clusters centroids. Returns a numpy array of size num_clusters x dim. | def kmeans(self, pts, num_clusters, max_iterations = None, dtype = None, **kwargs): """ Runs kmeans on pts with num_clusters centroids. Returns a numpy array of size num_clusters x dim. | 476,966 |
def import_to_global(modname, attrs=None, math=False): """ import_to_global(modname, (a,b,c,...), math): like "from modname import a,b,c,...", but imports to global namespace (__main__). If math==True, also registers functions with QtiPlot's math function list. """ import sys import os sys.path.append(os.path.dirname(_... | def import_to_global(modname, attrs=None, math=False): """ import_to_global(modname, (a,b,c,...), math): like "from modname import a,b,c,...", but imports to global namespace (__main__). If math==True, also registers functions with QtiPlot's math function list. """ import sys import os sys.path.append(os.path.dirname(_... | 476,967 |
def __init__(self, base_path=None, template_path=None, script_path=None, environ=None, cwd=None, start_clear=True, ignore_paths=None, ignore_hidden=True): """ Creates an environment. ``base_path`` is used as the current working directory, and generally where changes are looked for. If not given, it will be the directo... | def __init__(self, base_path=None, template_path=None, script_path=None, environ=None, cwd=None, start_clear=True, ignore_paths=None, ignore_hidden=True): """ Creates an environment. ``base_path`` is used as the current working directory, and generally where changes are looked for. If not given, it will be the directo... | 476,968 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,969 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,970 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,971 |
def __init__(self, base_path=None, template_path=None, environ=None, cwd=None, start_clear=True, ignore_paths=None, ignore_hidden=True, capture_temp=False, assert_no_temp=False): """ Creates an environment. ``base_path`` is used as the current working directory, and generally where changes are looked for. If not given... | def __init__(self, base_path=None, template_path=None, environ=None, cwd=None, start_clear=True, ignore_paths=None, ignore_hidden=True, capture_temp=False, assert_no_temp=False, split_cmd=True): """ Creates an environment. ``base_path`` is used as the current working directory, and generally where changes are looked f... | 476,972 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,973 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,974 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,975 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,976 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,977 |
def __init__(self, base_path=None, template_path=None, environ=None, cwd=None, start_clear=True, ignore_paths=None, ignore_hidden=True, capture_temp=False, assert_no_temp=False): """ Creates an environment. ``base_path`` is used as the current working directory, and generally where changes are looked for. If not given... | def __init__(self, base_path=None, template_path=None, environ=None, cwd=None, start_clear=True, ignore_paths=None, ignore_hidden=True, capture_temp=False, assert_no_temp=False, split_cmd=True): """ Creates an environment. ``base_path`` is used as the current working directory, and generally where changes are looked f... | 476,978 |
def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | def run(self, script, *args, **kw): """ Run the command, with the given arguments. The ``script`` argument can have space-separated arguments, or you can use the positional arguments. | 476,979 |
def main(): try: fetch_threads = [] parser = OptionParser(usage="Usage: %prog [options] url") parser.add_option("-s", "--max-speed", dest="max_speed", help="Specifies maximum speed (bytes per second)." " Useful if you don't want the program to suck up" " all of your bandwidth", metavar="SPEED") parser.add_option("-q", ... | def main(): try: fetch_threads = [] parser = OptionParser(usage="Usage: %prog [options] url") parser.add_option("-s", "--max-speed", dest="max_speed", help="Specifies maximum speed (bytes per second)." " Useful if you don't want the program to suck up" " all of your bandwidth", metavar="SPEED") parser.add_option("-q", ... | 476,980 |
def main(): try: fetch_threads = [] parser = OptionParser(usage="Usage: %prog [options] url") parser.add_option("-s", "--max-speed", dest="max_speed", help="Specifies maximum speed (bytes per second)." " Useful if you don't want the program to suck up" " all of your bandwidth", metavar="SPEED") parser.add_option("-q", ... | def main(): try: fetch_threads = [] parser = OptionParser(usage="Usage: %prog [options] url") parser.add_option("-s", "--max-speed", dest="max_speed", help="Specifies maximum speed (bytes per second)." " Useful if you don't want the program to suck up" " all of your bandwidth", metavar="SPEED") parser.add_option("-q", ... | 476,981 |
def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | 476,982 |
def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | 476,983 |
def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | 476,984 |
def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | 476,985 |
def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | 476,986 |
def download(url, options): fetch_threads = [] try: output_file = url.rsplit("/", 1)[1] # basename of the url if options.output_file != None: output_file = options.output_file if output_file == "": print "Invalid URL" sys.exit(1) print "Destination = ", output_file filesize = get_file_size(url) conn_state = Conn... | def download(url, options): fetch_threads = [] try: output_file = url.rsplit("/", 1)[1] # basename of the url if options.output_file != None: output_file = options.output_file if output_file == "": print "Invalid URL" sys.exit(1) print "Destination = ", output_file filesize = get_file_size(url) conn_state = Conn... | 476,987 |
def main(options, args): try: general_configuration() url = args[0] download(url, options) except KeyboardInterrupt, k: sys.exit(1) except Exception, e: # TODO: handle other types of errors too. print e pass | def main(options, args): try: general_configuration() url = args[0] download(url, options) except KeyboardInterrupt, k: sys.exit(1) except Exception, e: # TODO: handle other types of errors too. print e pass | 476,988 |
def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | def run(self): # Ready the url object # print "Running thread with %d-%d" % (self.start_offset, self.length) request = urllib2.Request(url, None, std_headers) request.add_header('Range','bytes=%d-%d' % (self.start_offset, self.start_offset+self.length)) data = urllib2.urlopen(request) | 476,989 |
def _build(self): return self.sys_log("HDF5_DIR=%s make -j%s" % (self.blddir, jobs(self.name))) | def _build(self): return self.sys_log("HDF5_DIR=%s make -j%s" % (self.blddir, jobs(self.name))) | 476,990 |
def find_cgal_vers(self, installed=False, in_build=False): v = '' f = self.find_cgal_inc(installed, in_build) if f: while True: line = f.readline() if not line: break v = re.findall(r'#define CGAL_VERSION ([^\r\n]*)', line) if v: v = v[0] break verbose(2, 'CGAL version=%s' % v) f.close() return v | def find_cgal_vers(self, installed=False, in_build=False): v = '' f = self.find_cgal_inc(installed, in_build) if f: while True: line = f.readline() if not line: break v = re.findall(r'#define CGAL_VERSION ([^\r\n]*)', line) if v: v = v[0] break verbose(2, 'CGAL version=%s' % v) return v | 476,991 |
def usage(): print "Usage: %s filebase [outfilename]" % sys.argv[0] print "Where filebase.cas is a Fluent case file." print "Output will be in filebase-prism.dat if it is not specified." sys.exit(1) | def usage(): print "Usage: %s filebase [outfilename]" % sys.argv[0] print "Where filebase.cas is a Fluent case file." print "Output will be in filebase-prism.dat if it is not specified." sys.exit(1) | 476,992 |
def usage(): print "Usage: %s filebase [outfilename]" % sys.argv[0] print "Where filebase.cas is a Fluent case file." print "Output will be in filebase-prism.dat if it is not specified." sys.exit(1) | def usage(): print "Usage: %s filebase [outfilename]" % sys.argv[0] print "Where filebase.cas is a Fluent case file." print "Output will be in filebase-prism.dat if it is not specified." sys.exit(1) | 476,993 |
def __init__(self, cname, topdir, make_path): # create build directories cwd = os.getcwd() self.topdir = topdir self.blddir = os.path.join(os.getcwd(), "build-%s" % cname) self.logdir = os.path.join(self.blddir, "log") self.bindir = os.path.join(self.blddir, "bin") self.libdir = os.path.join(self.blddir, "lib") for p i... | def __init__(self, cname, topdir, make_path): # create build directories cwd = os.getcwd() topdir = os.path.abspath(topdir) self.topdir = topdir self.blddir = os.path.join(os.getcwd(), "build-%s" % cname) self.logdir = os.path.join(self.blddir, "log") self.bindir = os.path.join(self.blddir, "bin") self.libdir = os.path... | 476,994 |
def __init__(self, cname, topdir, make_path): # create build directories cwd = os.getcwd() self.topdir = topdir self.blddir = os.path.join(os.getcwd(), "build-%s" % cname) self.logdir = os.path.join(self.blddir, "log") self.bindir = os.path.join(self.blddir, "bin") self.libdir = os.path.join(self.blddir, "lib") for p i... | def __init__(self, cname, topdir, make_path): # create build directories cwd = os.getcwd() self.topdir = topdir self.blddir = os.path.join(os.getcwd(), "build-%s" % cname) self.logdir = os.path.join(self.blddir, "log") self.bindir = os.path.join(self.blddir, "bin") self.libdir = os.path.join(self.blddir, "lib") for p i... | 476,995 |
def generate(env): cppTool.generate(env) if not env.get('CXXVERSION'): try: line = os.popen("/bin/bash -c 'gcc --version 2>&1'").readline() env['CXXVERSION'] = re.compile(r'[^(]*[^)]*\) ([^\n ]*)').findall(line)[0] except: env['CXXVERSION'] = '4.2.1' env['COMPILER'] = 'gcc-' + env['CXXVERSION'] env['CXXFLAGS'] = CLV... | def generate(env): cppTool.generate(env) if not env.get('CXXVERSION'): try: line = os.popen("/bin/bash -c 'gcc --version 2>&1'").readline() env['CXXVERSION'] = re.compile(r'[^(]*[^)]*\) ([^\n ]*)').findall(line)[0] except: env['CXXVERSION'] = '4.2.1' env['COMPILER'] = 'gcc-' + env['CXXVERSION'] env['CXXFLAGS'] = CLV... | 476,996 |
def _build(self): return self.sys_log("make -j%s" % jobs(self.name)) | def _build(self): return self.sys_log("make -j%s" % jobs(self.name)) | 476,997 |
def sys_log(self, cmd, show=False): "Execute a system call and log the result." # get configuration variable e = config(self.name, self.state) e = e.replace('BUILDDIR', self.blddir) e = e.replace('SRCDIR', self.sdir) e = e.replace('TMPBDIR', self.bdir) e = e.replace('LOGDIR', self.logdir) cmd = cmd + " " + e debug(cmd)... | def sys_log(self, cmd, show=False): "Execute a system call and log the result." # get configuration variable e = config(self.name, self.state) e = e.replace('BUILDDIR', self.blddir) e = e.replace('SRCDIR', self.sdir) e = e.replace('TMPBDIR', self.bdir) e = e.replace('LOGDIR', self.logdir) cmd = cmd + " " + e debug(cmd)... | 476,998 |
def write_env(bld, cwd, cname): # write out env.csh for people who haven't yet learned bash env_name = os.path.join(cwd, 'env.csh') f = open(env_name, 'w') for cmd in config('ALL', 'before'): f.write('%s\n' % cmd) print >> f, "setenv LD_LIBRARY_PATH " + bld.libdir + ":$LD_LIBRARY_PATH" try: if os.environ['PYTHONPATH']... | def write_env(bld, cwd, cname): # write out env.csh for people who haven't yet learned bash env_name = os.path.join(cwd, 'env.csh') f = open(env_name, 'w') for cmd in config('ALL', 'before'): exp = re.findall(r'export (\S+)=(\S+)', cmd) if exp: f.write('setenv %s %s\n' % (exp[0][0], exp[0][1])) else: f.write('%s\n' % c... | 476,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.