From 5361c9d8a4fa9abaab6e1ae0146e65a7af990d7e Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 15 Sep 2012 10:21:43 +0100 Subject: [PATCH] Fixed pyflakes/pylint warnings --- 0release | 2 +- compile.py | 3 +-- release.py | 17 ++++++++--------- scm.py | 2 +- setup.py | 3 +-- support.py | 2 -- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/0release b/0release index e1513f0..e223e9f 100755 --- a/0release +++ b/0release @@ -11,7 +11,7 @@ if zi is not None: # (and we want our setup.py, not 0install's) sys.path.insert(1, zi) from zeroinstall import SafeException -from zeroinstall.injector import reader, model, qdom +from zeroinstall.injector import qdom version = '0.13' diff --git a/compile.py b/compile.py index b937b59..e3ca162 100644 --- a/compile.py +++ b/compile.py @@ -1,10 +1,9 @@ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. -import tempfile, shutil, subprocess, os +import tempfile, shutil, os import ConfigParser from logging import info -from zeroinstall.injector import model from zeroinstall.support import basedir import support diff --git a/release.py b/release.py index 4aaad6b..9235457 100644 --- a/release.py +++ b/release.py @@ -1,9 +1,9 @@ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. -import os, sys, subprocess, shutil, tempfile +import os, subprocess, shutil from zeroinstall import SafeException -from zeroinstall.injector import reader, model, qdom +from zeroinstall.injector import model from zeroinstall.support import ro_rmtree from logging import info, warn @@ -268,7 +268,7 @@ def do_release(local_feed, options): finally: changelog.close() - def fail_candidate(archive_file): + def fail_candidate(): cwd = os.getcwd() assert cwd.endswith(status.release_version) support.backup_if_exists(cwd) @@ -276,7 +276,7 @@ def do_release(local_feed, options): os.unlink(support.release_status_file) print "Restored to state before starting release. Make your fixes and try again..." - def accept_and_publish(archive_file, archive_name, src_feed_name): + def accept_and_publish(archive_file, src_feed_name): assert options.master_feed_file if not options.archive_dir_public_url: @@ -428,7 +428,7 @@ def do_release(local_feed, options): support.check_call(['tar', 'cjf', archive_file, archive_name]) except SafeException: scm.reset_hard(scm.get_current_branch()) - fail_candidate(archive_file) + fail_candidate() raise status.created_archive = 'true' @@ -474,14 +474,13 @@ def do_release(local_feed, options): status.save() except SafeException: print "(leaving extracted directory for examination)" - fail_candidate(archive_file) + fail_candidate() raise # Unpack it again in case the unit-tests changed anything ro_rmtree(archive_name) support.unpack_tarball(archive_file) # Generate feed for source - stream = open(extracted_feed_path) src_feed_name = '%s.xml' % archive_name create_feed(src_feed_name, extracted_feed_path, archive_file, archive_name, main) print "Wrote source feed as %s" % src_feed_name @@ -538,7 +537,7 @@ def do_release(local_feed, options): shutil.rmtree(archive_name) if choice == 'Publish': - accept_and_publish(archive_file, archive_name, src_feed_name) + accept_and_publish(archive_file, src_feed_name) else: assert choice == 'Fail' - fail_candidate(archive_file) + fail_candidate() diff --git a/scm.py b/scm.py index 1a8e96d..0532f22 100644 --- a/scm.py +++ b/scm.py @@ -150,7 +150,7 @@ class GIT(SCM): child.wait() if child.returncode in [0, 1]: return - warn("git grep returned exit code %d", proc.returncode) + warn("git grep returned exit code %d", child.returncode) def has_submodules(self): return os.path.isfile(os.path.join(self.root_dir, '.gitmodules')) diff --git a/setup.py b/setup.py index 6b8f4a0..17a3dea 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,8 @@ # Copyright (C) 2007, Thomas Leonard # See the README file for details, or visit http://0install.net. -import os, sys +import os from zeroinstall import SafeException -from zeroinstall.injector import reader, model release_uri = 'http://0install.net/2007/interfaces/0release.xml' diff --git a/support.py b/support.py index 9445426..953e042 100644 --- a/support.py +++ b/support.py @@ -58,8 +58,6 @@ def publish(feed_path, **kwargs): check_call(args) def get_singleton_impl(feed): - if isinstance(feed, model.Interface): - feed = feed._main_feed impls = feed.implementations if len(impls) != 1: raise SafeException("Local feed '%s' contains %d versions! I need exactly one!" % (feed.url, len(impls))) -- 2.11.4.GIT