|
|
2009-03-28
, 02:32
|
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#52
|
By notebook do you mean the contacts? If so it's in contacts > Google Voice. And it's names like BB&T Customer Service, or Cugini's Pizza that I have saved.
|
|
2009-03-28
, 02:53
|
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#53
|
#!/usr/bin/env python
import re
import csv
import pprint
_nameRe = re.compile("name", re.IGNORECASE)
_phoneRe = re.compile("phone", re.IGNORECASE)
_mobileRe = re.compile("mobile", re.IGNORECASE)
def read_csv(csvPath):
csvReader = iter(csv.reader(open(csvPath, "rU")))
header = csvReader.next()
nameColumn, phoneColumns = _guess_columns(header)
yieldCount = 0
for row in csvReader:
a = dict((ch, cr) for ch, cr in zip(header, row))
pprint.pprint(a)
b = {
header[nameColumn]: row[nameColumn],
"numbers": dict(
(header[phoneColumn[1]], row[phoneColumn[1]]) for phoneColumn in phoneColumns
)
}
pprint.pprint(b)
print
def _guess_columns(row):
names = []
phones = []
for i, item in enumerate(row):
if _nameRe.search(item) is not None:
names.append((item, i))
elif _phoneRe.search(item) is not None:
phones.append((item, i))
elif _mobileRe.search(item) is not None:
phones.append((item, i))
if len(names) == 0:
names.append(("Name", 0))
if len(phones) == 0:
phones.append(("Phone", 1))
return names[0][1], phones
read_csv("/home/epage/.dialcentral/contacts/EvoIsEvil.csv")
|
|
2009-03-28
, 22:00
|
|
Posts: 4,556 |
Thanked: 1,624 times |
Joined on Dec 2007
|
#54
|
|
|
2009-03-29
, 00:16
|
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#55
|
|
|
2009-03-29
, 01:59
|
|
Posts: 4,556 |
Thanked: 1,624 times |
Joined on Dec 2007
|
#56
|
~/.dialcentral/contacts $ sh Evo
Evo: line 3: import: not found
Evo: line 4: import: not found
Evo: line 5: import: not found
Evo: line 8: syntax error: "(" unexpected
|
|
2009-03-29
, 02:03
|
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#57
|
|
|
2009-03-29
, 02:24
|
|
Posts: 4,556 |
Thanked: 1,624 times |
Joined on Dec 2007
|
#58
|
{'Birth Day': '',
'Birth Month': '',
'Birth Year': '',
'Business Address': '',
'Business Address City': '',
'Business Address Country': '',
'Business Address PostCode': '',
'Business Address State': '',
'Business Address2': '',
'Home Address': '',
'Home Address City': '',
'Home Address Country': '',
'Home Address PostCode': '',
'Home Address State': '',
'Home Address2': '',
'business_fax': '',
'business_phone': '',
'caluri': '',
'email_1': '',
'email_2': '',
'email_3': '',
'email_4': '',
'family_name': '',
'given_name': 'Sensei Stephanie',
'home_phone': '',
'homepage_url': '',
'id': 'pas-id-49CD16C500000021',
'mobile_phone': '',
'nickname': 'Sensei Stephanie',
'note': '',
'office': '',
'org': '',
'pager': '',
'title': '',
'wants_html': 'FALSE'}
{'given_name': 'Sensei Stephanie',
'numbers': {'business_phone': '', 'home_phone': '', 'mobile_phone': ''}}
|
|
2009-03-31
, 00:26
|
|
Posts: 28 |
Thanked: 1 time |
Joined on Aug 2008
|
#59
|
|
|
2009-03-31
, 02:21
|
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#60
|
Edit4: Tried the script again with the new .csv (with readjustments from Edit2). it seems whenever the script's done and I try to use dialcentral it no longer shows my contacts...It seems to get stuck trying to read the CSV file the script outputs.
Question... I've upgraded to google voice, can I still login to grandcentral using old username/passwd?
I got "login failed"...
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog