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()) |