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

Unified Diff: tools/push-to-trunk/auto_push.py

Issue 594773003: Refactoring: Remove global configs in release scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove global configs. Created 6 years, 3 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 | « no previous file | tools/push-to-trunk/auto_roll.py » ('j') | tools/push-to-trunk/common_includes.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/auto_push.py
diff --git a/tools/push-to-trunk/auto_push.py b/tools/push-to-trunk/auto_push.py
index 5a061f6635944281b48c3add7b68c4548c996cd1..fef3b5367b4b758ca6153101c963f308d8ed2d3f 100755
--- a/tools/push-to-trunk/auto_push.py
+++ b/tools/push-to-trunk/auto_push.py
@@ -36,16 +36,8 @@ import urllib
from common_includes import *
import push_to_trunk
-SETTINGS_LOCATION = "SETTINGS_LOCATION"
-
-CONFIG = {
- PERSISTFILE_BASENAME: "/tmp/v8-auto-push-tempfile",
- SETTINGS_LOCATION: "~/.auto-roll",
-}
-
PUSH_MESSAGE_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$")
-
class Preparation(Step):
MESSAGE = "Preparation."
@@ -58,7 +50,7 @@ class CheckAutoPushSettings(Step):
MESSAGE = "Checking settings file."
def RunStep(self):
- settings_file = os.path.realpath(self.Config(SETTINGS_LOCATION))
+ settings_file = os.path.realpath(self.Config("SETTINGS_LOCATION"))
if os.path.exists(settings_file):
settings_dict = json.loads(FileToText(settings_file))
if settings_dict.get("enable_auto_roll") is False:
@@ -118,9 +110,8 @@ class PushToTrunk(Step):
# TODO(machenbach): Update the script before calling it.
if self._options.push:
- P = push_to_trunk.PushToTrunk
self._side_effect_handler.Call(
- P(push_to_trunk.CONFIG, self._side_effect_handler).Run,
+ push_to_trunk.PushToTrunk().Run,
["--author", self._options.author,
"--reviewer", self._options.reviewer,
"--revision", self["lkgr"],
@@ -140,6 +131,12 @@ class AutoPush(ScriptsBase):
options.requires_editor = False
return True
+ def _Config(self):
+ return {
+ "PERSISTFILE_BASENAME": "/tmp/v8-auto-push-tempfile",
+ "SETTINGS_LOCATION": "~/.auto-roll",
+ }
+
def _Steps(self):
return [
Preparation,
@@ -152,4 +149,4 @@ class AutoPush(ScriptsBase):
if __name__ == "__main__": # pragma: no cover
- sys.exit(AutoPush(CONFIG).Run())
+ sys.exit(AutoPush().Run())
« no previous file with comments | « no previous file | tools/push-to-trunk/auto_roll.py » ('j') | tools/push-to-trunk/common_includes.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698