Discussion:
[Bitpim-devel] new command-line downloader
Drew Perttula
2004-07-04 09:32:21 UTC
Permalink
All I want (so far) is to download new photos to my computer, and I have
had a horrible time getting any wxpy to work.

So I wrote the following cmdline program which downloads files
from a phone into a local dir, skipping files that have already been
downloaded. Files are compared by name and date only. (Downloaded files
get their mtime set to the phone's time.)

Also, my Samsung A620 puts a 148-byte header on its jpegs. This program
tests if there's a jpeg after that number of bytes and if there is, it
rewrites the file as a proper jpeg with the header as a jpeg comment.
Now the jpeg is easy to view and the header is still saved in case I
want it someday.

Program help:

% ./phone-xfer -h
usage: phone-xfer [options]

options:
-h, --help show this help message and exit
-v, --verbose enable bitpim logging
-pPORT, --port=PORT phone port, default to /dev/usb/ttyACM0
-P, --progress enable bitpim progress meter
-sPHONEDIR LOCALDIR, --sync=PHONEDIR LOCALDIR
download files from PHONEDIR into LOCALDIR, skipping
files where the local file has a newer time
-t, --tree display all the directories on the phone filesystem
--no-samsung disable jpeg header -> jpeg comment transformation


My usage:

% phone-xfer -P -s digital_cam/jpeg ~/phonecam
Reading digital_cam/jpeg/20040625124622000 [================================================================================>]
Reading digital_cam/jpeg/20040629222543000 [================================================================================>]
Reading digital_cam/jpeg/20040703140753000 [================================================================================>]
Reading digital_cam/jpeg/20040627124737000 [================================================================================>]
%



My software is free, but let's talk about how to coordinate versions
(like, give me cvs) if you want to include it with bitpim.

http://bigast.com/post/phone-xfer
http://bigast.com/post/progress.py
Roger Binns
2004-07-06 02:20:32 UTC
Permalink
Post by Drew Perttula
All I want (so far) is to download new photos to my computer, and I have
had a horrible time getting any wxpy to work.
What is the actual problem you experience? I would like to fix that.
Post by Drew Perttula
My software is free,
It has to be since you link to GPL'ed BitPim code :-)

BTW please add copyright and license information to the top of
all files you want considered with BitPim and by the developers.
That ensures your rights are respected, and that there is no
misunderstanding of the origin and potential uses of the code.
Post by Drew Perttula
but let's talk about how to coordinate versions
(like, give me cvs) if you want to include it with bitpim.
I do intend for BitPim to be drivable from the command line
but not quite like this. The main entry point is bp.py
which examines the command line args. It should then decide
to launch the gui code (gui.py), or do command line stuff
(no source file yet).

A file downloader is a good first task for that if you do want to
work on it. My preference for config information (ports etc)
is that the defaults come out of the user's BitPim preferences.
That way the first step in support/troubleshooting is to ask
if the gui works fine.

As for CVS access, my policy is the same as most other projects.
Please submit patches/new code to this mailing list or via
SourceForge. In many cases I have other things I want folded
into the patch or code refactoring from existing code. After a
few iterations, we work out how to proceed efficiently. This is
obviously a lot easier with standalone pieces of code such as
a seperate file for supporting a particular phone model, or
a file that does various command line type stuff.

Roger

Loading...