Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/subscriptions/bin/updateSubscriptionDownloads.py

Issue 29345242: Noissue - Adapt quotes for compliance with our coding style in sitescripts (Closed)
Patch Set: Fixed raw string Created May 30, 2016, 8:47 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/subscriptions/bin/updateSubscriptionDownloads.py
===================================================================
--- a/sitescripts/subscriptions/bin/updateSubscriptionDownloads.py
+++ b/sitescripts/subscriptions/bin/updateSubscriptionDownloads.py
@@ -25,36 +25,36 @@
class MercurialSource:
- _prefix = "./"
+ _prefix = './'
def __init__(self, repo):
- command = ["hg", "-R", repo, "archive", "-r", "default",
- "-t", "uzip", "-p", ".", "-"]
+ command = ['hg', '-R', repo, 'archive', '-r', 'default',
+ '-t', 'uzip', '-p', '.', '-']
data = subprocess.check_output(command)
- self._archive = zipfile.ZipFile(StringIO(data), mode="r")
+ self._archive = zipfile.ZipFile(StringIO(data), mode='r')
def close(self):
self._archive.close()
def read_file(self, filename):
- return self._archive.read(self._prefix + filename).decode("utf-8")
+ return self._archive.read(self._prefix + filename).decode('utf-8')
def list_top_level_files(self):
for filename in self._archive.namelist():
filename = filename[len(self._prefix):]
- if "/" not in filename:
+ if '/' not in filename:
yield filename
-if __name__ == "__main__":
+if __name__ == '__main__':
setupStderr()
source_repos = {}
- for option, value in get_config().items("subscriptionDownloads"):
- if option.endswith("_repository"):
- source_repos[re.sub(r"_repository$", "", option)] = MercurialSource(value)
+ for option, value in get_config().items('subscriptionDownloads'):
+ if option.endswith('_repository'):
+ source_repos[re.sub(r'_repository$', '', option)] = MercurialSource(value)
- basedir = get_config().get("subscriptionDownloads", "outdir")
- destination = os.path.join(basedir, "data")
+ basedir = get_config().get('subscriptionDownloads', 'outdir')
+ destination = os.path.join(basedir, 'data')
try:
combine_subscriptions(source_repos, destination, tempdir=basedir)
finally:

Powered by Google App Engine
This is Rietveld