euscanwww: Minor fixes
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
parent
379a6d2942
commit
02be58024a
@ -252,7 +252,7 @@ def main():
|
|||||||
if CONFIG['progress']:
|
if CONFIG['progress']:
|
||||||
on_progress_gen = progress_bar()
|
on_progress_gen = progress_bar()
|
||||||
on_progress = on_progress_gen.next()
|
on_progress = on_progress_gen.next()
|
||||||
on_progress(maxval=len(queries) * 100, increment=0)
|
on_progress(maxval=len(queries) * 100, increment=0, label="Working...")
|
||||||
|
|
||||||
for query in queries:
|
for query in queries:
|
||||||
if CONFIG["progress"]:
|
if CONFIG["progress"]:
|
||||||
|
@ -136,7 +136,7 @@ class Version(models.Model):
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return '%s/%s-%s-%s:%s [%s]' % (
|
return '%s/%s-%s-%s:%s [%s]' % (
|
||||||
self.package.category, self.package.name, self.version,
|
self.package.category, self.package.name, self.version,
|
||||||
self.revision, self.slot, self.overlay
|
self.revision, self.slot, self.overlay or "<upstream>"
|
||||||
)
|
)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
@ -169,7 +169,7 @@ class VersionLog(models.Model):
|
|||||||
txt += '%s/%s-%s-%s:%s [%s]' % (
|
txt += '%s/%s-%s-%s:%s [%s]' % (
|
||||||
self.package.category, self.package.name, self.version,
|
self.package.category, self.package.name, self.version,
|
||||||
self.revision, self.slot,
|
self.revision, self.slot,
|
||||||
self.overlay if self.overlay else '<upstream>'
|
self.overlay or '<upstream>'
|
||||||
)
|
)
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
|
@ -30,6 +30,11 @@ class ScanUpstream(object):
|
|||||||
scan_time = out[package]["metadata"]["scan_time"]
|
scan_time = out[package]["metadata"]["scan_time"]
|
||||||
ebuild = out[package]["metadata"]["ebuild"]
|
ebuild = out[package]["metadata"]["ebuild"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
self.logger.error(
|
||||||
|
"Error while scanning upstream for package %s!\n%s",
|
||||||
|
package,
|
||||||
|
out_json
|
||||||
|
)
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
obj = self.store_package(cpv)
|
obj = self.store_package(cpv)
|
||||||
@ -147,9 +152,9 @@ def scan_upstream(packages=None, purge_versions=False,
|
|||||||
packages = Package.objects.all()
|
packages = Package.objects.all()
|
||||||
|
|
||||||
for pkg in packages:
|
for pkg in packages:
|
||||||
if isinstance(pkg, Package):
|
try:
|
||||||
scan_handler.scan('%s/%s' % (pkg.category, pkg.name))
|
scan_handler.scan('%s/%s' % (pkg.category, pkg.name))
|
||||||
else:
|
except AttributeError:
|
||||||
scan_handler.scan(pkg)
|
scan_handler.scan(pkg)
|
||||||
|
|
||||||
scan_handler.purge_old_versions()
|
scan_handler.purge_old_versions()
|
||||||
|
@ -36,7 +36,7 @@ class ProgressHandler(object):
|
|||||||
|
|
||||||
def progress_bar():
|
def progress_bar():
|
||||||
on_progress = None
|
on_progress = None
|
||||||
progress_bar = TermProgressBar()
|
progress_bar = TermProgressBar(title="euscan")
|
||||||
|
|
||||||
progress_handler = ProgressHandler(progress_bar)
|
progress_handler = ProgressHandler(progress_bar)
|
||||||
on_progress = progress_handler.on_progress
|
on_progress = progress_handler.on_progress
|
||||||
|
Loading…
Reference in New Issue
Block a user