Notices


Reply
Thread Tools
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#51
Originally Posted by Laughing Man View Post
Edit: epage, thanks for being willing to help! Also, is it possible to have more then one CSV file at a time?
I'll get to the other ones sometime soon but this one I can answer right away. Yes you can have multiple files with each file appearing as a separate contact list.
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog
 
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#52
Originally Posted by Laughing Man View Post
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.
Ok, thanks, that was the info I need. With some quick tips from Datapath I think was able to get that fixed in SVN and should be in the next release. I guess this shows that I don't call my relatives much if I didn't notice "Husband & Wife" came up quite a bit with them (instead of "Husband & Wife")
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog
 
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#53
Here is a script that for each evolution contact it will print the contacts details and from that what I gleam as the contact name and phone numbers. This is modified from DialCentral source, so it does things the same way.

Using your info I was able to export my evolution contacts that I imported from a GoogleContacts CSV. I found that though a quick look at the contacts in evolution looked fine, it completely messed it up and had phone numbers in all sorts of random places. Sounds like you actually use evolution, so your contacts are probably in better shape, but I am curious what this would produce (once you have time and interest of course)

Code:
#!/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")
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog
 
Posts: 4,556 | Thanked: 1,624 times | Joined on Dec 2007
#54
I guess I just save that as a script, make it executable and run it from the tablet? Though judging by the last line

read_csv("/home/epage/.dialcentral/contacts/EvoIsEvil.csv")

I should be running this on my tablet? Though normally on the tablets it's named user unless you managed to change it somehow..(if so how did you do it? o.O) So I would change that to say "/home/user/.dialcentral.contacts/contacts.csv"

Right now I'm just sorting through the list myself and fixing the # categories. So yeah..
__________________
Originally Posted by ysss View Post
They're maemo and MeeGo...

"Meamo!" sounds like what Zorro would say to catherine zeta jones... after she slaps him for looking at her dirtily...

Last edited by Laughing Man; 2009-03-28 at 22:34.
 
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#55
Your guess sounds correct to me. It can also run on the desktop (Windows or Linux, just need python installed). In theory all you need to do is change the filename passed in as you pointed out.

Thanks for the understanding in helping to get this to work out.
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog
 
Posts: 4,556 | Thanked: 1,624 times | Joined on Dec 2007
#56
Where exactly do I run the python file? I tried the home directory and it didn't work. I put it in the "/home/user/.dialcentral/contacts/" and it still comes up with

Code:
~/.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
__________________
Originally Posted by ysss View Post
They're maemo and MeeGo...

"Meamo!" sounds like what Zorro would say to catherine zeta jones... after she slaps him for looking at her dirtily...
 
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#57
When running it through "sh Evo" it doesn't seem to be picking up the shebang (#!) which tells it to treat the file as a Python script. I recommend either running "python2.5 Evo" or if you ran "chmod +x Evo" then just "./Evo"
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog
 
Posts: 4,556 | Thanked: 1,624 times | Joined on Dec 2007
#58
Thanks, I did that and then it said couldn't do a loadop file or something like that due to authorization. So I did it as root and it outputted many lines
Code:
{'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': ''}}
Though I noticed it didn't detect any numbers. I think this has to do with the whole Evolution problem I mentioned that duplicates the home_phone or mobile_phone categories. So I'll try again once I fix those problems.

Edit: It seems that Evolution doesn't like me messing around with its categories and will default back to the regular ones (thus getting rid of all my work. >.<)

Edit2: Ok I left it as default categories and just put the numbers where default categories are. Let's see how this works. I've also noticed a bug. DialCentral doesn't seem to remember what # you choose for it to use, so before it will dial a # you have to go to account then choose one of your #s from there.

Edit3: If you leave it with the default categories then it seems to work. Though it only uses its first name and not the full one.. odd. It's because it's only using the "given_name" category.

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.
__________________
Originally Posted by ysss View Post
They're maemo and MeeGo...

"Meamo!" sounds like what Zorro would say to catherine zeta jones... after she slaps him for looking at her dirtily...

Last edited by Laughing Man; 2009-03-30 at 22:26.
 
Posts: 28 | Thanked: 1 time | Joined on Aug 2008
#59
Question... I've upgraded to google voice, can I still login to grandcentral using old username/passwd?

I got "login failed"...
 
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#60
Originally Posted by Laughing Man View Post
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.
I'm sorry for not being clear. The script I made does not generate CSV files but lets you see what it is that DialCentral is doing under the hood so we could better figure out how to solve the problem.

As for the evolution mess, I'm not too sure what to make of this unfortunately.

When logged in to your GoogleVoice account it should remember the callback number between calls but if you close and reopen it, it will not remember. Before we were lazy and relied and google setting a cookie to store the default phone number. I'm guessing the cookie doesn't exist anymore so we currently have no way to persist it between sessions. I'm wanting to fix this along with remembering username and password beyond the cookie but first I need to feel satisfied with the security of the solution.

EDIT: I found the cookie and in the next release it should remember your callback number

Originally Posted by dxitt View Post
Question... I've upgraded to google voice, can I still login to grandcentral using old username/passwd?

I got "login failed"...
When you get a login prompt it should have a drop down that lets you choose which service to login to. For me, both work fine. Any issues with login for either is a bug and should be reported with as much info as you can provide seeing as how you probably don't want to give me your account credentials to reproduce it (and besides I don't want them, for security reasons).
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog

Last edited by epage; 2009-03-31 at 02:27. Reason: Found me a cookie, yum
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 21:41.