import time
import warnings
import traceback
+from xml.sax import saxutils
-from browser_emu import MozillaEmulator
+import browser_emu
class GCDialer(object):
def __init__(self, cookieFile = None):
# Important items in this function are the setup of the browser emulation and cookie file
- self._browser = MozillaEmulator(None, 0)
+ self._browser = browser_emu.MozillaEmulator(None, 0)
if cookieFile is None:
cookieFile = os.path.join(os.path.expanduser("~"), ".gc_cookies.txt")
self._browser.cookies.filename = cookieFile
for match in self._inboxRe.finditer(recentCallsPage):
phoneNumber = match.group(4)
- action = match.group(1)
- date = match.group(2)
- personsName = match.group(3)
+ action = saxutils.unescape(match.group(1))
+ date = saxutils.unescape(match.group(2))
+ personsName = saxutils.unescape(match.group(3))
yield personsName, phoneNumber, date, action
def get_addressbooks(self):
for contact_match in self._contactsRe.finditer(contactsPage):
contactId = contact_match.group(1)
contactName = contact_match.group(2)
- contact = contactId, contactName
+ contact = contactId, saxutils.unescape(contactName)
self.__contacts.append(contact)
yield contact
raise RuntimeError("%s is not accesible" % self._contactDetailURL)
for detail_match in self._contactDetailPhoneRe.finditer(detailPage):
- phoneType = detail_match.group(1)
+ phoneType = saxutils.unescape(detail_match.group(1))
phoneNumber = detail_match.group(2)
yield (phoneType, phoneNumber)
self._onRecentviewRowActivatedId = 0
textrenderer = gtk.CellRendererText()
- self._recentviewColumn = gtk.TreeViewColumn("Calls", textrenderer, text=1)
+ self._recentviewColumn = gtk.TreeViewColumn("Calls")
+ self._recentviewColumn.pack_start(textrenderer, expand=True)
+ self._recentviewColumn.add_attribute(textrenderer, "markup", 1)
self._recentviewColumn.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
def enable(self):
self._contactsview = widgetTree.get_widget("contactsview")
self._contactColumn = gtk.TreeViewColumn("Contact")
- displayContactSource = True
+ displayContactSource = False
if displayContactSource:
textrenderer = gtk.CellRendererText()
self._contactColumn.pack_start(textrenderer, expand=False)
- self._contactColumn.add_attribute(textrenderer, 'text', 0)
+ self._contactColumn.add_attribute(textrenderer, 'markup', 0)
textrenderer = gtk.CellRendererText()
self._contactColumn.pack_start(textrenderer, expand=True)
- self._contactColumn.add_attribute(textrenderer, 'text', 1)
+ self._contactColumn.add_attribute(textrenderer, 'markup', 1)
textrenderer = gtk.CellRendererText()
self._contactColumn.pack_start(textrenderer, expand=True)
- self._contactColumn.add_attribute(textrenderer, 'text', 4)
+ self._contactColumn.add_attribute(textrenderer, 'markup', 4)
self._contactColumn.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
self._contactColumn.set_sort_column_id(1)
self._contactColumn.set_visible(True)
finally:
gtk.gdk.threads_leave()
for contactId, contactName in contacts:
- # contactType = (addressBook.contact_source_short_name(contactId), )
- contactType = ("", ) # Due to popular demand
+ contactType = (addressBook.contact_source_short_name(contactId), )
self._contactsmodel.append(contactType + (contactName, "", contactId) + ("", ))
# restart the treeview data rendering
import time
import warnings
import traceback
+from xml.sax import saxutils
from xml.etree import ElementTree
-from browser_emu import MozillaEmulator
+import browser_emu
try:
import simplejson
def __init__(self, cookieFile = None):
# Important items in this function are the setup of the browser emulation and cookie file
- self._browser = MozillaEmulator(None, 0)
+ self._browser = browser_emu.MozillaEmulator(None, 0)
if cookieFile is None:
cookieFile = os.path.join(os.path.expanduser("~"), ".gv_cookies.txt")
self._browser.cookies.filename = cookieFile
for label in recentCallData["labels"]
if label.lower() != "all" and label.lower() != "inbox"
))
+ number = saxutils.unescape(number)
+ date = saxutils.unescape(date)
+ action = saxutils.unescape(action)
yield "", number, date, action
def get_addressbooks(self):
raise RuntimeError("%s is not accesible" % self._clicktocallURL)
for contact_match in self._contactsRe.finditer(contactsPage):
contactId = contact_match.group(1)
- contactName = contact_match.group(2)
+ contactName = saxutils.unescape(contact_match.group(2))
contact = contactId, contactName
self.__contacts.append(contact)
yield contact
for detail_match in self._contactDetailPhoneRe.finditer(detailPage):
phoneNumber = detail_match.group(1)
- phoneType = detail_match.group(2)
+ phoneType = saxutils.unescape(detail_match.group(2))
yield (phoneType, phoneNumber)
def _grab_json(self, url):