795a4b792c2dc5154517b0a0e513bc3763bf814a
[gc-dialer] / src / null_backend.py
1 #!/usr/bin/python
2
3 # DialCentral - Front end for Google's Grand Central service.
4 # Copyright (C) 2008  Eric Warnke ericew AT gmail DOT com
5
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
20
21 class NullDialer(object):
22
23         def __init__(self):
24                 pass
25
26         def is_authed(self, force = False):
27                 return False
28
29         def login(self, username, password):
30                 return self.is_authed()
31
32         def logout(self):
33                 self.clear_caches()
34
35         def dial(self, number):
36                 return True
37
38         def clear_caches(self):
39                 pass
40
41         def is_valid_syntax(self, number):
42                 """
43                 @returns If This number be called ( syntax validation only )
44                 """
45                 return False
46
47         def get_account_number(self):
48                 """
49                 @returns The grand central phone number
50                 """
51                 return ""
52
53         def set_sane_callback(self):
54                 pass
55
56         def get_callback_numbers(self):
57                 return {}
58
59         def set_callback_number(self, callbacknumber):
60                 return True
61
62         def get_callback_number(self):
63                 return ""
64
65         def get_recent(self):
66                 return ()
67
68         def get_addressbooks(self):
69                 return ()
70
71         def open_addressbook(self, bookId):
72                 return self
73
74         @staticmethod
75         def contact_source_short_name(contactId):
76                 return "ERROR"
77
78         @staticmethod
79         def factory_name():
80                 return "ERROR"
81
82         def get_contacts(self):
83                 return ()
84
85         def get_contact_details(self, contactId):
86                 return ()