Skip to content

Commit ac206c9

Browse files
committed
autopep8 cleanup
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
1 parent f4ab275 commit ac206c9

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

mmdzanata/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class MmdZanataError(Exception):
3636

3737

3838
class NonexistentProjectError(MmdZanataError):
39+
3940
def __init__(self, project, version):
4041
"""
4142
Exception thrown when the user has requested a Zanata project that
@@ -47,7 +48,9 @@ def __init__(self, project, version):
4748
self.version = version
4849
self.message = "The project %s does not exist in Zanata" % project
4950

51+
5052
class UnexpectedHTTPResponse(MmdZanataError):
53+
5154
def __init__(self, status_code, body):
5255
"""
5356
Exception thrown when an unexpected response is received from an HTTP
@@ -159,7 +162,7 @@ def get_module_catalog_from_tags(session, tags, debug=False):
159162
else:
160163
locations = []
161164
locations.append(("%s;%s;summary" % (
162-
mmd.props.name,mmd.props.stream), 1))
165+
mmd.props.name, mmd.props.stream), 1))
163166
catalog.add(mmd.props.summary, locations=locations)
164167

165168
# Process the description
@@ -185,7 +188,7 @@ def get_module_catalog_from_tags(session, tags, debug=False):
185188
mmd.props.name,
186189
mmd.props.stream,
187190
profile.props.name),
188-
3))
191+
3))
189192
catalog.add(profile.props.description, locations=locations)
190193

191194
return catalog
@@ -202,7 +205,7 @@ def get_translated_locales(zanata_rest_url, zanata_project,
202205
if r.status_code == 404:
203206
print("Project '%s:%s' does not exist." % (
204207
zanata_project, zanata_project_version),
205-
file=sys.stderr)
208+
file=sys.stderr)
206209
raise NonexistentProjectError(zanata_project, zanata_project_version)
207210
elif r.status_code != 200:
208211
raise UnexpectedHTTPResponse(r.status_code, r.content)
@@ -294,6 +297,7 @@ def get_modulemd_translations_from_catalog_dict(catalog_dict):
294297

295298
return mmd_translations.values()
296299

300+
297301
def get_modulemd_translations(zanata_rest_url, zanata_project,
298302
os_branch, zanata_translation_file,
299303
debug=False):
@@ -306,9 +310,9 @@ def get_modulemd_translations(zanata_rest_url, zanata_project,
306310
for loc in translated_locales:
307311
# Get the translation data for this locale
308312
pofile_url = zanata_rest_url + \
309-
"/file/translation/%s/%s/%s/po?docId=%s" % (
310-
zanata_project, os_branch, loc,
311-
zanata_translation_file)
313+
"/file/translation/%s/%s/%s/po?docId=%s" % (
314+
zanata_project, os_branch, loc,
315+
zanata_translation_file)
312316
r = requests.get(pofile_url,
313317
headers={"Accept": "application/octet-stream"})
314318
if r.status_code != 200:

mmdzanata/cli.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ def cli(ctx, debug, branch, koji_url, zanata_url, zanata_project,
9191
# `mmdzanata extract` #
9292
##############################################################################
9393

94+
9495
@cli.command()
9596
@click.option('--upload/--no-upload', default=True,
96-
help='Whether to automatically push extracted strings to '
97-
'Zanata')
97+
help='Whether to automatically push extracted strings to '
98+
'Zanata')
9899
@click.pass_context
99100
def extract(ctx, upload):
100101
"""
@@ -112,8 +113,8 @@ def extract(ctx, upload):
112113
with open(potfile, mode="wb") as f:
113114
pofile.write_po(f, catalog, sort_by_file=True)
114115

115-
print ("Wrote extracted strings for %s to %s" % (ctx.obj['branch'],
116-
potfile))
116+
print("Wrote extracted strings for %s to %s" % (ctx.obj['branch'],
117+
potfile))
117118

118119
# Optionally upload the extracted strings directly to Zanata
119120
if upload:
@@ -162,4 +163,4 @@ def generate_metadata(ctx):
162163

163164

164165
if __name__ == "__main__":
165-
cli(obj={})
166+
cli(obj={})

0 commit comments

Comments
 (0)