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 541eb71188
commit 76c4090f92
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 Helper for launching shell commands inside tasks
""" """
import sys
import subprocess import subprocess
import select 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 mask = select.EPOLLIN | select.EPOLLHUP | select.EPOLLERR
@ -71,8 +71,8 @@ def layman_sync(logger, cache=True):
from layman import Layman from layman import Layman
import shutil import shutil
l = Layman(stderr=sys.__stderr__, stdin=sys.__stdin__, stdout=sys.__stdout__, l = Layman(stderr=sys.__stderr__, stdin=sys.__stdin__,
config=settings.LAYMAN_CONFIG, root="/") stdout=sys.__stdout__, config=settings.LAYMAN_CONFIG, root="/")
installed_overlays = l.get_installed() installed_overlays = l.get_installed()

View File

@ -282,7 +282,9 @@ class ScanPortage(object):
.filter(version_count=0) .filter(version_count=0)
) )
packages = ( 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: for package in packages:
@ -343,7 +345,8 @@ class ScanPortage(object):
self.logger.info('Prefetching current objects...') self.logger.info('Prefetching current objects...')
ppackages = Package.objects.all() 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: if category:
ppackages = ppackages.filter(category=category) ppackages = ppackages.filter(category=category)
@ -360,6 +363,7 @@ class ScanPortage(object):
self.logger.info('done') self.logger.info('done')
def populate_categories(logger): def populate_categories(logger):
# Populate Category and Overlay # Populate Category and Overlay
# TODO: - use portage.settings.categories() # TODO: - use portage.settings.categories()
@ -369,6 +373,7 @@ def populate_categories(logger):
if created: if created:
logger.info("+ [c] %s", cat["category"]) logger.info("+ [c] %s", cat["category"])
def populate_overlays(logger): def populate_overlays(logger):
# TODO: - get informations from layman and portage (path, url) # TODO: - get informations from layman and portage (path, url)
for overlay in Version.objects.values('overlay').distinct(): 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) results.append(package)
prefetch_packages = results prefetch_packages = results
scan_handler.prefetch(prefetch_packages, category) scan_handler.prefetch(prefetch_packages, category)
if not packages and category: if not packages and category: