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

Unified Diff: chrome/tools/extensions/chromium_extension.py

Issue 99172: Part 1 of sample sprucing. (Closed)
Patch Set: Added buildbot.crx, since that seems like something people might want to install. Created 11 years, 8 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/test/data/extensions/test/TabsAPI/1/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/extensions/chromium_extension.py
diff --git a/chrome/tools/extensions/chromium_extension.py b/chrome/tools/extensions/chromium_extension.py
index 81e466215bfdce8d9b24a900159cd23af515c859..f6ecebc4e4b121e89ecd41337673755e63d84629 100755
--- a/chrome/tools/extensions/chromium_extension.py
+++ b/chrome/tools/extensions/chromium_extension.py
@@ -10,6 +10,7 @@ import hashlib
import logging
import optparse
import os
+import random
import re
import shutil
import sys
@@ -53,10 +54,23 @@ class ExtensionDir:
if not self.validate():
return False
try:
- f = open(os.path.join(self._root, MANIFEST_FILENAME))
+ f = open(os.path.join(self._root, MANIFEST_FILENAME), "r")
manifest = json.load(f)
f.close()
+ # Temporary hack: If the manifest doesn't have an ID, generate a random
+ # one. This is to make it easier for people to play with the extension
+ # system while we don't have the real ID mechanism in place.
+ if not "id" in manifest:
+ random_id = ""
+ for i in range(0, 40):
+ random_id += "0123456789ABCDEF"[random.randrange(0, 15)]
+ logging.info("Generated extension ID: %s" % random_id)
+ manifest["id"] = random_id;
+ f = open(os.path.join(self._root, MANIFEST_FILENAME), "w")
+ f.write(json.dumps(manifest, sort_keys=True, indent=2));
+ f.close();
+
zip_path = path + ".zip"
if os.path.exists(zip_path):
os.remove(zip_path)
« no previous file with comments | « chrome/test/data/extensions/test/TabsAPI/1/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698