Discussion:
[Bitpim-devel] Mac OS X update
Tim Lowery
2003-03-26 22:27:50 UTC
Permalink
Hey, the application seems to be partially working and talking to the
phone. It retrieved my phonebook! I have no ringers or wallpapers
installed.

After installing pyserial and verifying the phone was set to RS232, I
was able to communicate using the device name /dev/tty.usbserial0.

Most of my problems have centered around learning the Python
development environment. Initially, I was using PythonIDE. By
double-clicking bp.py it would launch the IDE, and then I would click
Run All. On several occasions the application and/or IDE would
unexpectedly quit or lock up requiring a Force Quit from Finder.
PythonIDE looks quite powerful with a module browser and debugger, so
when I have more time I'll have to reexamine what I was doing wrong.

I've had far better luck running the application with the following
steps:

- open Terminal shell
- navigate to BitPim source directory
- use pychecker to verify the source files
- type: /usr/local/bin/pythonw bp.py

The Log and Protocol Log windows are updated, but the output lines
appear double-spaced. Currently, the application hangs when I attempt
to expand the file directory. It says "Retrieving..." and the lower
left corner says "BUSY".

Also, I may have uncovered a bug. It could be Mac-specific or already
reported. Here are the steps:

- launch application
- click Log tab
- select View Filesystem menu

Note that the highlighted tab changes to Filesystem (which is newly
inserted), but the window contents still display Log results. By
clicking to Log, and then back to Filesystem, the window contents are
refreshed.

Any thoughts about the problem expanding the file directory? I
probably won't be able to resume until the weekend.

Tim
Roger Binns
2003-03-27 06:26:06 UTC
Permalink
Post by Tim Lowery
Hey, the application seems to be partially working and talking to the
phone. It retrieved my phonebook! I have no ringers or wallpapers
installed.
Cool.
Post by Tim Lowery
After installing pyserial and verifying the phone was set to RS232, I
was able to communicate using the device name /dev/tty.usbserial0.
You are welcome to write some code that actually figures out available
com port names for the Mac :-) I currently have seperate code in
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/bitpim/comscan/comscan.py
that does it. (It needs a little tidying to actually import on non-Windows
platforms). I can't figure out how to do it on Linux.
Post by Tim Lowery
PythonIDE looks quite powerful with a module browser and debugger, so
when I have more time I'll have to reexamine what I was doing wrong.
There is also pycrust that is part of wxPython. It is an interactive
environment.

I actually just use xemacs and put print statements everywhere :-)
Post by Tim Lowery
- use pychecker to verify the source files
pychecker is getting a bit annoying with bad warnings.
Post by Tim Lowery
- type: /usr/local/bin/pythonw bp.py
You should also have a 'python'. I would recommend using that since
you will then see the results of any print statements.
Post by Tim Lowery
The Log and Protocol Log windows are updated, but the output lines
appear double-spaced.
I don't even know how to ask for double spacing! All I wanted is a
text control where I could set a non-proportional font. I think the
control used is more intended as a lightweight word processor.
Post by Tim Lowery
Currently, the application hangs when I attempt
to expand the file directory. It says "Retrieving..." and the lower
left corner says "BUSY".
The retreival is done in a background thread. The display won't change
until results or an exception are returned. If you are already getting
phonebook data then this isn't any different.
Post by Tim Lowery
Note that the highlighted tab changes to Filesystem (which is newly
inserted),
That is actually a Mac bug! The code wasn't asking for it to change
to filesystem view, just for the tab to be added. However from
a usability pov, you should be shown what was just added. I've now
changed the code also request viewing the tab as it is added, so the
bug should no longer be tickled.
Post by Tim Lowery
Any thoughts about the problem expanding the file directory? I
probably won't be able to resume until the weekend.
That is going to be a straight forward threading or communication
issue. Look in protocol view to see if anything is happening.

Line 173 in gui.py is where the next item is retreived from the
queue in the background thread (item=self.q.get()) Put a print
statement on the next line to ensure it is being woken up.

Please also check where bitpim is putting the user files. The
subdirectories are cleared out each time new data arrives. On
Linux it defaults to $HOME/.bitpim-files

If you have any feedback on areas that could do with more comments,
please shout. One of my weaknesses is that I don't put in as many
as I should.

