on xenial help sign in
[JANK STATE] Add ofono_helper.py
commit5bfbcf6ed351f79d4d16020056a5ac1323ecf64c authorJosh Arenson <joshua.arenson@canonical.com> dateTue 19 May 2015, 11:54 (11 years ago) parentb14aeb03f7c49d
3 files changed+66−43
po/de.po+30−30 tests/autopilot/unity8/settings_wizard/phonesim_manager.py → tests/autopilot/unity8/settings_wizard/ofono_helper.py+33−13 tests/autopilot/unity8/settings_wizard/tests/test_settings_wizard.py+3
po/de.po+30−30
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-06 14:24+0000\n"
12−"Last-Translator: Niklas Wenzel <nikwen.developer@gmail.com>\n"
11+"PO-Revision-Date: 2015-05-14 15:49+0000\n"
12+"Last-Translator: Tobias Bannert <Unknown>\n"
1313"Language-Team: German <de@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-05-15 05:31+0000\n"
19+"X-Generator: Launchpad (build 17493)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -51,13 +51,13 @@ msgstr ""
5151#, qt-format
5252msgid "Please wait %1 minute and then try again…"
5353msgid_plural "Please wait %1 minutes and then try again…"
54−msgstr[0] "Bitte warten Sie %1 Minute und versuchen Sie es dann erneut..."
55−msgstr[1] "Bitte warten Sie %1 Minuten und versuchen Sie es dann erneut..."
54+msgstr[0] "Bitte %1 Minute warten und es dann erneut versuchen …"
55+msgstr[1] "Bitte %1 Minuten warten und es dann erneut versuchen …"
5656
5757#: qml/Components/Dialogs.qml:69
5858msgctxt "Title: Lock/Log out dialog"
5959msgid "Log out"
60−msgstr ""
60+msgstr "Abmelden"
6161
6262#: qml/Components/Dialogs.qml:70
6363msgid "Are you sure you want to log out?"
@@ -66,12 +66,12 @@ msgstr "Sind Sie sicher, dass Sie sich abmelden wollen?"
6666#: qml/Components/Dialogs.qml:72
6767msgctxt "Button: Lock the system"
6868msgid "Lock"
69−msgstr ""
69+msgstr "Sperren"
7070
7171#: qml/Components/Dialogs.qml:79
7272msgctxt "Button: Log out from the system"
7373msgid "Log Out"
74−msgstr ""
74+msgstr "Abmelden"
7575
7676#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
7777#: qml/Components/Dialogs.qml:173
@@ -81,7 +81,7 @@ msgstr "Abbrechen"
8181#: qml/Components/Dialogs.qml:98
8282msgctxt "Title: Reboot/Shut down dialog"
8383msgid "Shut down"
84−msgstr ""
84+msgstr "Ausschalten"
8585
8686#: qml/Components/Dialogs.qml:99
8787msgid "Are you sure you want to shut down?"
@@ -90,17 +90,17 @@ msgstr "Sind Sie sicher, dass Sie herunterfahren wollen?"
9090#: qml/Components/Dialogs.qml:101
9191msgctxt "Button: Reboot the system"
9292msgid "Reboot"
93−msgstr ""
93+msgstr "Neustarten"
9494
9595#: qml/Components/Dialogs.qml:109
9696msgctxt "Button: Shut down the system"
9797msgid "Shut down"
98−msgstr ""
98+msgstr "Ausschalten"
9999
100100#: qml/Components/Dialogs.qml:129
101101msgctxt "Title: Reboot dialog"
102102msgid "Reboot"
103−msgstr ""
103+msgstr "Neustarten"
104104
105105#: qml/Components/Dialogs.qml:130
106106msgid "Are you sure you want to reboot?"
@@ -117,7 +117,7 @@ msgstr "Ja"
117117#: qml/Components/Dialogs.qml:152
118118msgctxt "Title: Power off/Restart dialog"
119119msgid "Power"
120−msgstr ""
120+msgstr "Leistung"
121121
122122#: qml/Components/Dialogs.qml:153
123123msgid ""
@@ -130,12 +130,12 @@ msgstr ""
130130#: qml/Components/Dialogs.qml:155
131131msgctxt "Button: Power off the system"
132132msgid "Power off"
133−msgstr ""
133+msgstr "Ausschalten"
134134
135135#: qml/Components/Dialogs.qml:164
136136msgctxt "Button: Restart the system"
137137msgid "Restart"
138−msgstr ""
138+msgstr "Neustarten"
139139
140140#: qml/Components/Lockscreen.qml:245
141141msgid "Return to Call"
@@ -160,22 +160,22 @@ msgstr "Alle anzeigen"
160160#: qml/Dash/GenericScopeView.qml:594
161161msgctxt "Label: Hint for dash search line edit"
162162msgid "Search"
163−msgstr ""
163+msgstr "Suchen"
164164
165165#: qml/Dash/PageHeader.qml:269
166166msgctxt "Button: Open the Ubuntu Store"
167167msgid "Store"
168−msgstr ""
168+msgstr "Speichern"
169169
170170#: qml/Dash/PageHeader.qml:276
171171msgctxt "Button: Start a search in the current dash scope"
172172msgid "Search"
173−msgstr ""
173+msgstr "Suchen"
174174
175175#: qml/Dash/PageHeader.qml:286
176176msgctxt "Button: Show the current dash scope settings"
177177msgid "Settings"
178−msgstr ""
178+msgstr "Einstellungen"
179179
180180#: qml/Dash/PageHeader.qml:293
181181msgid "Remove from Favorites"
@@ -305,7 +305,7 @@ msgstr "Passwort anzeigen"
305305
306306#: qml/Panel/ActiveCallHint.qml:79
307307msgid "Tap to return to call..."
308−msgstr "Tippen um zum Anruf zurückzugehen"
308+msgstr "Tippen, um zum Anruf zurückzugehen …"
309309
310310#: qml/Panel/ActiveCallHint.qml:92
311311msgid "Conference"
@@ -342,7 +342,7 @@ msgstr "Fehlgeschlagen, tippen Sie zum Wiederholen"
342342#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
343343msgctxt "Label: Hint in message indicator line edit"
344344msgid "Reply"
345−msgstr ""
345+msgstr "Antworten"
346346
347347#: qml/Panel/Indicators/ModemInfoItem.qml:105
348348msgid "Unlock SIM"
@@ -376,7 +376,7 @@ msgstr "Zum Fortfahren hier tippen."
376376
377377#: qml/Tutorial/TutorialContent.qml:81
378378msgid "Click here to finish."
379−msgstr ""
379+msgstr "Zum Abschließen bitte hier klicken."
380380
381381#: qml/Tutorial/TutorialLeftFinish.qml:24
382382msgid "These are the shortcuts to favorite apps"
@@ -413,7 +413,7 @@ msgstr "Sehen Sie alle Ihre laufenden Anwendungen."
413413#: qml/Wizard/Page.qml:89
414414msgctxt "Button: Go back one page in the Wizard"
415415msgid "Back"
416−msgstr ""
416+msgstr "Zurück"
417417
418418#: qml/Wizard/Pages/10-welcome.qml:27
419419msgid "Hi!"
@@ -457,32 +457,32 @@ msgstr "Bitte wählen Sie aus, wie Sie Ihr Telefon entsperren wollen."
457457#: qml/Wizard/Pages/30-passwd-type.qml:97
458458msgctxt "Label: Type of security method"
459459msgid "Swipe"
460−msgstr ""
460+msgstr "Wischen"
461461
462462#: qml/Wizard/Pages/30-passwd-type.qml:98
463463msgctxt "Label: Description of security method"
464464msgid "No security"
465−msgstr ""
465+msgstr "Keine Sicherheitssperre"
466466
467467#: qml/Wizard/Pages/30-passwd-type.qml:100
468468msgctxt "Label: Type of security method"
469469msgid "Passcode"
470−msgstr ""
470+msgstr "PIN"
471471
472472#: qml/Wizard/Pages/30-passwd-type.qml:101
473473msgctxt "Label: Description of security method"
474474msgid "4 digits only"
475−msgstr ""
475+msgstr "nur vier Ziffern"
476476
477477#: qml/Wizard/Pages/30-passwd-type.qml:103
478478msgctxt "Label: Type of security method"
479479msgid "Passphrase"
480−msgstr ""
480+msgstr "Kennwort"
481481
482482#: qml/Wizard/Pages/30-passwd-type.qml:104
483483msgctxt "Label: Description of security method"
484484msgid "Numbers and letters"
485−msgstr ""
485+msgstr "Ziffern und Buchstaben"
486486
487487#: qml/Wizard/Pages/40-wifi.qml:29
488488msgid "Connect to Wi‑Fi"
tests/autopilot/unity8/settings_wizard/phonesim_manager.py → tests/autopilot/unity8/settings_wizard/ofono_helper.pyrenamed+33−13
@@ -3,7 +3,7 @@
33# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
44#
55# Unity Indicators Autopilot Test Suite
6−# Copyright (C) 2014 Canonical
6+# Copyright (C) 2014, 2015 Canonical
77#
88# This program is free software: you can redistribute it and/or modify
99# it under the terms of the GNU General Public License as published by
@@ -26,6 +26,29 @@ import subprocess
2626from time import sleep
2727
2828
29+class OfonoManager(object):
30+
31+ def __init__(self):
32+ self.system_bus = dbus.SystemBus()
33+ self.ofono = self.system_bus.get_object('org.ofono', '/')
34+
35+ self.real_manager = dbus.Interface(
36+ self.ofono,
37+ 'org.ofono.Manager'
38+ )
39+
40+ def _get_sim_manager(self):
41+ modems = self.real_manager.GetModems()
42+ path = modems[0][0]
43+ return dbus.Interface(self.system_bus.get_object('org.ofono', path),
44+ 'org.ofono.SimManager')
45+
46+ def physical_sim_is_present(self):
47+ sim_manager = self._get_sim_manager()
48+ properties = sim_manager.GetProperties()
49+ return properties["Present"] == 1
50+
51+
2952class PhonesimManager(object):
3053
3154 def __init__(self, sims, exe=None):
@@ -37,6 +60,7 @@ class PhonesimManager(object):
3760 self.sim_processes = {}
3861 self.system_bus = dbus.SystemBus()
3962 self.ofono = self.system_bus.get_object('org.ofono', '/')
63+
4064 self.phonesim_manager = dbus.Interface(
4165 self.ofono,
4266 'org.ofono.phonesim.Manager'
@@ -44,11 +68,17 @@ class PhonesimManager(object):
4468
4569 def start_phonesim_processes(self):
4670 for simname, simport, conffile in self.sims:
47− cmd = ['/usr/bin/xvfb-run', '-a', self.phonesim_exe, '-p', str(simport), conffile]
71+ cmd = ['/usr/bin/xvfb-run',
72+ '-a',
73+ self.phonesim_exe,
74+ '-p',
75+ str(simport),
76+ conffile]
77+
4878 p = subprocess.Popen(cmd)
4979 self.sim_processes[simname] = p
5080 # give the processes some time to start
51− sleep(1)
81+ sleep(3)
5282
5383 def shutdown(self):
5484 for p in self.sim_processes.values():
@@ -84,13 +114,3 @@ class PhonesimManager(object):
84114 sim = self.system_bus.get_object('org.ofono', '/'+sim_name)
85115 interface = dbus.Interface(sim, dbus_interface='org.ofono.SimManager')
86116 return str(interface.GetProperties()['PinRequired'])
87−
88−
89−if __name__ == '__main__':
90− sims = [('sim1', 12345, '/usr/share/phonesim/default.xml'),
91− ('sim2', 12346, '/usr/share/phonesim/default.xml')]
92− m = PhonesimManager(sims)
93− m.start_phonesim_processes()
94− import pdb
95− pdb.set_trace()
96− m.shutdown()
tests/autopilot/unity8/settings_wizard/tests/test_settings_wizard.py+3
@@ -7,6 +7,7 @@ from unity8.settings_wizard.phonesim_manager import PhonesimManager
77from unity8.shell import tests
88
99DEFAULT_LANGUAGE = 'English (United States)'
10+DEFAULT_PHONESIM_CONFIG_FILE = '/usr/share/phonesim/default.xml'
1011DEFAULT_SECURITY_METHOD = 'Passcode'
1112
1213import pdb
@@ -28,10 +29,12 @@ class SkipThroughSettingsWizardTestCase(tests.UnityTestCase):
2829 self.phonesim_manager = PhonesimManager(sims)
2930 self.wizard_helper = self.useFixture(
3031 fixture_setup.SettingsWizard(True))
32+ pdb.set_trace()
3133 self.phonesim_manager.start_phonesim_processes()
3234 self.phonesim_manager.remove_all_ofono()
3335 self.phonesim_manager.add_ofono('sim1')
3436 self.phonesim_manager.power_on('sim1')
37+ self.phonesim_manager.power_off('sim1')
3538 pdb.set_trace()
3639 self.unity = self.launch_unity()
3740 self.wizard = self._get_settings_wizard()