cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject [6/7] cordova-medic git commit: Fixes some of PEP8 issues
Date Tue, 02 Dec 2014 14:58:08 GMT
Fixes some of PEP8 issues


Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/291ccef6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/291ccef6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/291ccef6

Branch: refs/heads/master
Commit: 291ccef69e3414ab6132fd8ff9c72b48ce2dc8cc
Parents: 4ee3512
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Authored: Tue Dec 2 13:55:10 2014 +0300
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Tue Dec 2 13:55:10 2014 +0300

----------------------------------------------------------------------
 cordova.conf | 45 +++++++++++++++++++++++++++++++++------------
 1 file changed, 33 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/291ccef6/cordova.conf
----------------------------------------------------------------------
diff --git a/cordova.conf b/cordova.conf
index fe42497..3789248 100644
--- a/cordova.conf
+++ b/cordova.conf
@@ -58,26 +58,32 @@ from buildbot.schedulers.basic import SingleBranchScheduler
 from buildbot.schedulers.forcesched import ForceScheduler
 from buildbot.changes.filter import ChangeFilter
 
-force_builders = []
+FORCE_BUILDERS = []
 
 c['schedulers'] = []
 
 for test in CONFIG.json_repos['tests']:
 
     test_platform = test["platform"]
-    test_builders = [str(b) for b in test["builder"]] if type(test["builder"]) == list else
[str(test["builder"])]
+    test_builders = test["builder"]
+    # convert test_builders to list if necessary
+    if type(test_builders) == unicode:
+        test_builders = [test_builders]
+    # and convert list members to strings (instead of unicode)
+    test_builders = [str(b) for b in test_builders]
 
     if CONFIG.has_platform(test_platform):
 
-        force_builders.extend(test_builders)
-
+        FORCE_BUILDERS.extend(test_builders)
         c['schedulers'].append(SingleBranchScheduler(
-                               name=str(test["title"]),
-                               change_filter=ChangeFilter(branch=test["branch"], project=test["categories"]),
-                               treeStableTimer=CONFIG.stabletime,
-                               builderNames=test_builders))
+            name=test["title"],
+            change_filter=ChangeFilter(
+                branch=test["branch"],
+                project=test["categories"]),
+            treeStableTimer=CONFIG.stabletime,
+            builderNames=test_builders))
 
-c['schedulers'].append(ForceScheduler(name="force", builderNames=force_builders))
+c['schedulers'].append(ForceScheduler(name="force", builderNames=FORCE_BUILDERS))
 
 # new build steps
 
@@ -87,10 +93,12 @@ from buildbot.process.factory import BuildFactory
 from buildbot.steps.transfer import FileDownload
 
 class PlatformTestBase(object):
+    """Base class with common build steps for all platforms"""
     def __init__(self, platform=""):
         self.platform = platform
 
     def init_workspace_steps(self):
+        """Returns a list of initial environment setup steps"""
         return [
             ShellCommand(command=["rm", "-rf", "~/.cordova/" + self.platform], workdir='build',
haltOnFailure=False, description='Remove cache'),
             ShellCommand(command=["rm", "-rf", "*"], workdir='build', haltOnFailure=False,
description='Clean workdir'),
@@ -104,6 +112,7 @@ class PlatformTestBase(object):
         ]
 
     def repos_clone_steps(self):
+        """Returns a list of steps for cloning necessary repos"""
         platform = self.platform
         # required by coho tools to correctly resolve repo location
         if platform == "blackberry10":
@@ -116,6 +125,7 @@ class PlatformTestBase(object):
         ]
 
     def cli_steps(self):
+        """Returns a list of steps for CLI setup"""
         return [
             ShellCommand(command=["git", "clone", "-b", CONFIG.branches['CLI'], CONFIG.repos['CLI'],
"cordova-cli"], workdir='build', haltOnFailure=True, description='Clone CLI'),
             ShellCommand(command=["git", "clone", "--depth", "1", "-b", CONFIG.branches['CORDOVA-LIB'],
CONFIG.repos['CORDOVA-LIB'], "cordova-lib"], workdir='build', haltOnFailure=True, description='Clone
cordova-lib'),
@@ -126,6 +136,10 @@ class PlatformTestBase(object):
         ]
 
     def plugman_steps(self):
+        """
+        Returns a list of steps for CLI setup
+        Should not be used in common case, only for common slave tests
+        """
         return [
             ShellCommand(command=["rm", "-rf", "cordova-*"], workdir='build', haltOnFailure=False,
description='Cordova Clean'),
             ShellCommand(command=["git", "clone", CONFIG.repos['PLUGMAN'], "cordova-plugman"],
workdir='build', haltOnFailure=True, description='Get Plugman'),
@@ -134,6 +148,7 @@ class PlatformTestBase(object):
         ]
 
     def prepare_mobilespec_steps(self):
+        """Returns a list of steps for mobilespec app setup"""
         platform = self.platform
         # required by coho tools to correctly resolve repo location
         if platform == "blackberry10":
@@ -149,12 +164,18 @@ class PlatformTestBase(object):
         ]
 
     def deploy_steps(self):
+        """
+        Returns a list of steps for deploying
+        mobilespec application to test device
+        """
         return [ShellCommand(command=["node", "medic/build_" + self.platform + ".js"], workdir='build',
timeout=CONFIG.build_timeout, description='Deploy', name='Deploy')]
 
     def build_platform_step(self):
+        """Returns a list of steps for building mobilespec application"""
         return [ShellCommand(command=["../cordova-cli/bin/cordova", "build", self.platform],
workdir='build/mobilespec', timeout=CONFIG.build_timeout, description='Build', name='Build')]
 
     def get_all_steps(self):
+        """Returns a list of all steps current platform"""
         steps = []
         steps.extend(self.init_workspace_steps())
         steps.extend(self.repos_clone_steps())
@@ -178,13 +199,13 @@ class PlatformTestAndroid(PlatformTestBase):
         super(PlatformTestAndroid, self).__init__('android')
 
 class PlatformTestWP8(PlatformTestBase):
-
     def __init__(self):
         super(PlatformTestWP8, self).__init__('wp8')
 
     def repos_clone_steps(self):
         steps = super(PlatformTestWP8, self).repos_clone_steps()
-        # pach cordova-wp8 template to prevent app to lock the screen. In other case we won't
be able to re-install the app next time.
+        # pach cordova-wp8 template to prevent app to lock the screen.
+        # In other case we won't be able to re-install the app next time.
         steps.extend([ShellCommand(command=["node", "medic\src\utils\patch_wp8_template.js"],
workdir='build', haltOnFailure=True, description='Patch WP8 template')])
         return steps
 
@@ -273,7 +294,7 @@ if CONFIG.has_platform("chrome"):
 factory_cli = BuildFactory()
 factory_cli.addStep(ShellCommand(command=["rm","-rf","cordova-*"],workdir='build',haltOnFailure=False,description='Cordova
Clean'))
 factory_cli.addSteps(PlatformTestBase().cli_steps())
-c['builders'].append(BuilderConfig(name="Tools_CLI",slavenames=["cordova-common-slave"],factory=factory_cli))
+c['builders'].append(BuilderConfig(name="Tools_CLI", slavenames=["cordova-common-slave"],
factory=factory_cli))
 
 # factory_plugman = BuildFactory()
 # factory_plugman.addSteps(PlatformTestBase().plugman_steps())


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message