Skip to content

Commit

Permalink
flake8 fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kwpolska <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 23, 2013
1 parent 6497405 commit 3b8912c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
7 changes: 4 additions & 3 deletions pkgbuilder/build.py
Expand Up @@ -187,8 +187,9 @@ def rsync(pkg, quiet=False):
'--include=/{}/{}'.format(pkg['Category'],
pkg['Name']),
'--exclude=/{}/*'.format(pkg['Category']),
'--exclude=/*', 'rsync.archlinux.org::abs/{}/'.format(
pkg['Arch']), '.'))
'--exclude=/*',
'rsync.archlinux.org::abs/{}/'.format(pkg['Arch']),
'.'))


def extract(filename):
Expand Down Expand Up @@ -262,7 +263,7 @@ def fetch_runner(pkgnames):
abspkgs = []
aurpkgs = []
try:
print( ':: ' + _('Fetching package information...'))
print(':: ' + _('Fetching package information...'))
for pkgname in pkgnames:
pkg = None
try:
Expand Down
6 changes: 6 additions & 0 deletions pkgbuilder/exceptions.py
Expand Up @@ -42,10 +42,12 @@ def __init__(self, msg, *args, **kwargs):
self.msg = msg
self.args = args
self.kwargs = kwargs

def __str__(self):
"""Just so the user knows that it’s an AUR error."""
return '[AUR] ' + self.msg


class MakepkgError(PBException):
"""makepkg errors (return codes)"""
def __init__(self, retcode, *args, **kwargs):
Expand All @@ -59,6 +61,7 @@ def __str__(self):
"""“1” isn’t too helpful for the human."""
return _('makepkg returned {0}.').format(self.retcode)


class NetworkError(PBException):
"""Network-related errors."""
def __init__(self, msg, source, *args, **kwargs):
Expand All @@ -74,6 +77,7 @@ def __str__(self):
"""The msg, wherever it may come from, isn’t helpful either."""
return _('Network error: {0} (via {1})').format(self.msg, self.source)


class PackageError(PBException):
"""Package-related errors."""
def __init__(self, msg, source, *args, **kwargs):
Expand All @@ -89,6 +93,7 @@ def __str__(self):
"""Would be helpful, but not enough."""
return _('{0} (Package: {1})').format(self.msg, self.source)


class PackageNotFoundError(PackageError):
def __init__(self, name, *args, **kwargs):
"""Throw an error to the log and take the arguments."""
Expand All @@ -101,6 +106,7 @@ def __str__(self):
"""This would be far, FAR away from being informative."""
return _('Package {0} not found.').format(self.name)


class SanityError(PBException):
"""Sometimes PKGBUILDer or one of its friends can go insane."""
def __init__(self, msg, *args, **kwargs):
Expand Down
5 changes: 3 additions & 2 deletions pkgbuilder/main.py
Expand Up @@ -47,8 +47,9 @@ def main(source='AUTO', quit=True):
nargs='*', help=_('AUR/ABS packages to build'))

argopr = parser.add_argument_group(_('operations'))
argopr.add_argument('-F', '--fetch', action='store_true', default=False,
dest='fetch', help=_('fetch package files'))
argopr.add_argument('-F', '--fetch', action='store_true',
default=False, dest='fetch',
help=_('fetch package files'))
argopr.add_argument('-i', '--info', action='store_true', default=False,
dest='info', help=_('view package information'))
argopr.add_argument('-s', '--search', action='store_true',
Expand Down
8 changes: 4 additions & 4 deletions pkgbuilder/upgrade.py
Expand Up @@ -173,10 +173,10 @@ def auto_upgrade(downgrade=False, vcsup=False):
'first:'))
DS.fancy_msg2(pkgbname)
query = (DS.colors['green'] + '==>' + DS.colors['all_off'] +
DS.colors['bold'] + ' ' +
_('Do you want to cancel the current operation and '
'upgrade these packages now? [Y/n] ') +
DS.colors['all_off'])
DS.colors['bold'] + ' ' +
_('Do you want to cancel the current operation and '
'upgrade these packages now? [Y/n] ') +
DS.colors['all_off'])

yesno = input(query)

Expand Down

0 comments on commit 3b8912c

Please sign in to comment.