Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/sugar/shell.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-26 11:25:03 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-26 11:25:03 (GMT)
commitd23a83060ddad0b6da5504d8cb5d524891ad9631 (patch)
treebe881c67835922bc9d1c23276047b2f0241679c1 /tests/sugar/shell.py
parentbc6035454c6138d0974173900e50e33793b2e5d0 (diff)
pep8ize
Diffstat (limited to 'tests/sugar/shell.py')
-rw-r--r--tests/sugar/shell.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/sugar/shell.py b/tests/sugar/shell.py
index 14a0709..ef2e4af 100644
--- a/tests/sugar/shell.py
+++ b/tests/sugar/shell.py
@@ -5,6 +5,7 @@ import tree
ACTIVITIES_WITH_OBJECT_CHOOSER = ["Read", "Jukebox"]
+
def build_activities_list():
root = tree.get_root()
shell = root.find_child(name="sugar-session", role_name="application")
@@ -14,7 +15,7 @@ def build_activities_list():
table = shell.find_child(role_name="table")
cells = table.find_children(role_name="table cell")
- for row in [cells[i:i+5] for i in range(0, len(cells), 5)]:
+ for row in [cells[i:i + 5] for i in range(0, len(cells), 5)]:
activity_name = row[2].text
activities.append(activity_name)
@@ -22,8 +23,9 @@ def build_activities_list():
return activities
+
def launch_and_stop_activity(activity_name):
- print "Launching %s" % activity_name
+ print "Launching %s" % activity_name
root = tree.get_root()
shell = root.find_child(name="sugar-session", role_name="application")
@@ -31,14 +33,14 @@ def launch_and_stop_activity(activity_name):
table = shell.find_child(role_name="table")
cells = table.find_children(role_name="table cell")
- for row in [cells[i:i+5] for i in range(0, len(cells), 5)]:
+ for row in [cells[i:i + 5] for i in range(0, len(cells), 5)]:
name = row[2].name
icon = row[1]
if name == activity_name:
icon.click()
- print "Stopping %s" % activity_name
+ print "Stopping %s" % activity_name
if activity_name in ACTIVITIES_WITH_OBJECT_CHOOSER:
close_button = shell.find_child(name="Close",
@@ -58,6 +60,7 @@ def launch_and_stop_activity(activity_name):
if activity is not None:
raise RuntimeError
+
def go_to_list_view():
root = tree.get_root()
shell = root.find_child(name="sugar-session", role_name="application")
@@ -68,6 +71,7 @@ def go_to_list_view():
radio_button = shell.find_child(name="List view", role_name="radio button")
radio_button.do_action("click")
+
def main():
go_to_list_view()