From fe0af7003bbb783814c50f317d35aadc45c82fc6 Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Tue, 21 Jan 2020 13:05:55 +0100 Subject: PEP8 --- obsapi/core.py | 62 ++++++++++++++++++++++++++++---------------------------- test/test_api.py | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/obsapi/core.py b/obsapi/core.py index 443e593..c154674 100644 --- a/obsapi/core.py +++ b/obsapi/core.py @@ -16,7 +16,7 @@ Binary = namedtuple('Binary', 'filename size mtime') User = namedtuple('User', 'userid role') Group = namedtuple('Group', 'groupid role') -REGEX_NS = "http://exslt.org/regular-expressions" +REGEX_NS = 'http://exslt.org/regular-expressions' DEFAULTAPIURL = 'https://api.opensuse.org' emptyxml = '' @@ -25,36 +25,36 @@ EMPTY = EMPTYTREE.xpath('.')[0] class FileInfo(object): - file_str_template = ("{filename}" - "size : {size}" - "mtime : {mtime}" + file_str_template = ('{filename}' + 'size : {size}' + 'mtime : {mtime}' ) - pkg_str_template = ("{filename}" - "Name : {name}" - "Version : {version}" - "Release : {release}" - "Architecture: {arch}" - "Size : {size}" - "Source RPM : {source}" - "Build Date : {mtime}" - "Summary : {summary}" - "Description :" - "{description}" - "Provides :" - "{provides}" + pkg_str_template = ('{filename}' + 'Name : {name}' + 'Version : {version}' + 'Release : {release}' + 'Architecture: {arch}' + 'Size : {size}' + 'Source RPM : {source}' + 'Build Date : {mtime}' + 'Summary : {summary}' + 'Description :' + '{description}' + 'Provides :' + '{provides}' ) - src_str_template = ("{filename}" - "Name : {name}" - "Version : {version}" - "Release : {release}" - "Architecture: {arch}" - "Size : {size}" - "Build Date : {mtime}" - "Summary : {summary}" - "Description :" - "{description}" + src_str_template = ('{filename}' + 'Name : {name}' + 'Version : {version}' + 'Release : {release}' + 'Architecture: {arch}' + 'Size : {size}' + 'Build Date : {mtime}' + 'Summary : {summary}' + 'Description :' + '{description}' ) def __init__(self, xml): @@ -275,9 +275,9 @@ class ObsApi(object): return nothing_provides def get_vendor(self, prj, repo=None): - ''' Attempt to get the value of the %vendor macro if exists + """ Attempt to get the value of the %vendor macro if exists Search build configs from all repos. Take first occurance. - ''' + """ if repo is not None: repos = [repo] else: @@ -324,8 +324,8 @@ class ObsApi(object): if not self.locked(prj, pkg): return - comment = comment or "Unlock" - self.source.post(prj, pkg, cmd="unlock", comment="Unlock") + comment = comment or 'Unlock' + self.source.post(prj, pkg, cmd='unlock', comment='Unlock') def get_users(self, prj, pkg=None, role=None): xml = self.get_meta(prj, pkg) diff --git a/test/test_api.py b/test/test_api.py index 45ad05b..8a81e7c 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -12,7 +12,7 @@ arch = 'x86_64' def test_get_package_meta(): try: response = etree.fromstring(api.get_meta(prj=prj, pkg=pkg)) - except: + except Exception: response = {} assert response.get('name', None) == 'suse-hello-1.0' -- cgit v1.2.3