From 116ecc72eecb24fa4679ab226796ce893bce3f50 Mon Sep 17 00:00:00 2001 From: Pavol Babincak Date: Aug 11 2014 16:02:30 +0000 Subject: refactor: PEP 8 compliance of __init__.py --- diff --git a/src/fedpkg/__init__.py b/src/fedpkg/__init__.py index 0d31491..9f2ce49 100644 --- a/src/fedpkg/__init__.py +++ b/src/fedpkg/__init__.py @@ -18,7 +18,6 @@ import pycurl import fedora_cert import platform - # This check (decorator) can go away after a few months def _check_newstyle_branches(func): """Check to see if the branches are "newstyle" or not. @@ -58,7 +57,6 @@ def _check_newstyle_branches(func): return func(self, *args, **kwargs) return(checky) - class Commands(pyrpkg.Commands): def __init__(self, path, lookaside, lookasidehash, lookaside_cgi, @@ -70,9 +68,9 @@ class Commands(pyrpkg.Commands): # We are subclassing to set kojiconfig to none, so that we can # make it a property to potentially use a secondary config super(Commands, self).__init__(path, lookaside, lookasidehash, - lookaside_cgi, gitbaseurl, anongiturl, - branchre, kojiconfig, build_client, - user, dist, target, quiet) + lookaside_cgi, gitbaseurl, anongiturl, + branchre, kojiconfig, build_client, user, + dist, target, quiet) # New data self.secondary_arch = { @@ -323,7 +321,7 @@ class Commands(pyrpkg.Commands): # We may not have Fedoras. Find out what rawhide target does. try: rawhidetarget = self.anon_kojisession.getBuildTarget( - 'rawhide') + 'rawhide') except: # We couldn't hit koji, bail. raise pyrpkg.rpkgError('Unable to query koji to find rawhide \ @@ -337,21 +335,21 @@ class Commands(pyrpkg.Commands): """ try: - mydist = platform.linux_distribution() + mydist = platform.linux_distribution() except: - # This is marked as eventually being deprecated. - try: - mydist = platform.dist() - except: - runtime_os = 'unknown' - runtime_version = '0' + # This is marked as eventually being deprecated. + try: + mydist = platform.dist() + except: + runtime_os = 'unknown' + runtime_version = '0' if mydist: - runtime_os = mydist[0] - runtime_version = mydist[1] + runtime_os = mydist[0] + runtime_version = mydist[1] else: - runtime_os = 'unknown' - runtime_version = '0' + runtime_os = 'unknown' + runtime_version = '0' if runtime_os in ['redhat', 'centos']: return 'el%s' % runtime_version @@ -368,6 +366,8 @@ class Commands(pyrpkg.Commands): Runs the commands and returns nothing """ + + cmd = ['git'] if self.quiet: cmd.append('--quiet') @@ -383,6 +383,7 @@ class Commands(pyrpkg.Commands): self.commit(message=message) + def update(self, template='bodhi.template', bugs=[]): """Submit an update to bodhi using the provided template."""