rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self.assert_(title in ( "Hello, " + snowman + "!", "Hello, " + sm2 + "!"), repr(title))
for snowman in snowmen: if title == "Hello, " + snowman + "!": break else: self.fail("unexpected ps output: %r" % title)
def test_unicode(self): """Title can contain unicode characters.""" if 'utf-8' != sys.getdefaultencoding(): raise SkipTest("encoding '%s' can't deal with snowmen" % sys.getdefaultencoding())
def run_script(self, script, args=None):
def test_issue_8(self): """Test that the module works with 'python -m'.""" module = 'spt_issue_8' pypath = os.environ.get('PYTHONPATH', None) dir = tempfile.mkdtemp() os.environ['PYTHONPATH'] = dir + os.pathsep + (pypath or '') try: open(dir + '/' + module + '.py', 'w').write( self._clean_whitespaces(r""" import setpro...
def run_script(self, script, args=None): """run a script in a separate process.
script = self._clean_whitespaces(script)
def run_script(self, script, args=None): """run a script in a separate process.
setproctitle.setproctitle("X" * 40) import sys if 'bsd' in sys.platform: print open("/proc/curproc/cmdline").read() else: print open("/proc/self/cmdline").read()
setproctitle.setproctitle("Hello, module!") import os print os.getpid() print os.popen("ps -o pid,command 2> /dev/null").read()
def test_issue_8(self): """Test that the module works with 'python -m'.""" module = 'spt_issue_8' pypath = os.environ.get('PYTHONPATH', None) dir = tempfile.mkdtemp() os.environ['PYTHONPATH'] = dir + os.pathsep + (pypath or '') try: open(dir + '/' + module + '.py', 'w').write( self._clean_whitespaces(r""" import setpro...
rv = self._clean_up_title(rv) self.assert_(rv.startswith('X' * 40))
lines = filter(None, rv.splitlines()) pid = lines.pop(0) pids = dict([r.strip().split(None, 1) for r in lines]) title = self._clean_up_title(pids[pid]) self.assertEqual(title, "Hello, module!")
def test_issue_8(self): """Test that the module works with 'python -m'.""" module = 'spt_issue_8' pypath = os.environ.get('PYTHONPATH', None) dir = tempfile.mkdtemp() os.environ['PYTHONPATH'] = dir + os.pathsep + (pypath or '') try: open(dir + '/' + module + '.py', 'w').write( self._clean_whitespaces(r""" import setpro...
title = pids[pid] if 'bsd' in sys.platform: procname = os.path.basename(sys.executable) title = ' '.join([t for t in title.split(' ') if procname not in t])
title = self._clean_up_title(pids[pid])
def test_setproctitle(self): """setproctitle() can set the process title, duh.""" rv = self.run_script(r""" import setproctitle setproctitle.setproctitle('Hello, world!')
print open("/proc/self/cmdline").read()
import sys if 'bsd' in sys.platform: print open("/proc/curproc/cmdline").read() else: print open("/proc/self/cmdline").read()
def test_issue_8(self): """Test that the module works with 'python -m'.""" module = 'spt_issue_8' pypath = os.environ.get('PYTHONPATH', None) dir = tempfile.mkdtemp() os.environ['PYTHONPATH'] = dir + os.pathsep + (pypath or '') try: open(dir + '/' + module + '.py', 'w').write( self._clean_whitespaces(r""" import setpro...
self.assertEqual(rv.replace('\x00', ' ').rstrip(), 'X' * 40)
rv = self._clean_up_title(rv) self.assert_(rv.startswith('X' * 40))
def test_issue_8(self): """Test that the module works with 'python -m'.""" module = 'spt_issue_8' pypath = os.environ.get('PYTHONPATH', None) dir = tempfile.mkdtemp() os.environ['PYTHONPATH'] = dir + os.pathsep + (pypath or '') try: open(dir + '/' + module + '.py', 'w').write( self._clean_whitespaces(r""" import setpro...
if the script completes successfully, return the concatenation of ``stdout`` and ``stderr``. else fail.
if the script completes successfully, return its ``stdout``, else fail the test.
def run_script(self, script=None, args=None): """run a script in a separate process.
stdin=PIPE, stdout=PIPE, stderr=STDOUT,
stdin=PIPE, stdout=PIPE, stderr=PIPE,
def run_script(self, script=None, args=None): """run a script in a separate process.
out = proc.communicate(script)[0]
out, err = proc.communicate(script)
def run_script(self, script=None, args=None): """run a script in a separate process.
:rtype: :class:`~twod.wsgi.request.DjangoApplication`
:rtype: :class:`~twod.wsgi.handler.DjangoApplication`
def wsgify_django(global_config, **local_conf): """ Load the Django application for use in a WSGI server. :raises ImportError: If the Django settings module cannot be imported. :raises ValueError: If ``local_conf`` contains a Django setting which is not supported. :raises ValueError: If the ``django_settings_module`` ...
django_view = make_wsgi_view(app, "/blog")
def test_string_as_response(self): app = MockApp("200 It is OK", [("X-HEADER", "Foo")]) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) # Checking the response: django_response = django_view(request...
django_response = django_view(request)
def test_string_as_response(self): app = MockApp("200 It is OK", [("X-HEADER", "Foo")]) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) # Checking the response: django_response = django_view(request...
django_view = make_wsgi_view(app, "/blog")
def test_iterable_as_response(self): app = MockGeneratorApp("200 It is OK", [("X-HEADER", "Foo")]) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) # Checking the response: django_response = django_v...
django_response = django_view(request)
def test_iterable_as_response(self): app = MockGeneratorApp("200 It is OK", [("X-HEADER", "Foo")]) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) # Checking the response: django_response = django_v...
django_view = make_wsgi_view(app, "/blog")
def test_write_response(self): app = MockWriteApp("200 It is OK", [("X-HEADER", "Foo")]) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) # Checking the response: django_response = django_view(reques...
django_response = django_view(request)
def test_write_response(self): app = MockWriteApp("200 It is OK", [("X-HEADER", "Foo")]) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) # Checking the response: django_response = django_view(reques...
django_view = make_wsgi_view(app, "/blog")
def test_closure_response(self): """The .close() method in the response (if any) must be kept.""" app = MockClosingApp("200 It is OK", []) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) django_resp...
django_response = django_view(request)
django_response = call_wsgi_app(app, request, "/blog")
def test_closure_response(self): """The .close() method in the response (if any) must be kept.""" app = MockClosingApp("200 It is OK", []) django_view = make_wsgi_view(app, "/blog") # Running a request: environ = complete_environ(SCRIPT_NAME="/dev", PATH_INFO="/blog/posts") request = make_request(**environ) django_resp...
logfile = options.logfile
if options.logfile: logfile = options.logfile
def Cleanup(ret):
qbk_file = xml_file.replace('.xml', '.qbk')
qbk_file = os.path.normpath(xml_file.replace('.xml', '.qbk')).replace('\\', '/')
def hash_qbk_file(self, xml_file): qbk_file = xml_file.replace('.xml', '.qbk') if(not os.path.isfile(qbk_file)): return (None, None) with open(qbk_file) as file: return (qbk_file, hashlib.sha256(file.read()).hexdigest())
self.mox.StubOutWithMock(hesiod, 'Lookup')
self.mox.StubOutWithMock(hesiod, 'Lookup', use_mock_anything=True)
def setUp(self): super(TestHesiodLookup, self).setUp()
s.settimeout(0, 3)
s.settimeout(0.3)
def is_cups_server(rm): """See if a host is accepting connections on port 631. Args: A hostname Returns: True if the server is accepting connections, otherwise False """ try: s = socket.socket() s.settimeout(0, 3) s.connect((rm, 631)) s.close() return True except (socket.error, socket.timeout): return False
default = cups.getDefault()
default = cupsd.getDefault()
def get_default_printer(): """Find and return the default printer""" _setup() if 'PRINTER' in os.environ: return os.environ['PRINTER'] if cupsd: default = cups.getDefault() if default: return default for result in _hesiod_lookup(socket.getfqdn(), 'cluster'): key, value = result.split(None, 1) if key == 'lpr': return...
redis.srem(self.__class__.categories_key, category)
self.redis.srem(self.__class__.categories_key, category)
def classify(self, text): scores = {}
self.command_timeout = getattr(self.settings_dict, 'COMMAND_TIMEOUT', 30) if type(self.command_timeout) != int:
try: self.command_timeout = int(self.settings_dict.get('COMMAND_TIMEOUT', 30)) except ValueError:
def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) self.features = DatabaseFeatures() self.ops = DatabaseOperations() self.client = BaseDatabaseClient(self) self.creation = DatabaseCreation(self) self.introspection = DatabaseIntrospection(self) self.validation = BaseDatabaseVa...
raise exceptions.ValidationError(
raise ValidationError(
def to_python(self, value): if value is None: return value try: return long(value) except (TypeError, ValueError): raise exceptions.ValidationError( _("This value must be an long."))
self.assertRaises(Exception, test_view('stock_supply_day'))
test_view('stock_supply_day')
def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('stock_supply_day'))
raise KeyError("Field %s not found" % field_name)
found = False for group in getattr(form, 'groups', []): if field_name in group.fields: found = True break if not found: raise KeyError("Field %s not found" % field_name)
def move(form, field_name, before=None, after=None, prefix=None, relative_prefix=None): """Move the field with the given name before or after another field. """ if prefix: field_name = expandPrefix(prefix) + field_name if before and after: raise ValueError(u"Only one of 'before' or 'after' is allowed") offset = 0 if ...
install_glob(srcdir('html/ops/*.php'), dir('html/ops/')) install_glob(srcdir('html/ops/*.inc'), dir('html/ops/'))
def dir(*dirs): return apply(os.path.join,(dest_dir,)+dirs)
install(srcdir('html/ops', 'sample_server_status.php'), self.dir('html/user/server_status.php'))
def install_project(self, scheduler_file = None): if os.path.exists(self.dir()): raise SystemExit('Project directory "%s" already exists; this would clobber it!'%self.dir())
my_symlink(dir('html/user_profile'), dir('html/user/user_profile'));
try: my_symlink(dir('html/user_profile'), dir('html/user/user_profile')); except: pass
def dir(*dirs): return apply(os.path.join,(dest_dir,)+dirs)
if fn.rfind('.c') or fn.rfind('.C') or fn.rfind('.cpp'):
if fn.rfind('.c') != -1 or fn.rfind('.C') != -1 or fn.rfind('.cpp') != -1:
def _get_filetype(fn): if fn.rfind('.c') or fn.rfind('.C') or fn.rfind('.cpp'): return 1 # assimble file type if fn.rfind('.s') or fn.rfind('.S'): return 2 # header type if fn.rfind('.h'): return 5 # other filetype return 5
if fn.rfind('.s') or fn.rfind('.S'):
if fn.rfind('.s') != -1 or fn.rfind('.S') != -1:
def _get_filetype(fn): if fn.rfind('.c') or fn.rfind('.C') or fn.rfind('.cpp'): return 1 # assimble file type if fn.rfind('.s') or fn.rfind('.S'): return 2 # header type if fn.rfind('.h'): return 5 # other filetype return 5
if fn.rfind('.h'):
if fn.rfind('.h') != -1:
def _get_filetype(fn): if fn.rfind('.c') or fn.rfind('.C') or fn.rfind('.cpp'): return 1 # assimble file type if fn.rfind('.s') or fn.rfind('.S'): return 2 # header type if fn.rfind('.h'): return 5 # other filetype return 5
lines.insert(line_index, 'File %d,%d<%s><%s>\r\n'
lines.insert(line_index, 'File %d,%d,<%s><%s>\r\n'
def MDKProject(target, script): template = file(RTT_ROOT + '/scons_script/template.uV2', "rb") lines = template.readlines() project = file(target, "wb") project_path = os.path.dirname(os.path.abspath(target)) line_index = 5 # write group for group in script: lines.insert(line_index, 'Group (%s)\r\n' % group['name']) ...
global error global parse_file global success
global error, parse_file, success, parser
def p_error(tok): global error global parse_file global success error = "%s: Syntax error on line %d %s [type=%s]" % (parse_file, tok.lineno, tok.value, tok.type) print error success = False
lexer.lexdata = [] lexer.lexpos = 0 lexer.lineno = 1
global error, parser, lexer, success success = True
def parse(text, module=None, support=None, debug=False): create_globals(module, support, debug) lexer.lexdata = [] lexer.lexpos = 0 lexer.lineno = 1 try: parser.parse(text, debug=debug) except Exception, e: global error error = "internal parser error: %s" % str(e) + "\n" + traceback.format_exc() if error is not None:...
parser.parse(text, debug=debug)
parser.parse(text, debug=debug, lexer=lexer)
def parse(text, module=None, support=None, debug=False): create_globals(module, support, debug) lexer.lexdata = [] lexer.lexpos = 0 lexer.lineno = 1 try: parser.parse(text, debug=debug) except Exception, e: global error error = "internal parser error: %s" % str(e) + "\n" + traceback.format_exc() if error is not None:...
global error
parser = None lexer = None
def parse(text, module=None, support=None, debug=False): create_globals(module, support, debug) lexer.lexdata = [] lexer.lexpos = 0 lexer.lineno = 1 try: parser.parse(text, debug=debug) except Exception, e: global error error = "internal parser error: %s" % str(e) + "\n" + traceback.format_exc() if error is not None:...
if error is not None:
if not success: parser = None
def parse(text, module=None, support=None, debug=False): create_globals(module, support, debug) lexer.lexdata = [] lexer.lexpos = 0 lexer.lineno = 1 try: parser.parse(text, debug=debug) except Exception, e: global error error = "internal parser error: %s" % str(e) + "\n" + traceback.format_exc() if error is not None:...
blacklist = ["init.if", "inetd.if", "uml.if", "thunderbird.if"]
def list_headers(root): modules = [] support_macros = None blacklist = ["init.if", "inetd.if", "uml.if", "thunderbird.if"] for dirpath, dirnames, filenames in os.walk(root): for name in filenames: # FIXME: these make the parser barf in various unrecoverable ways, so we must skip # them. if name in blacklist: continue ...
if name in blacklist: continue
def list_headers(root): modules = [] support_macros = None blacklist = ["init.if", "inetd.if", "uml.if", "thunderbird.if"] for dirpath, dirnames, filenames in os.walk(root): for name in filenames: # FIXME: these make the parser barf in various unrecoverable ways, so we must skip # them. if name in blacklist: continue ...
self.settings["CFLAGS"]="-Os -march=armv4 -pipe"
self.settings["CFLAGS"]+=" -march=armv4"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv4l-unknown-linux-gnu" self.settings["CFLAGS"]="-Os -march=armv4 -pipe"
self.settings["CFLAGS"]="-Os -march=armv4t -pipe" class arch_armv5l(generic_arm): "Builder class for armv5l target" def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv5l-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv5 -pipe"
self.settings["CFLAGS"]+=" -march=armv4t"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv4tl-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv4t -pipe"
self.settings["CFLAGS"]="-Os -march=armv5t -pipe"
self.settings["CFLAGS"]+=" -march=armv5t"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv5tl-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv5t -pipe"
self.settings["CFLAGS"]="-Os -march=armv5te -pipe"
self.settings["CFLAGS"]+=" -march=armv5te"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv5tel-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv5te -pipe"
self.settings["CFLAGS"]="-Os -march=armv5te -pipe"
self.settings["CFLAGS"]+=" -march=armv5te"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv5tejl-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv5te -pipe"
class arch_armv6l(generic_arm): "Builder class for armv6l target"
class arch_armv6j(generic_arm): "Builder class for armv6j target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv5tejl-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv5te -pipe"
self.settings["CHOST"]="armv6l-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6 -pipe"
self.settings["CHOST"]="armv6j-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv6j -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6l-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6 -pipe"
class arch_armv6jl(generic_arm): "Builder class for armv6jl target"
class arch_armv6t2(generic_arm): "Builder class for armv6t2 target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6l-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6 -pipe"
self.settings["CHOST"]="armv6jl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6j -pipe"
self.settings["CHOST"]="armv6t2-unknown-linux-gnueabi" self.settings["CFLAGS"]=" -march=armv6t2 -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6jl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6j -pipe"
class arch_armv6t2l(generic_arm): "Builder class for armv6t2l target"
class arch_armv6z(generic_arm): "Builder class for armv6z target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6jl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6j -pipe"
self.settings["CHOST"]="armv6t2l-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6t2 -pipe"
self.settings["CHOST"]="armv6z-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv6z -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6t2l-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6t2 -pipe"
class arch_armv6zl(generic_arm): "Builder class for armv6zl target"
class arch_armv6zk(generic_arm): "Builder class for armv6zk target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6t2l-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6t2 -pipe"
self.settings["CHOST"]="armv6zl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6z -pipe"
self.settings["CHOST"]="armv6zk-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv6zk -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6zl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6z -pipe"
class arch_armv6zkl(generic_arm): "Builder class for armv6zkl target"
class arch_armv7a(generic_arm): "Builder class for armv7a target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6zl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6z -pipe"
self.settings["CHOST"]="armv6zkl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6zk -pipe"
self.settings["CHOST"]="armv7a-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6zkl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6zk -pipe"
class arch_armv7l(generic_arm): "Builder class for armv7l target"
class arch_armv7r(generic_arm): "Builder class for armv7r target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6zkl-softloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv6zk -pipe"
self.settings["CHOST"]="armv7l-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv7 -pipe"
self.settings["CHOST"]="armv7rl-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-r -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7l-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv7 -pipe"
class arch_armv7al(generic_arm): "Builder class for armv7al target"
class arch_armv7m(generic_arm): "Builder class for armv7m target"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7l-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv7 -pipe"
self.settings["CHOST"]="armv7al-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv7-a -pipe" class arch_armv7rl(generic_arm): "Builder class for armv7rl target" def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7ml-softfloat-linux-gnueabi" self.settings["CFLAGS"]="...
self.settings["CHOST"]="armv7m-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-m -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7al-softfloat-linux-gnueabi" self.settings["CFLAGS"]="-Os -march=armv7-a -pipe"
"armv5l" : arch_armv5l,
def register(): "Inform main catalyst program of the contents of this plugin." return ({ "arm" : arch_arm, "armv4l" : arch_armv4l, "armv4tl": arch_armv4tl, "armv5l" : arch_armv5l, "armv5tl": arch_armv5tl, "armv5tel": arch_armv5tel, "armv5tejl": arch_armv5tejl, "armv6l" : arch_armv6l, "armv6jl" : arch_armv6jl, "armv6...
"armv6l" : arch_armv6l, "armv6jl" : arch_armv6jl, "armv6t2l" : arch_armv6t2l, "armv6zl" : arch_armv6zl, "armv6zkl" : arch_armv6zkl, "armv7l" : arch_armv7l, "armv7al" : arch_armv7al, "armv7rl" : arch_armv7rl, "armv7ml" : arch_armv7ml,
"armv6j" : arch_armv6j, "armv6t2" : arch_armv6t2, "armv6z" : arch_armv6z, "armv6zk" : arch_armv6zk, "armv7a" : arch_armv7a, "armv7r" : arch_armv7r, "armv7m" : arch_armv7m,
def register(): "Inform main catalyst program of the contents of this plugin." return ({ "arm" : arch_arm, "armv4l" : arch_armv4l, "armv4tl": arch_armv4tl, "armv5l" : arch_armv5l, "armv5tl": arch_armv5tl, "armv5tel": arch_armv5tel, "armv5tejl": arch_armv5tejl, "armv6l" : arch_armv6l, "armv6jl" : arch_armv6jl, "armv6...
}, ("arm", "armv4l", "armv4tl", "armv5l", "armv5tl", "armv5tel", "armv5tejl", "armv6l",
}, ("arm", "armv4l", "armv4tl", "armv5tl", "armv5tel", "armv5tejl", "armv6l",
def register(): "Inform main catalyst program of the contents of this plugin." return ({ "arm" : arch_arm, "armv4l" : arch_armv4l, "armv4tl": arch_armv4tl, "armv5l" : arch_armv5l, "armv5tl": arch_armv5tl, "armv5tel": arch_armv5tel, "armv5tejl": arch_armv5tejl, "armv6l" : arch_armv6l, "armv6jl" : arch_armv6jl, "armv6...
"loongson" : arch_mipsel3,
"loongson2e" : arch_loongson2e, "loongson2e_n32" : arch_loongson2e_n32, "loongson2f" : arch_loongson2f, "loongson2f_n32" : arch_loongson2f_n32,
def __init__(self,myspec): arch_mips4_n32.__init__(self,myspec) self.settings["HOSTUSE"]=["ip30","n32"]
class arch_loongson2e(generic_mipsel): "Builder class for all Loongson 2E [Little-endian]" def __init__(self,myspec): generic_mipsel.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=loongson2e -mabi=32 -pipe -mplt" class arch_loongson2e_n32(generic_mipsel): "Builder class for all Loongson 2E [Little-endian N3...
def __init__(self,myspec): generic_mipsel.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -mips3 -mabi=n32 -pipe" self.settings["CHOST"]="mips64el-unknown-linux-gnu" self.settings["HOSTUSE"]=["n32"]
"loongson2e" : arch_loongson2e, "loongson2e_n32" : arch_loongson2e_n32, "loongson2f" : arch_loongson2f, "loongson2f_n32" : arch_loongson2f_n32,
"loongson" : arch_mipsel3,
def __init__(self,myspec): arch_mips4_n32.__init__(self,myspec) self.settings["HOSTUSE"]=["ip30","n32"]
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hardfp"
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7a-hardfloat-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hardfp"
"armv5l" : arch_armv5l,
def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi"
"armv5teb" : arch_armv5teb,
def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi"
"armv6l" : arch_armv6l, "armv6jl" : arch_armv6jl, "armv6t2l" : arch_armv6t2l, "armv6zl" : arch_armv6zl, "armv6zkl" : arch_armv6zkl, "armv7l" : arch_armv7l, "armv7al" : arch_armv7al, "armv7rl" : arch_armv7rl, "armv7ml" : arch_armv7ml, "armeb" : arch_armeb
"armv6j" : arch_armv6j, "armv6t2" : arch_armv6t2, "armv6z" : arch_armv6z, "armv6zk" : arch_armv6zk, "armv7a" : arch_armv7a, "armv7r" : arch_armv7r, "armv7m" : arch_armv7m, "armeb" : arch_armeb, "armv5teb" : arch_armv5teb
def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi"
_machine_map = ("arm", "armv4l", "armv4tl", "armv5l", "armv5tl", "armv5tel", "armv5tejl", "armv6l", "armv7l", "armeb", "armv5teb")
_machine_map = ("arm", "armv4l", "armv4tl", "armv5tl", "armv5tel", "armv5tejl", "armv6l", "armv7l", "armeb", "armv5teb")
def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi"
class arch_armv6t2(generic_arm): "Builder class for armv6t2 target" def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6t2-unknown-linux-gnueabi" self.settings["CFLAGS"]=" -march=armv6t2 -mfpu=vfp -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv6j-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv6j -mfpu=vfp -mfloat-abi=softfp"
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=softfp" class arch_armv7r(generic_arm): "Builder class for armv7r target" def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7r-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-r -mfpu=vfp -mfloat-abi=so...
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7a-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=softfp"
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=hard"
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7a-hardfloat-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=hard"
"armv6t2" : arch_armv6t2,
def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi"
"armv7r" : arch_armv7r, "armv7m" : arch_armv7m,
def __init__(self,myspec): generic_armeb.__init__(self,myspec) self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5teb-softfloat-linux-gnueabi"
self.settings["CHOST"]="armv7rl-unknown-linux-gnueabi"
self.settings["CHOST"]="armv7r-unknown-linux-gnueabi"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7rl-unknown-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-r -mfpu=vfp -mfloat-abi=softfp"
retval = catalyst.spawn.spawn_bash("rsync -a --delete %s %s %s" % (extra_opts, src, dest))
delete_opts = "" if delete: delete_opts = "--delete" retval = catalyst.spawn.spawn_bash("rsync -a %s %s %s %s" % (delete_opts, extra_opts, src, dest))
def rsync(src, dest, delete=False, extra_opts=""): retval = catalyst.spawn.spawn_bash("rsync -a --delete %s %s %s" % (extra_opts, src, dest)) if retval != 0: raise CatalystError("Could not rsync '%s' to '%s'" % (src, dest))
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=hardfp"
self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hardfp"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv7a-hardfloat-linux-gnueabi" self.settings["CFLAGS"]+=" -march=armv7-a -mfpu=vfp -mfloat-abi=hardfp"
"armv6t2" : arch_armv6t2,
def register(): "Inform main catalyst program of the contents of this plugin." return ({ "arm" : arch_arm, "armv4l" : arch_armv4l, "armv4tl": arch_armv4tl, "armv5tl": arch_armv5tl, "armv5tel": arch_armv5tel, "armv5tejl": arch_armv5tejl, "armv6j" : arch_armv6j, "armv6t2" : arch_armv6t2, "armv6z" : arch_armv6z, "armv6...
"armv7r" : arch_armv7r, "armv7m" : arch_armv7m,
def register(): "Inform main catalyst program of the contents of this plugin." return ({ "arm" : arch_arm, "armv4l" : arch_armv4l, "armv4tl": arch_armv4tl, "armv5tl": arch_armv5tl, "armv5tel": arch_armv5tel, "armv5tejl": arch_armv5tejl, "armv6j" : arch_armv6j, "armv6t2" : arch_armv6t2, "armv6z" : arch_armv6z, "armv6...
__albumfn = None
__file = None
def __stop_ignore(self, *args): self.__ignore = False self.disconnect(self.__sig)
cover = song.find_cover() self.__albumfn = cover and cover.name self.child.set_path(self.__albumfn)
self.__file = song.find_cover() self.child.set_path(self.__file and self.__file.name)
def set_song(self, activator, song): if not self.child: return if song: cover = song.find_cover() self.__albumfn = cover and cover.name self.child.set_path(self.__albumfn) else: self.child.set_path(None) self.__song = song
return bool(self.__albumfn)
return bool(self.__file)
def __nonzero__(self): return bool(self.__albumfn)
dest = join(dist_path, r'share\locales', locale, 'LC_MESSAGES')
dest = join(dist_path, r'share\locale', locale, 'LC_MESSAGES')
def do_setup(rev): PYVER='2.6' deps = [ (PythonDep('Python', PYVER), MSIInst('Python')), (OnePageDep('setuptools', None, 'http://pypi.python.org/pypi/setuptools', '[^"]*setuptools[^"]*tar.gz[^"#]*'), SetuptoolsInst()), (SFDep('gnuwin32', None, 'unrar-[1234567890.]*-bin.zip'), ZipInst('Python')), (SFDep('innounp', None,...
class ReleaseEventComboBox(gtk.ComboBox):
class ReleaseEventComboBox(gtk.HBox):
def celldata(layout, cell, model, iter): release = model[iter][0] if not release: return date = release.getEarliestReleaseDate() if date: date = '%s, ' % date else: date = '' markup = "<b>%s</b>\n%s - %s%s tracks" % ( util.escape(release.title), util.escape(release.artist.name), date, release.tracksCount) cell.set_prop...
super(ReleaseEventComboBox, self).__init__(self.model)
self.combo = gtk.ComboBox(self.model)
def __init__(self): self.model = gtk.ListStore(object, str) super(ReleaseEventComboBox, self).__init__(self.model) render = gtk.CellRendererText() self.pack_start(render) self.set_attributes(render, markup=1) self.set_sensitive(False)
self.pack_start(render) self.set_attributes(render, markup=1) self.set_sensitive(False)
self.combo.pack_start(render) self.combo.set_attributes(render, markup=1) self.combo.set_sensitive(False) self.label = gtk.Label("_Release:") self.label.set_use_underline(True) self.label.set_mnemonic_widget(self.combo) self.pack_start(self.label, expand=False) self.pack_start(self.combo)
def __init__(self): self.model = gtk.ListStore(object, str) super(ReleaseEventComboBox, self).__init__(self.model) render = gtk.CellRendererText() self.pack_start(render) self.set_attributes(render, markup=1) self.set_sensitive(False)
self.set_active(0) self.set_sensitive((len(events) > 0))
self.combo.set_active(0) self.combo.set_sensitive((len(events) > 0)) text = ngettext("%d _release:", "%d _releases:", len(events)) self.label.set_text(text % len(events)) self.label.set_use_underline(True)
def update(self, release): self.model.clear() events = release.getReleaseEvents() # The catalog number is the most important of these fields, as it's # the source for the 'labelid' tag, which we'll use until MB NGS is # up and running to deal with multi-disc albums properly. We sort to # find the earliest release with ...
itr = self.get_active_iter()
itr = self.combo.get_active_iter()
def get_release_event(self): itr = self.get_active_iter() if itr: return self.model[itr][0] else: return None
shared['date'] = album.getEarliestReleaseDate() or '' if shared['date'] and config_get('year_only', False): shared['date'] = shared['date'].split('-')[0]
def __save(self, widget=None, response=None): """Writes values to Song objects.""" self._qthread.stop() if response != gtk.RESPONSE_ACCEPT: self.destroy() return
relevt = self.release_combo.get_release_event()
def __save(self, widget=None, response=None): """Writes values to Song objects.""" self._qthread.stop() if response != gtk.RESPONSE_ACCEPT: self.destroy() return
if idx > len(album.tracks): continue
if idx >= len(album.tracks): continue
def __save(self, widget=None, response=None): """Writes values to Song objects.""" self._qthread.stop() if response != gtk.RESPONSE_ACCEPT: self.destroy() return
self.release_combo.set_sensitive(False) lbl = gtk.Label("_Release:") lbl.set_use_underline(True) lbl.set_mnemonic_widget(self.release_combo) hb.pack_start(lbl, expand=False) hb.pack_start(self.release_combo) vb.pack_start(hb, expand=False)
vb.pack_start(self.release_combo, expand=False)
def __init__(self, album, cache): self.album = album
def parse_url(self, url, post = {}, get = {}, enc = 'utf-8'):
def parse_url(self, url, post = {}, get = {}):
def parse_url(self, url, post = {}, get = {}, enc = 'utf-8'): """Will read the data and parse it into the data variable. A tag will be ['tagname', {all attributes}, 'data until the next tag'] Only starttags are handled/used."""
post_params = urllib.urlencode(post) get_params = urllib.urlencode(get) if get: get_params = '?' + get_params req = urllib2.urlopen('%s%s' % (url, get_params), post_params) text = req.read().decode(enc, 'replace')
text, self.encoding = get_url(url, post, get) text = text.decode(self.encoding, 'replace')
def parse_url(self, url, post = {}, get = {}, enc = 'utf-8'): """Will read the data and parse it into the data variable. A tag will be ['tagname', {all attributes}, 'data until the next tag'] Only starttags are handled/used."""
req.close()
def parse_url(self, url, post = {}, get = {}, enc = 'utf-8'): """Will read the data and parse it into the data variable. A tag will be ['tagname', {all attributes}, 'data until the next tag'] Only starttags are handled/used."""