[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819
Michael 'Mickey' Lauer
mickey at vanille-media.de
Sat Aug 6 08:19:44 UTC 2011
The following commit has been merged in the debian branch:
commit 9430d6a68b59ef924764824c9318e23521c1ba5f
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date: Sat Apr 17 14:30:02 2010 +0200
ophoned: add missing file headers
diff --git a/framework/subsystems/ophoned/gsm.py b/framework/subsystems/ophoned/gsm.py
index b52c066..8ba4521 100644
--- a/framework/subsystems/ophoned/gsm.py
+++ b/framework/subsystems/ophoned/gsm.py
@@ -1,3 +1,14 @@
+# -*- coding: UTF-8 -*-
+"""
+The Open Phone Daemon - Python Implementation
+
+(C) 2008 Guillaume "Charlie" Chereau
+(C) 2008 Openmoko, Inc.
+GPLv2 or later
+
+Package: ophoned
+"""
+
import dbus
import dbus.service
from dbus import DBusException
diff --git a/framework/subsystems/ophoned/ophoned.py b/framework/subsystems/ophoned/ophoned.py
index 6b90255..03b50a2 100644
--- a/framework/subsystems/ophoned/ophoned.py
+++ b/framework/subsystems/ophoned/ophoned.py
@@ -1,3 +1,4 @@
+# -*- coding: UTF-8 -*-
"""
The Open Phone Daemon - Python Implementation
diff --git a/framework/subsystems/ophoned/protocol.py b/framework/subsystems/ophoned/protocol.py
index 0bd8932..bdf9eed 100644
--- a/framework/subsystems/ophoned/protocol.py
+++ b/framework/subsystems/ophoned/protocol.py
@@ -1,3 +1,14 @@
+# -*- coding: UTF-8 -*-
+"""
+The Open Phone Daemon - Python Implementation
+
+(C) 2008 Guillaume "Charlie" Chereau
+(C) 2008 Openmoko, Inc.
+GPLv2 or later
+
+Package: ophoned
+"""
+
import dbus
import dbus.service
from dbus import DBusException
@@ -7,7 +18,7 @@ logger = logging.getLogger('ophoned.protocol')
class ProtocolMetaClass(type):
"""The meta class for Protocole class
-
+
We use this meta class to keep track of all the Protocols instances
"""
def __init__(cls, name, bases, dict):
@@ -19,21 +30,21 @@ class ProtocolUnusable(Exception):
"""This exception can be raised in the __init__ method of any protocol to indicate that it can't be used"""
def __init__(self, msg = None):
super(ProtocolUnusable, self).__init__(msg)
-
+
class Protocol(object):
"""Represent a phone call protocol
-
+
To create a new protocol just subclass this class
One instance of each protocol will be created by the meta class at import time.
-
+
Every Protocol class should define an inner Call class
"""
__metaclass__ = ProtocolMetaClass
subclasses = {} # Contain all the subclasses of Protocol
-
+
def name(self):
raise NotImplemented
-
+
def __init__(self, phone):
logger.info("creating protocol %s", self.name() )
self.phone = phone
@@ -46,7 +57,7 @@ class Protocol(object):
def CreateCall(self, peer):
"""Return a new chanel targeting the given number
-
+
if force is True and a call on this number is already present, then the call will be removed
"""
# Every Protocl class need to define an inner Call class
@@ -54,13 +65,13 @@ class Protocol(object):
self.calls[call.handle] = call
self.next_call_handle += 1
return call
-
+
def remove(self, call):
"""This mehtod is called when a call need to be removed"""
del self.calls[call.handle]
-
+
class Call(dbus.service.Object):
- """A Call object represents a communication channel"""
+ """A Call object represents a communication channel"""
def __init__(self, protocol, handle, peer):
"""Create a new Call
arguments:
@@ -74,7 +85,7 @@ class Call(dbus.service.Object):
self.peer = peer # TODO: change the name to number, because in fact it is exactly that
self.status = 'Idle'
self.protocol.phone.CallCreated(self)
-
+
@dbus.service.method('org.freesmartphone.Phone.Call', in_signature='', out_signature='s')
def GetPeer(self):
"""Return the number of the peer (usually the number of the call)"""
@@ -83,12 +94,12 @@ class Call(dbus.service.Object):
@dbus.service.method('org.freesmartphone.Phone.Call', in_signature='', out_signature='s')
def Initiate(self):
"""Initiate the call
-
+
The call will be effectively initiated when we receive the 'Activated' Signal
"""
self.status = 'Initiating'
return self.status
-
+
@dbus.service.method(
'org.freesmartphone.Phone.Call', in_signature='', out_signature='s',
async_callbacks=("dbus_ok","dbus_error")
@@ -97,7 +108,7 @@ class Call(dbus.service.Object):
"""Accept the call"""
self.status = 'Activating'
dbus_ok(self.status)
-
+
@dbus.service.method(
'org.freesmartphone.Phone.Call', in_signature='', out_signature='s',
async_callbacks=("dbus_ok","dbus_error")
@@ -106,37 +117,37 @@ class Call(dbus.service.Object):
"""Release the call"""
self.status = 'Releasing'
dbus_ok(self.status)
-
+
@dbus.service.method('org.freesmartphone.Phone.Call', in_signature='', out_signature='s')
def GetStatus(self):
"""Return the current status of the call"""
return self.status
-
+
@dbus.service.method('org.freesmartphone.Phone.Call', in_signature='', out_signature='')
def Remove(self):
"""Remove the call object when it is not needed anymore
-
+
After the call has been removed, its DBus object is released, so we can't receive events from it anymore
"""
self.remove_from_connection()
self.protocol.remove(self)
-
+
@dbus.service.signal('org.freesmartphone.Phone.Call', signature='')
def Outgoing(self):
"""Emitted when the call status changes to Outgoing"""
self.status = 'Outgoing'
-
+
@dbus.service.signal('org.freesmartphone.Phone.Call', signature='')
def Released(self):
"""Emitted when the call status changes to Released"""
self.status = 'Released'
self.protocol.phone.CallReleased(self)
-
+
@dbus.service.signal('org.freesmartphone.Phone.Call', signature='')
def Activated(self):
"""Emitted when the call status changes to Active"""
self.status = 'Active'
-
-
-
+
+
+
diff --git a/framework/subsystems/ophoned/test.py b/framework/subsystems/ophoned/test.py
index cc90b03..1d9c103 100644
--- a/framework/subsystems/ophoned/test.py
+++ b/framework/subsystems/ophoned/test.py
@@ -1,3 +1,15 @@
+# -*- coding: UTF-8 -*-
+"""
+The Open Phone Daemon - Python Implementation
+
+(C) 2008 Guillaume "Charlie" Chereau
+(C) 2008 Openmoko, Inc.
+GPLv2 or later
+
+Package: ophoned
+
+Implementation of the dbus objects.
+"""
import gobject
--
FSO frameworkd Debian packaging
More information about the pkg-fso-commits
mailing list