From d23a83060ddad0b6da5504d8cb5d524891ad9631 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 26 Dec 2012 11:25:03 +0000 Subject: pep8ize --- (limited to 'commands') diff --git a/commands/build b/commands/build index 714e783..0a8b2d4 100755 --- a/commands/build +++ b/commands/build @@ -16,7 +16,7 @@ args = parser.parse_args() common.setup() if not system.check(skip_if_unchanged=True): - sys.exit(1) + sys.exit(1) if args.module: success = build.build_one(args.module) diff --git a/commands/clean b/commands/clean index f45e271..1a68817 100755 --- a/commands/clean +++ b/commands/clean @@ -25,7 +25,7 @@ except OSError: for filename in glob.glob("*.log"): try: - os.unlink(filename) + os.unlink(filename) except OSError: # Files migth not exist pass diff --git a/commands/common.py b/commands/common.py index e9f5293..e92f798 100644 --- a/commands/common.py +++ b/commands/common.py @@ -9,6 +9,7 @@ from devbot import config from devbot import command from devbot import git + def setup(): git.set_root_path(base_dir) diff --git a/commands/run-tests b/commands/run-tests index d09f621..f9ffdcb 100755 --- a/commands/run-tests +++ b/commands/run-tests @@ -12,6 +12,7 @@ from devbot import test common.setup() + def _run_ui_tests(): profile_path = os.path.expanduser("~/.sugar/uitests") shutil.rmtree(profile_path, ignore_errors=True) diff --git a/commands/send-patches b/commands/send-patches index 52f81aa..aa2adac 100755 --- a/commands/send-patches +++ b/commands/send-patches @@ -12,6 +12,7 @@ from devbot import config GIT_CONFIG_SETUP = "sugar-build.send-patches.setup" + def get_git_config(name, is_global=False): args = ["git", "config"] @@ -25,9 +26,11 @@ def get_git_config(name, is_global=False): except subprocess.CalledProcessError: return None + def set_git_config(name, value): return subprocess.check_output(["git", "config", name, value]) + def unset_git_config(name): try: subprocess.check_output(["git", "config", "--unset", name]) @@ -35,6 +38,7 @@ def unset_git_config(name): except subprocess.CalledProcessError: return False + def get_from(): name = get_git_config("user.name", is_global=True) email = get_git_config("user.email", is_global=True) @@ -47,11 +51,13 @@ def get_from(): return "%s <%s>" % (name, email) + def get_module(): for line in open("configure.ac"): m = re.match("AC_INIT\((.+)\)", line) if m: - return m.group(1).split(",")[-1][1:-1] + return m.group(1).split(",")[-1][1:-1] + def setup(): print "Choose how to send email \n\n" \ -- cgit v0.9.1