Re: Re: Hacking BitPim to delete locked files
"Brian Blakley" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <000601c5881c$7c09b540$6701fe0a@tcswks003> |
I'm a little stuck and hope someone who knows the code better can help.
In p_brew.p, line 102 appears the "unknown1" piece of data (4 bytes) which
is speculated to be the file attributes. I'd like to include that value in
the Filesystem tab display so I can see if known locked files have a
different value than others. I've made a lot of progress (for a non-Python
programmer), but am stuck (quite close to the finish line I believe).
First, I modified gui.py in the vicinity of line 1830 to read:
self.AddColumn("Name")
self.AddColumn("Size")
self.AddColumn("Date")
self.AddColumn("Unknown1") <----- This is my new line
self.SetMainColumn(0)
self.SetColumnWidth(0, 300)
self.SetColumnWidth(2, 200)
if self.datacolumn:
self.AddColumn("Extra Stuff")
self.SetColumnWidth(3, 400)
I see that I've usurped the use of column 3 which was reserved for "Extra
Stuff" if self.datacolumn is true, but it must not be true because that
column doesn't show, so that appears safe. This addition causes my
"Unknown1" column to appear in the display.
Later, in the vicinity of line 1964 (still in gui.py), I modified it to
read:
if result[file]['type']=='file':
self.dirhash[result[file]['name']]=0
self.SetItemHasChildren(found, False)
self.SetItemText(found, `result[file]['size'] `, 1)
self.SetItemText(found, " "+result[file]['date'][1], 2)
self.SetItemText(found, result[file]['unknown1'], 3) <----- This is
my new line
if self.datacolumn:
self.SetItemText(found, result[file]['data'], 3)
I of course get an error because the 'unknown1' element doesn't exist in the
result[file] associative array (Perl terminology, sorry if it's not right
for Python). I've hunted a good bit for the section of code that populates
this associative array so I can kindly ask it to include the 'unknown1'
element in there, but have had no luck so far.
Of course if I change the line to read:
self.SetItemText(found, "Hi There", 3)
instead, then it says "Hi There" for every file, in my new Unknown1 column,
so I know I've hacked to the right place.
Please forgive my lack of Python knowledge - I think I'm doing rather well
for a Perl programmer who doesn't know a lick of Python. I think here
however that it is simply my lack of familiarity about which parts of the
program build the various complex data structures in memory that is holding
me up.
----- Original Message -----
From: "Roger Binns" <[email protected]>
To: <[email protected]>
Sent: Wednesday, July 13, 2005 12:01 AM
Subject: Re: [BitPim-devel] Re: Hacking BitPim to delete locked files
> Look in the fields for listing directories and for opening files for
> writing. Both include a four byte field which is probably the
> attributes. You may get somewhere figuring out what they are.
>
> Roger
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar