Exemplo n.º 1
0
#!/usr/bin/python
# Copyright (C) 2008, Charles Wang <*****@*****.**>
# Author: Charles Wang <*****@*****.**>
# License: BSD

import os.path
import shutil
import sys
from pkg_resources import Distribution
from pypi2pkgsys.package_system import package_system
from pypi2pkgsys.pypi_objects import pypicache

if len(sys.argv) < 4:
    print 'Usage: %s CACHE_ROOT CACHE_URL FILENAME,DISTNAME ...' % sys.argv[0]
    sys.exit(-1)

cacheroot = sys.argv[1]
cacheurl = sys.argv[2]
downloads = os.path.join(cacheroot, 'downloads')
distlist = []
for arg in sys.argv[3:]:
    filename, distname = arg.split(',')
    dlfname = os.path.join(downloads, os.path.basename(filename))
    print 'Copy %s %s ...' % (filename, dlfname)
    shutil.copyfile(filename, dlfname)
    dist = Distribution(dlfname, None, project_name=distname)
    distlist.append(dist)
cache = pypicache(package_system(), cacheroot, cacheurl)
cache.add_packages(distlist)
del (cache)
Exemplo n.º 2
0
#!/usr/bin/python
# Copyright (C) 2008, Charles Wang <*****@*****.**>
# Author: Charles Wang <*****@*****.**>
# License: BSD

import sys
from pypi2pkgsys.package_system import package_system
from pypi2pkgsys.pypi_objects import pypilog

for log_path in sys.argv[1:]:
    logobj = pypilog(package_system(), log_path)
    ok, manual, total = logobj.get_stats()
    bad = total - ok - manual
    if total == 0: print '%s: empty.'
    else:        print '%s: %d(%5.2f%%) ok, %d(%5.2f%%) manual, %d(%5.2f%%) bad.' % \
          (log_path, ok, ok * 100.0 / total,
           manual, manual * 100.0 / total,
           bad, bad * 100.0 / total)
    del (logobj)
Exemplo n.º 3
0
#!/usr/bin/python
# Copyright (C) 2008, Charles Wang <*****@*****.**>
# Author: Charles Wang <*****@*****.**>
# License: BSD

import os.path
import shutil
import sys
from pkg_resources import Distribution
from pypi2pkgsys.package_system import package_system
from pypi2pkgsys.pypi_objects import pypicache

if len(sys.argv) < 4:
    print "Usage: %s CACHE_ROOT CACHE_URL FILENAME,DISTNAME ..." % sys.argv[0]
    sys.exit(-1)

cacheroot = sys.argv[1]
cacheurl = sys.argv[2]
downloads = os.path.join(cacheroot, "downloads")
distlist = []
for arg in sys.argv[3:]:
    filename, distname = arg.split(",")
    dlfname = os.path.join(downloads, os.path.basename(filename))
    print "Copy %s %s ..." % (filename, dlfname)
    shutil.copyfile(filename, dlfname)
    dist = Distribution(dlfname, None, project_name=distname)
    distlist.append(dist)
cache = pypicache(package_system(), cacheroot, cacheurl)
cache.add_packages(distlist)
del (cache)