Roger
Tim Lowery
2003-04-04 04:23:22 UTC
Permalink
Post by Roger Binns
You are welcome to write some code that actually figures out available
com port names for the Mac :-) I currently have seperate code in
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/bitpim/comscan/
comscan.py
I found some code via the Python mailing list that enumerates the
serial ports. It's called OSXSerialPorts and written by Pascal
Oberndoerfer. I actually haven't used it yet, but it contains a C file
and a Python wrapper.
Post by Roger Binns
Post by Tim Lowery
PythonIDE looks quite powerful with a module browser and debugger, so
when I have more time I'll have to reexamine what I was doing wrong.
There is also pycrust that is part of wxPython. It is an interactive
environment.
The interactive environment for PythonIDE seems to work ok.
Post by Roger Binns
Post by Tim Lowery
Currently, the application hangs when I attempt
to expand the file directory. It says "Retrieving..." and the lower
left corner says "BUSY".
I started looking into this again. It appears to be hanging in
OnDirListingResults in gui.py -- an infinite loop in "while cookie!=0"
statement. The path is a null string. I verified that getfilesystem
is returning a proper dictionary containing file system info. Any
thoughts before I look into this further? Also, what's the deal with
subtracting 10000 in the initial cookie calculation?

Tim
Roger Binns
2003-04-04 20:47:48 UTC
Permalink
Post by Tim Lowery
Also, what's the deal with
subtracting 10000 in the initial cookie calculation?
The reason why I subtract 10,000 was a defensive one. I am pretty certain
that the internal cookie is a pointer and generally has the same value as
the id() function. By subtracting 10,000 I was forcibly breaking any link
between the values.

(The doc says the cookie could be anything. I just wanted to make sure
I didn't the one out of 4billion values that would confuse it!)

Roger
Tim Lowery
2003-04-04 20:22:13 UTC
Permalink
hanging in OnDirListingResults in gui.py -- an infinite loop in "while
cookie!=0" statement.
Yes, cookie never goes to zero. If I force it to zero after the first
iteration, the routine completes and the correct file system info is
displayed. I can only conclude that the following statement does not
work on the Mac OS X platform (cookie never changes):

child,cookie=self.GetNextChild(item,cookie)

Instead, I changed the loop completion test as follows:

nc=self.GetChildrenCount(item,0)
while nc>0:
l.append(child)
child,cookie=self.GetNextChild(item,cookie)
nc-=1

With the above change one can now expand/contract the file directory
info. But, there are some window refresh and update problems.

Tim
Roger Binns
2003-04-05 19:29:17 UTC
Permalink
Post by Tim Lowery
nc=self.GetChildrenCount(item,0)
l.append(child)
child,cookie=self.GetNextChild(item,cookie)
nc-=1
With the above change one can now expand/contract the file directory
info. But, there are some window refresh and update problems.
I'm happy to change the code to the above. Let me know what you think.
It would however seem that the tree widget is somewhat broken on Mac.
Does the tree in the demo work correctly. The other important thing
bitpim does is to change the tree contents (the demo doesn't do that).

Try uploading wallpaper in the main interface and then refreshing
in the tree.

Roger
Roger Binns
2003-04-08 06:31:59 UTC
Permalink
Post by Tim Lowery
nc=self.GetChildrenCount(item,0)
Code now changed to moral equivalent of that and still
appears to work correctly :-)

Roger

Tim Lowery
2003-04-06 02:29:27 UTC
Permalink
Post by Roger Binns
I'm happy to change the code to the above. Let me know what you think.
Yes, go ahead and fold it into your next release. There's also another
section code in "pathtoitem" that requires a similar change.
Post by Roger Binns
It would however seem that the tree widget is somewhat broken on Mac.
Apparently broken. I tried using "child.IsOk" to determine if it was
valid tree item, but that never changes either. The online
documentation is not specific regarding the semantics of cookie, i.e.
returning zero when invalid. What documentation do you use as a
reference?
Post by Roger Binns
Does the tree in the demo work correctly. The other important thing
bitpim does is to change the tree contents (the demo doesn't do that).
Try uploading wallpaper in the main interface and then refreshing
in the tree.
I'll go check this out, and also provide some feedback regarding
stability on the Mac.

Tim
Loading...