euscanwww: PEP8 fixes

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2013-01-07 20:38:32 +01:00
parent f26add40c9
commit b41ffe3609
3 changed files with 15 additions and 11 deletions

View File

@ -8,11 +8,11 @@ def _launch_command(cmd, env=None, logger=None):
"""
Helper for launching shell commands inside tasks
"""
import sys
import subprocess
import select
fp = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
fp = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
mask = select.EPOLLIN | select.EPOLLHUP | select.EPOLLERR
@ -71,8 +71,8 @@ def layman_sync(logger, cache=True):
from layman import Layman
import shutil
l = Layman(stderr=sys.__stderr__, stdin=sys.__stdin__, stdout=sys.__stdout__,
config=settings.LAYMAN_CONFIG, root="/")
l = Layman(stderr=sys.__stderr__, stdin=sys.__stdin__,
stdout=sys.__stdout__, config=settings.LAYMAN_CONFIG, root="/")
installed_overlays = l.get_installed()

View File

@ -282,7 +282,9 @@ class ScanPortage(object):
.filter(version_count=0)
)
packages = (
Package.objects.filter(id__in=[package['id'] for package in packages])
Package.objects.filter(
id__in=[package['id'] for package in packages]
)
)
for package in packages:
@ -343,13 +345,14 @@ class ScanPortage(object):
self.logger.info('Prefetching current objects...')
ppackages = Package.objects.all()
pversions = Version.objects.filter(packaged=True).select_related('package').all()
pversions = Version.objects.filter(packaged=True)\
.select_related('package').all()
if category:
ppackages = ppackages.filter(category=category)
pversions = pversions.filter(package__category=category)
if packages:
ids = [ package.id for package in packages ]
ids = [package.id for package in packages]
ppackages = ppackages.filter(pk__in=ids)
pversions = pversions.filter(package__pk__in=ids)
@ -360,6 +363,7 @@ class ScanPortage(object):
self.logger.info('done')
def populate_categories(logger):
# Populate Category and Overlay
# TODO: - use portage.settings.categories()
@ -369,6 +373,7 @@ def populate_categories(logger):
if created:
logger.info("+ [c] %s", cat["category"])
def populate_overlays(logger):
# TODO: - get informations from layman and portage (path, url)
for overlay in Version.objects.values('overlay').distinct():
@ -414,7 +419,6 @@ def scan_portage(packages=None, category=None, no_log=False, upstream=False,
results.append(package)
prefetch_packages = results
scan_handler.prefetch(prefetch_packages, category)
if not packages and category:

View File

@ -92,7 +92,7 @@ class ScanUpstream(object):
revision='r0',
version=ver,
overlay='',
defaults={"slot" : '', "urls": url, "packaged": False,
defaults={"slot": '', "urls": url, "packaged": False,
"vtype": version_type, "handler": handler,
"confidence": confidence}
)