maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   DialCentral 0.9.0 (https://talk.maemo.org/showthread.php?t=27319)

epage 2009-03-27 11:08

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by dick-richardson (Post 275003)
Works great, though contacts display a little odd (all of them preceeded with 'GV').

I can change it if people wish but I precede the contact with the source of the contact, GV for GoogleVoice, GC for GrandCentral, CSV for csv file, and EVO for evolution mainly for when using the "All" listing of contacts. Originally it showed icons but I was too lazy to make icons for the different contact lists.

dick-richardson 2009-03-27 12:22

Re: DialCentral 0.9.0
 
I don't think it's necessary since you can choose between them from the drop-down, but it certainly isn't a big deal.

munky261 2009-03-27 16:00

Re: DialCentral 0.9.0
 
Id definitely like to see just the names of my contacts and not GV or GC or anything

Laughing Man 2009-03-27 17:07

Re: DialCentral 0.9.0
 
While I would like SMS included I also realize it's not that great. Because it then means I have to keep the application open just to send or receive SMS messages. It would be better integrated into a mail client or a chat program.

munky261 2009-03-27 17:39

Re: DialCentral 0.9.0
 
I dont mind having to keep a webpage open, but i dont like having to refresh the page to see if i got a new message...want it to be like it was when you could use the built in im client with gtalk...have it just show up, like an IM

Laughing Man 2009-03-27 18:35

Re: DialCentral 0.9.0
 
Yeah, hopefully we'll get something like that..

In other news, I upgraded to Google Voice (might as well since they're going be forcing us to upgrade eventually). It seems that the new DialCentral is having trouble recognizing the & symbol.

Edit: Hmm is there anyway to port a recognizable CSV file from Evolution? (also where do I put the CSV files) Or for the Dialer to recognize setup groups in Google Voice so the contacts aren't dumped all into one place?

epage 2009-03-27 23:01

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by Laughing Man (Post 275126)
In other news, I upgraded to Google Voice (might as well since they're going be forcing us to upgrade eventually). It seems that the new DialCentral is having trouble recognizing the & symbol.

In what way is the & symbol being used? As a note, even if you upgrade your GC account to GV, you can still use the GC login for DialCentral

Quote:

Originally Posted by Laughing Man (Post 275126)
Edit: Hmm is there anyway to port a recognizable CSV file from Evolution? (also where do I put the CSV files) Or for the Dialer to recognize setup groups in Google Voice so the contacts aren't dumped all into one place?

Place the CSV in the directory "~/.dialcentral/contacts"

I treat the first line of the CSV as column headers. I look for a "name" column and either "phone" or "mobile" columns and use those. If an evolution export does not work, if you just give me the first line of the CSV, I'll try and add support for it. Sorry I'm lazy and try and find excuses to not use evolution.

Laughing Man 2009-03-27 23:47

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by epage (Post 275160)
In what way is the & symbol being used? As a note, even if you upgrade your GC account to GV, you can still use the GC login for DialCentral


Place the CSV in the directory "~/.dialcentral/contacts"

I treat the first line of the CSV as column headers. I look for a "name" column and either "phone" or "mobile" columns and use those. If an evolution export does not work, if you just give me the first line of the CSV, I'll try and add support for it. Sorry I'm lazy and try and find excuses to not use evolution.

Oops, I was wrong. It's not the & symbol but the '. It shows it as &#39'. Or amp;amp;

Evolution's can be done to whatever I want. I think I used the default..(given_name, family_name, id, nickname, email, home_phone, mobile_phone).

So if I made something similar to just name, and phone it would work? I tried to use the export from Evolution and only some of them showed up (trying to identify what's causing those to show up versus the others ont showing up).

What do you use to generate and maintain CSV files? Perhaps that'll be easier for me lol.

epage 2009-03-28 00:13

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by Laughing Man (Post 275165)
Oops, I was wrong. It's not the & symbol but the '. It shows it as &#39'. Or amp;amp;

You say its having trouble recognizing the symbol. Could you give more details as to where this is at, like which notebook tab and which widget within that notebook?

Quote:

Originally Posted by Laughing Man (Post 275165)
Evolution's can be done to whatever I want. I think I used the default..(given_name, family_name, id, nickname, email, home_phone, mobile_phone).

So if I made something similar to just name, and phone it would work? I tried to use the export from Evolution and only some of them showed up (trying to identify what's causing those to show up versus the others ont showing up).

What do you use to generate and maintain CSV files? Perhaps that'll be easier for me lol.

I haven't really used any tool to generate them but the default export option of different websites like Google Contacts and GrandCentral.

The algorithm that I use is this:

Code:

for each column name in header row
  find the first column name that contains "name"
    use this column as the name column
If no name column found, default to the first column

for each column name in header row
  if the column name contains "phone" or "mobile"
    add it to a list of phone columns to use
If no phone column is found
  use the second column as the phone column

Currently I have it ignore contacts loaded from a file if they have no phone numbers in their row. I did this just to drop down the number displayed when using Google Contacts exports since there are so many without a number due to having enabled auto adding of contacts. If this seems confusing to people I can remove it.

If for some reason it is skipping contacts that with that algorithm should show up, then its a bug and I would like to fix it. If I its not a problem with my algorithm then I would be fully willing to try and add support for the default export from evolution. I would ask for a sample (sanitized is fine) since I tend to hate evolution. I tried to create a sample myself but ran into some issues (and serious annoyances that reminded me why I avoid it). On my system (Ubuntu 8.10 with Evolution 2.24.3) I can't even find an export option besides vcard and backup which both wouldn't work.

Laughing Man 2009-03-28 01:37

Re: DialCentral 0.9.0
 
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.

Hmm, perhaps if I re-arrange the columns in Evolution to your layout (name then phone #) maybe it would work better. I'll report back Saturday or Sunday with the news (going out to eat soon and then gf will be over so no messing with electronics). Though that still doesn't explain the oddity of it including some contacts and not others when they're all setup like that.

Actually I think I might have figured it out. Evolution stupidly repeats categories such a "home phone" and if it does that. It won't show the # listed under home phone until you change the other category to something else. So I think I'll also fix all of these and try again.

And if all that fails I'll give you a mostly santized file.

Btw, I had to Google how to export to CSV myself. (there's no GUI tool for it).

The command for Ubuntu 8.10 is /usr/bin/evolution-addressbook-export --format=csv >whateveryouwanttocallit.csv

It'll be in your home folder then after that.

Edit: epage, thanks for being willing to help! Also, is it possible to have more then one CSV file at a time?

epage 2009-03-28 01:59

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by Laughing Man (Post 275178)
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.

epage 2009-03-28 02:32

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by Laughing Man (Post 275178)
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")

epage 2009-03-28 02:53

Re: DialCentral 0.9.0
 
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")


Laughing Man 2009-03-28 22:00

Re: DialCentral 0.9.0
 
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..

epage 2009-03-29 00:16

Re: DialCentral 0.9.0
 
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.

Laughing Man 2009-03-29 01:59

Re: DialCentral 0.9.0
 
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


epage 2009-03-29 02:03

Re: DialCentral 0.9.0
 
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"

Laughing Man 2009-03-29 02:24

Re: DialCentral 0.9.0
 
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.

dxitt 2009-03-31 00:26

Re: DialCentral 0.9.0
 
Question... I've upgraded to google voice, can I still login to grandcentral using old username/passwd?

I got "login failed"...

epage 2009-03-31 02:21

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by Laughing Man (Post 275403)
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

Quote:

Originally Posted by dxitt (Post 275913)
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).

Laughing Man 2009-03-31 02:32

Re: DialCentral 0.9.0
 
I think the Evolution issue is just a crapshoot at this point. It seems to do ways in its own thing. (for example, if you change the default email or phone categories around it'll reset them on next run).

From what I've learned from this experience, I think I learned enough on how to manipulate it enough to form a CSV for my own purposes.

epage 2009-03-31 02:40

Re: DialCentral 0.9.0
 
I'm glad you got something out of this pain. Sorry I couldn't be more help with it.

epage 2009-04-10 20:36

Re: DialCentral 0.9.0
 
Suggestions seemed to slow down, so I posted what I have so far. See first post in this thread for 0.9.3 info

munky261 2009-04-11 02:40

Re: DialCentral 0.9.0
 
Epage, on semi related note do you know if it is possible to make a google voice sms notifier for the statusbar, similar to the webmail notifier we already have. I know they closed off outside IM support, but just want to be able to know when I have an sms so I can go to the website.

epage 2009-04-11 02:56

Re: DialCentral 0.9.0
 
Currently we are using a hybrid of screen scraping the mobile site and an API.

A sms notifier could be created but it would require pollling the website for updates. Email notification might be a bit more robust and better on the battery.

munky261 2009-04-11 03:04

Re: DialCentral 0.9.0
 
Ive thought about email notification, but I think Id rather just have a small notifier to check every 5 minutes or so and have the Icon come up only when theres a new sms, like the app update notifier, and flash the led and make a sound.

sw01 2009-04-14 12:10

Re: DialCentral 0.9.0
 
0.9.3 fails trying to import maxutils in gv_backend.py on my tablet

epage 2009-04-14 14:14

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by sw01 (Post 279474)
0.9.3 fails trying to import maxutils in gv_backend.py on my tablet

from xml.sax import saxutils fails? That is worrisome especially since its part of the python standard library. I also tested it on my linux box with Python 2.4 and 2.5 and on my tablet with Python 2.5 and that import works.

Is it possible at all to copy the text outputted when running it from the command prompt to see if anything else is triggering this?

Boy, the random deployment issues are fun

EL_EASY 2009-04-15 01:43

Re: DialCentral 0.9.0
 
1 Attachment(s)
AfterI updated to version 0.9.3-0 my DialCentral stop working what happened if bc google voice or what?

TrueJournals 2009-04-15 01:56

Re: DialCentral 0.9.0
 
Works fine for me... You should get a login dialog. Just choose to login to Google Voice, instead of GrandCentral. If you don't get the dialog, go to the account tab, and clear the authentication information.

epage 2009-04-15 01:58

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by EL_EASY (Post 279662)
AfterI updated to version 0.9.3-0 my DialCentral stop working what happened if bc google voice or what?

There were a lot of changes that went in when adding GoogleVoice support so I ask for patience and forgiveness

The hard thing about this is we are using a technique called "screen scraping" where we download webpages and do searches on them. Unfortunately its hard to predict from one account to another what subtle things might be different that can break the screen scraping. My hope is eventually they will have an official API and this issue will go away.

With 0.9.3 you have a choice of whether to login to your GrandCentral account or your GoogleVoice account. Does either one work? Can you even get that far?

Do you feel comfortable running a program from the command line? Doing so can get a lot of diagnostic information that can help in resolving the issue. The program is
Code:

python2.5 /usr/bin/dialcentral.py
If you could run that, copy the text, and post it here for me (it should not have usernames or passwords)

I'm thinking I might want to add logging support to make this a bit easier.

sw01 2009-04-15 12:18

Re: DialCentral 0.9.0
 

/usr/lib/dialcentral/dc_glade.py:86: GtkWarning: gtk_widget_grab_default: assertion `GTK_WIDGET_CAN_DEFAULT (widget)' failed
self._widgetTree = gtk.glade.XML(path)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
File "/usr/lib/python2.5/threading.py", line 446, in run
File "/usr/lib/dialcentral/dc_glade.py", line 190, in _idle_setup
import gv_backend
File "/usr/lib/dialcentral/gv_backend.py", line 36, in <module>
from xml.sax import saxutils
ImportError: No module named sax


here is the output from my n800 diablo

EL_EASY 2009-04-15 13:45

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by epage (Post 279664)
With 0.9.3 you have a choice of whether to login to your GrandCentral account or your GoogleVoice account. Does either one work? Can you even get that far?

I have no choice to login either one

Do you feel comfortable running a program from the command line? Doing so can get a lot of diagnostic information that can help in resolving the issue. The program is
Code:

python2.5 /usr/bin/dialcentral.py
If you could run that, copy the text, and post it here for me (it should not have usernames or passwords)

I'm thinking I might want to add logging support to make this a bit easier.

well, I'm not good running command line, but i tried:
BusyBox v1.6.1 (2008-09-18 09:43:17 EEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

/home/user # python2.5 /usr/bin/dialcentral.py
/usr/lib/dialcentral/dc_glade.py:86: GtkWarning: gtk_widget_grab_default: assertion `GTK_WIDGET_CAN_DEFAULT (widget)' failed
self._widgetTree = gtk.glade.XML(path)
process 4302: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted

epage 2009-04-15 14:21

Re: DialCentral 0.9.0
 
@EL_EASY: Interesting. I haven't been needing to run commands with "/usr/bin/run-standalone.sh" since I got my n810 with Diablo, but its looking like you're needing it. I'll test adding it back in tonight and try and get and update out, though that might not come till tomorrow. In the mean time could you try running "run-standalone.sh python2.5 /usr/bin/dialcentral.py"?

EL_EASY 2009-04-15 19:15

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by epage (Post 279775)
@EL_EASY: Interesting. I haven't been needing to run commands with "/usr/bin/run-standalone.sh" since I got my n810 with Diablo, but its looking like you're needing it. I'll test adding it back in tonight and try and get and update out, though that might not come till tomorrow. In the mean time could you try running "run-standalone.sh python2.5 /usr/bin/dialcentral.py"?

epage: i run what u wanted me 2 run in case i don't know what im doing ok resulted:
/home/user # "run-standalone.sh python2.5 /usr/bin/dialcentral.py"?
/bin/sh: run-standalone.sh python2.5 /usr/bin/dialcentral.py?: not found

sw01 2009-04-16 13:49

Re: DialCentral 0.9.0
 
I think the dependencies in your control file need to include python2.5-xml.

EL_EASY 2009-04-26 18:35

Re: DialCentral 0.9.0
 
to:epage
I see u guys couldn't help me to fix my problem, but what i did went back 9.2 and it works now...I will update when u add sms, other than that i will leave it like that... thanks for u great work!!

epage 2009-04-30 01:05

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by sw01 (Post 280076)
I think the dependencies in your control file need to include python2.5-xml.

Its a separate package? But its documented as part of the stdlib? How strange. I'll add it.

Hmm, somehow I missed this post

epage 2009-04-30 01:10

Re: DialCentral 0.9.0
 
Quote:

Originally Posted by EL_EASY (Post 282171)
to:epage
I see u guys couldn't help me to fix my problem, but what i did went back 9.2 and it works now...I will update when u add sms, other than that i will leave it like that... thanks for u great work!!

I'm sorry, I got distracted and lost track of your issue. I'm filing me some notes to take a look into this. I'm a bit busy this week but I'm hoping for some time tomorrow.

epage 2009-04-30 01:13

Re: DialCentral 0.9.0
 
As a side note, in my work on DoneIt, I've seen some seemingly random network issues. I've added a check in SVN to DialCentral to make sure we receive the whole response from them.

If anyone gets an error about response lengths once I get this package out, please let me know. If no one does, I'll hold off harassing the Python people about this issue since I'll assume only DoneIt has it and my hack in DoneIt works around it.


All times are GMT. The time now is 10:10.

vBulletin® Version 3.8.8