diff options
author | 2013-01-07 20:38:32 +0100 | |
---|---|---|
committer | 2013-01-07 21:41:50 +0100 | |
commit | 76c4090f928030e3df99145d0372ca67daa6ad70 (patch) | |
tree | d673e115108bbdfb7f4d751ccc391ffc79adb22d | |
parent | Merge branch 'master' of https://github.com/iksaif/euscan (diff) | |
download | euscan-76c4090f928030e3df99145d0372ca67daa6ad70.tar.gz euscan-76c4090f928030e3df99145d0372ca67daa6ad70.tar.bz2 euscan-76c4090f928030e3df99145d0372ca67daa6ad70.zip |
euscanwww: PEP8 fixes
Signed-off-by: volpino <fox91@anche.no>
-rw-r--r-- | euscanwww/djeuscan/processing/misc/update_portage_trees.py | 8 | ||||
-rw-r--r-- | euscanwww/djeuscan/processing/scan/scan_portage.py | 14 | ||||
-rw-r--r-- | euscanwww/djeuscan/processing/scan/scan_upstream.py | 4 |
3 files changed, 15 insertions, 11 deletions
diff --git a/euscanwww/djeuscan/processing/misc/update_portage_trees.py b/euscanwww/djeuscan/processing/misc/update_portage_trees.py index f847eef..55281a2 100644 --- a/euscanwww/djeuscan/processing/misc/update_portage_trees.py +++ b/euscanwww/djeuscan/processing/misc/update_portage_trees.py @@ -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() diff --git a/euscanwww/djeuscan/processing/scan/scan_portage.py b/euscanwww/djeuscan/processing/scan/scan_portage.py index 79aba67..24542b0 100644 --- a/euscanwww/djeuscan/processing/scan/scan_portage.py +++ b/euscanwww/djeuscan/processing/scan/scan_portage.py @@ -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: @@ -312,7 +314,7 @@ class ScanPortage(object): self.logger.info('- [v] %s' % (version)) if version.packaged == False: - continue # Not our job + continue # Not our job # Fix last_version_ stuff that is sometime broken self.version_hack(version) @@ -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: diff --git a/euscanwww/djeuscan/processing/scan/scan_upstream.py b/euscanwww/djeuscan/processing/scan/scan_upstream.py index da384e5..cd46603 100644 --- a/euscanwww/djeuscan/processing/scan/scan_upstream.py +++ b/euscanwww/djeuscan/processing/scan/scan_upstream.py @@ -91,7 +91,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} ) @@ -130,7 +130,7 @@ class ScanUpstream(object): versions = self._versions.difference(self._versions_seen) for version in versions: if version.packaged == True: - continue # Not our job + continue # Not our job VersionLog.objects.create( package=version.package, action=VersionLog.VERSION_REMOVED, |