Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7672)

Unified Diff: chrome/browser/resources/chromeos/chromevox/tools/upload_chromevox_to_webstore.py

Issue 515723005: Make a few fixes to the ChromeVox webstore upload script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/tools/chromevox_webstore_util.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/tools/upload_chromevox_to_webstore.py
diff --git a/chrome/browser/resources/chromeos/chromevox/tools/upload_chromevox_to_webstore.py b/chrome/browser/resources/chromeos/chromevox/tools/upload_chromevox_to_webstore.py
index 3b91110ad759030bffc905c886f32597ecbc63c8..d5699fbf181261355e1021d9b8a5e26e420b5252 100755
--- a/chrome/browser/resources/chromeos/chromevox/tools/upload_chromevox_to_webstore.py
+++ b/chrome/browser/resources/chromeos/chromevox/tools/upload_chromevox_to_webstore.py
@@ -32,7 +32,7 @@ def CreateOptionParser():
parser.usage = '%prog <extension_path> <output_path> <client_secret'
return parser
-def MakeManifestEdits(root, old):
+def MakeManifestEdits(root, old, new_file):
'''Customize a manifest for the webstore.
Args:
@@ -40,16 +40,16 @@ def MakeManifestEdits(root, old):
old: A json file.
+ new_file: a temporary file to place the manifest in.
+
Returns:
File of the new manifest.
'''
- new_file = tempfile.NamedTemporaryFile()
- new = new_file.name
with open(os.path.join(root, old)) as old_file:
new_contents = json.loads(old_file.read())
new_contents.pop('key', '')
- new_file.write(json.dumps(new_contents))
- return new_file
+ new_file.file.write(json.dumps(new_contents))
+ new_file.file.flush()
dmazzoni 2014/08/28 23:13:01 As an alternative to calling flush, pass bufsize =
David Tseng 2014/08/29 21:12:49 Done.
def RunInteractivePrompt(client_secret, output_path):
input = ''
@@ -62,13 +62,18 @@ def RunInteractivePrompt(client_secret, output_path):
input = raw_input('Please select an option: ')
input = input.strip()
if input == 'g':
- chromevox_webstore_util.GetUploadStatus(client_secret)
+ print ('Upload status: %s' %
+ chromevox_webstore_util.GetUploadStatus(client_secret).read())
elif input == 'u':
- chromevox_webstore_util.PostUpload(output_path, client_secret)
+ print ('Uploaded with status: %s' %
+ chromevox_webstore_util.PostUpload(output_path, client_secret))
elif input == 't':
- chromevox_webstore_util.PostPublishTrustedTesters(client_secret)
+ print ('Published to trusted testers with status: %s' %
+ chromevox_webstore_util.PostPublishTrustedTesters(
+ client_secret).read())
elif input == 'p':
- chromevox_webstore_util.PostPublish(client_secret)
+ print ('Published to public with status: %s' %
+ chromevox_webstore_util.PostPublish(client_secret).read())
elif input == 'q':
sys.exit()
else:
@@ -92,14 +97,17 @@ def main():
if extension_file in EXCLUDE_FILES:
continue
if extension_file == 'manifest.json':
- new_file = MakeManifestEdits(root, extension_file)
+ new_file = tempfile.NamedTemporaryFile(mode='w+a')
+ MakeManifestEdits(root, extension_file, new_file)
zip.write(
new_file.name, os.path.join(rel_path, extension_file))
continue
zip.write(os.path.join(root, extension_file),
os.path.join(rel_path, extension_file))
- RunInteractivePrompt(client_secret, output_path)
+ print 'Created ChromeVox zip file in %s' % output_path
+ print 'Please run manual smoke tests before proceeding.'
+ RunInteractivePrompt(client_secret, output_path)
if __name__ == '__main__':
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/tools/chromevox_webstore_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698