--- Dirk Meyer <[EMAIL PROTECTED]> escreveu: > Gustavo Sverzut Barbieri wrote: > > using item.gettattr( b ) you get a string... if you want to know > how > > many items you have in a playlist you will get how many chars have > in > > the text represention of that array. > > > > Also, I didn't understand this code: > > elif b[:4] == 'len(' and b.find(')') > 0 and \ > > len(b) - b.find(')') < 5: > > exp += ' item.getattr("%s") %s' % \ > > (b[:b.find(')')+1], \ > > b[b.find(')')+1:]) > > > > why the clause: len(b) - b.find(')') < 5 ? > > because I want to prevent something like > 'len(b) > os.system(rm -rf ~)'
Good :) But len(BLA) > 123345 won't work > That's the reason why I only want to allow 'and', 'or', 'not' and > len(x)[>|==][0-9]. BTW, I will move that exp building into the xml > file to calculate this only once. But sometimes that will be a problem. IE: in the playlist (file) until you load that playlist it will display "this playlist is empty". After you load that playlist, you will get the real number of items in that. > > also, how you get the length using that? :) > > I hope I checked in a modified item.py. Then you send > item.getattr('len(playlist)') and getattr has a special handler for > len(). Ok, it worked :) > >> Yes, getattr(a) is the way to go. It searches for item.a and for > >> item.info[a]. Every item has this function. > > > > Ok, but how to workaround the problem of len()? > > I hope it works for you now. yes Gustavo _______________________________________________________________________ Yahoo! Mail Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção contra spam. http://br.mail.yahoo.com/ ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Freevo-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-devel