On Sun, 2006-07-16 at 20:24 -0700, Michael Beal wrote:
> Hello all!
Hi Michael! Welcome to the list.
> I'm new to Freevo development and have fixed a few things in version
> 1.5.3 in the last week. I'd like to share those fixes with everyone.
Your efforts are definitely appreciated, and I will commit your fix
(slightly modified) to the 1.5 branch in svn. Unfortunately I'm not
sure if we plan on releasing a new version of 1.5. All of our current
attentions are focused on trunk, which is what will become freevo 2.0.
> To fix this, I changed:
Changes are best submitted in form of a patch. You can use the diff
utility. (diff -Naur oldfile newfile is the basic command) When
attached to the email, this avoids any possible formatting problems, as
what occurred in your post. (And in Python, messed up formatting also
means messed up semantics.)
> # Changed to use binary calculations
> space = getattr(util, key)(self.dir) / 1048576
Ok, so you're changing units from MB to MiB. I'm sorta of two minds
about this one. The geek in me insists everything be in binary units.
However, in practice, because disk manufacturers specify disk sizes in
GB and not GiB (i.e. powers of 10, not powers of 2), users will better
identify with disk usage specified in the same units.
So I think we should keep it at 1000000. dischi, what say you?
> if space > 1024:
> high = str(space / 1024)
> low = str(space % 1024)
> space='%s,%s' % (high, low.zfill(3))
> return space
Ok, well no matter what units we decide to use, this isn't right. The
purpose of this code isn't to change from MB to GB, but rather to format
the value in comma delimited groups. If you have 10000 apples, you
don't have 9,765 apples. You have 10,000 apples.
So this code is better written as:
if space > 1024:
return "%d,%.03d" % (space / 1000, space % 1000)
One problem here is that this code falls apart when the disk usage is
terabytes. :) Also, what about locale? Not every locale uses a comma
to separate groups this way. This code solves both problems:
import locale
space = getattr(util, key)(self.dir) / 1000000
locale.setlocale(locale.LC_ALL, '')
return locale.format('%d', space, True)
(dischi, is freevo 2.0 using proper locale in the appropriate places?)
> let me know. I'll post the new mixer.py when I'm finished.
I'd certainly like to encourage you to hack on Freevo 2.0 instead. The
barrier to entry is higher unfortunately, but it's where all current
development effort is being focused so you'll get more return on your
time investment. :)
Cheers,
Jason.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel