Ejemplo n.º 1
0
 def testSpecial(self):
     os.chmod(self.tmpdir, 0o2755)
     store = Store(self.tmpdir)
     with open('HelloWorld.tgz', 'rb') as stream:
         store.add_archive_to_cache(
             'sha1=3ce644dc725f1d21cfcf02562c76f375944b266a', stream,
             'http://foo/foo.tgz')
Ejemplo n.º 2
0
    def setUp(self):
        BaseTest.setUp(self)

        self.store_parent = tempfile.mktemp()
        os.mkdir(self.store_parent, 0o700)
        self.store = Store(self.store_parent + '/implementations')
        os.mkdir(self.store.dir, 0o700)

        self.tmp = tempfile.mktemp()
        os.mkdir(self.tmp)
Ejemplo n.º 3
0
    def testBad(self):
        logging.getLogger('').setLevel(logging.ERROR)

        store = Store(self.tmpdir)
        try:
            store.add_archive_to_cache(
                'sha1=3ce644dc725f1d21cfcf02562c76f375944b266b',
                file('HelloWorld.tgz'), 'http://foo/foo.tgz')
            assert 0
        except BadDigest:
            pass

        logging.getLogger('').setLevel(logging.INFO)
Ejemplo n.º 4
0
	if zeroinstall_dir:
			# We've been run by an old version of 0install.
			# We assuming that, if installed through 0install, 0launch requires
			# the same version of Python as 0compile.
			install_prog = [sys.executable, os.path.join(zeroinstall_dir, '0install')]
			if not os.path.exists(install_prog[1]):
				# For the Windows version...
				install_prog[1] = os.path.join(zeroinstall_dir, 'zeroinstall', 'scripts', 'install.py')
	else:
		install_prog = ['0install']
else:
	install_prog = [install_path]

if os.path.isdir('dependencies'):
	dep_dir = os.path.realpath('dependencies')
	iface_cache.stores.stores.append(Store(dep_dir))
	install_prog.append('--with-store='+ dep_dir)

class NoImpl:
	id = "none"
	version = "none"
no_impl = NoImpl()

def is_package_impl(impl):
	return impl.id.startswith("package:")

def lookup(impl_or_sel):
	id = impl_or_sel.id
	if id.startswith('package:'):
		return None
	local_path = impl_or_sel.local_path