Skip to content

Commit

Permalink
Various style fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <[email protected]>
  • Loading branch information
Kwpolska committed Dec 4, 2016
1 parent 2e007b4 commit c9ab9c9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions localeprovider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# A module only for gettext locale provision.
translationcheat = _('usage') +
_('positional arguments') +
_('optional arguments') +
_('show this help message and exit')
translationcheat = (_('usage') +
_('positional arguments') +
_('optional arguments') +
_('show this help message and exit'))
2 changes: 1 addition & 1 deletion pkgbuilder/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def fetch_runner(pkgnames, preprocessed=False):
if rc > 0:
raise pkgbuilder.exceptions.NetworkError(
_('Failed to retieve {0} (from ABS/rsync).').format(
pkg.name), pkg=pkg, retcode=rc)
pkg.name), source='rsync', pkg=pkg, retcode=rc)

if aurpkgs:
print(_(':: Retrieving packages from aur...'))
Expand Down
4 changes: 2 additions & 2 deletions pkgbuilder/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def __init__(self, msg, source, exit=True, *args, **kwargs):
self.msg = msg
try:
self.source = source.args[0].reason
except:
except Exception:
try:
self.source = source.args[0]
except:
except Exception:
self.source = source
self._source = source
self.exit = exit
Expand Down
5 changes: 1 addition & 4 deletions pkgbuilder/pbds.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ class PBDS(object):
else:
paccommand = os.getenv('PACMAN')

if os.path.exists('/usr/bin/sudo'):
hassudo = True
else:
hassudo = False
hassudo = os.path.exists('/usr/bin/sudo')

uid = os.geteuid()

Expand Down
6 changes: 3 additions & 3 deletions pkgbuilder/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ def wrapper(source='AUTO'):
if k in allcountable:
# == This is a countable argument.
if k in allshortc:
for x in range(v):
for _i in range(v):
execargs.append('-' + k)
elif k in alllongc:
for x in range(v):
for _i in range(v):
execargs.append('--' + k)
elif v:
# == This argument doesn't have a value.
Expand All @@ -223,7 +223,7 @@ def wrapper(source='AUTO'):
elif i[2:] in alllong + alllongc:
s = i[2:]
else:
raise SanityError('argparse broke')
raise SanityError('argparse broke', 'argparse')

if s in allcommon:
pacargs.append(i)
Expand Down

0 comments on commit c9ab9c9

Please sign in to comment.