Group imports by category (system, efl, others)
Sort imports alphabetically Remove duplicate imports (import os / import os.path) Remove comments where there was already code in the same line (comments on separate lines are better) Fix whitespace / tab indentation where necessary git-svn-id: http://www.neo1973-germany.de/svn@98 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
3b5fd004fa
commit
1fc87d074d
1 changed files with 21 additions and 24 deletions
|
@ -13,31 +13,28 @@ WM_INFO = ("epydial", "epydial")
|
|||
EDJE_GROUP_NAME = "pyneo/dialer/main"
|
||||
EDJE_FILE_NAME = "data/themes/dialer.edj"
|
||||
|
||||
from datetime import datetime
|
||||
from dbus import SystemBus
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import e_dbus
|
||||
import ecore
|
||||
import ecore.evas
|
||||
import evas.decorators
|
||||
import edje.decorators
|
||||
import edje
|
||||
from dbus import SystemBus
|
||||
from e_dbus import DBusEcoreMainLoop
|
||||
import e_dbus
|
||||
from datetime import datetime
|
||||
from os import system # alsactl is used with a sytem call
|
||||
import evas.decorators
|
||||
|
||||
from pyneo.dbus_support import *
|
||||
from pyneo.sys_support import pr_set_name
|
||||
|
||||
from ConfigParser import SafeConfigParser
|
||||
from os.path import exists
|
||||
import time
|
||||
from time import sleep
|
||||
|
||||
#import sqlite3
|
||||
|
||||
class edje_group(edje.Edje):
|
||||
def __init__(self, main, group):
|
||||
self.main = main
|
||||
self.size = self.main.evas_canvas.evas_obj.evas.size
|
||||
|
||||
if not os.path.exists(EDJE_FILE_NAME):
|
||||
raise IOError("Edje theme file not found: " + EDJE_FILE_NAME)
|
||||
|
@ -45,8 +42,7 @@ class edje_group(edje.Edje):
|
|||
try:
|
||||
edje.Edje.__init__(self, self.main.evas_canvas.evas_obj.evas, file=EDJE_FILE_NAME, group=group)
|
||||
except edje.EdjeLoadError, e:
|
||||
raise SystemExit("error loading %s: %s" % (f, e))
|
||||
self.size = self.main.evas_canvas.evas_obj.evas.size
|
||||
raise SystemExit("Error loading %s: %s" % (f, e))
|
||||
|
||||
class dialer_main(edje_group):
|
||||
def __init__(self, main):
|
||||
|
@ -55,6 +51,7 @@ class dialer_main(edje_group):
|
|||
|
||||
dbus_ml = e_dbus.DBusEcoreMainLoop()
|
||||
self.system_bus = SystemBus(mainloop=dbus_ml)
|
||||
|
||||
ecore.timer_add(5, self.init_dbus)
|
||||
|
||||
def init_dbus(self):
|
||||
|
@ -94,7 +91,7 @@ class dialer_main(edje_group):
|
|||
|
||||
def sim_pin(self):
|
||||
self.res = dedbusmap(self.keyring.GetOpened(dbus_interface=DIN_KEYRING))
|
||||
if self.res['code'] != 'READY': # TODO unify!
|
||||
if self.res['code'] != 'READY':
|
||||
print '---', 'opening keyring'
|
||||
self.part_text_set("numberdisplay_text", "Enter " + self.res['code'])
|
||||
self.res = dedbusmap(self.keyring.GetOpened(dbus_interface=DIN_KEYRING))
|
||||
|
@ -104,7 +101,7 @@ class dialer_main(edje_group):
|
|||
|
||||
def nw_register(self):
|
||||
self.nw_res = dedbusmap(self.wireless.GetStatus(dbus_interface=DIN_WIRELESS))
|
||||
if not self.nw_res['stat'] in (1, 5, ): # TODO unify!
|
||||
if not self.nw_res['stat'] in (1, 5, ):
|
||||
print '---', 'registering to gsm network'
|
||||
self.wireless.Register(dbus_interface=DIN_WIRELESS)
|
||||
self.nw_res = dedbusmap(self.wireless.GetStatus(dbus_interface=DIN_WIRELESS))
|
||||
|
@ -142,7 +139,7 @@ class dialer_main(edje_group):
|
|||
self.part_text_set("numberdisplay_text", "calling ...")
|
||||
system('alsactl -f /usr/share/openmoko/scenarios/gsmhandset.state restore')
|
||||
name = self.wireless.Initiate(''.join(self.text), dbus_interface=DIN_VOICE_CALL_INITIATOR, timeout=200, )
|
||||
sleep(20)
|
||||
time.sleep(20)
|
||||
call = object_by_url(name)
|
||||
call.Hangup(dbus_interface=DIN_CALL)
|
||||
|
||||
|
|
Loading…
Reference in a new issue