Also need some help with Python, having a problem with Unescaping single quotes:
The problem is arises in 05 Twilight Zone - after 7 that is two single quotation marks next to each other.
"SMBFS5:itunes/iTunes Media/Music/2 Unlimited/The Complete History/04 Faces [Radio Edit].mp3" "SMBFS5:itunes/iTunes Media/Music/2 Unlimited/The Complete History/05 Twilight Zone [7'' Vocal].mp3" "SMBFS5:itunes/iTunes Media/Music/2 Unlimited/The Complete History/06 Maximum Overdrive.mp3" "SMBFS5:itunes/iTunes Media/Music/2 Unlimited/The Complete History/08 Get Ready For This [Radio Edit].mp3" "SMBFS5:itunes/iTunes Media/Music/2 Unlimited/The Complete History/07 Let The Beat Control Your Body [Airplay Edit].mp3" Traceback (most recent call last): File "python:scripts/jack_getalbumartwork.py", line 10, in file = File(filename) File "PYTHON:Lib/site-packages/mutagen/__init__.py", line 203, in File fileobj = file(filename, "rb") IOError: [Errno 20] Not a directory: ''
The standard C library startup code defines the main() entry point of a program having the following prototype:
int main( int argc, char** argv )
Basically, this means that the amount of arguments is limited to, at least, a 16bit number (0 -> 65535).
And further up the chain the real entry point used by CreateNewProc is defined as _start( STRPTR args, int32 arglen, ...), so this implies the string containing the arguments be limited to a signed long word (0 -> 2147483648). This equates to a string no longer than 2GB. Adding thousands of arguments into a string, each with a path of 512bytes, means a theoretical limit of almost 4.2 million arguments. Given that this is way beyond the 16bit argument count in main(), I'd say we found the biggest limitation.
Whether there are any other limitations impposed by DOS itself, I'm not sure, it's not something I've ever looked into. I would assume parsing 9000+ parameters would be very slow, especially if the program is using ReadArgs().
You may be better off to call the program once for each entry, but only a timed test of both situations will really tell you.
Simon
Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such. ---- http://codebench.co.uk
Seems I need to investigate a little further anyhow as I am taking the wrong approach -iTunes doesn't embed artwork by default it stores it in a series of folders.
There is a Python module to decipher itc files, but first I need to decipher the folder structure.
Whether there are any other limitations impposed by DOS itself, I'm not sure, it's not something I've ever looked into.
The Shell has a much shorter limit (not sure what it is, maybe 1K), which can be worked around by creating a script with the command line in and executing that.
Not sure if the Shell supports concatenation of multiple lines.
Left Window: Shows raw output coming from Python to convert iTunes cover artwork.
Right Window: The local artwork drawer containing images converted from ict to png.
Middle: Selection of Windows showing cover artwork.
All track information is also gathered using Python.
As a benchmark, I have over 9000+ songs in my iTunes. Using Jack and Python it took less than 5 minutes to gather all album artwork across the network!
by djrikki Also need some help with Python, having a problem with Unescaping single quotes...
It's not about 'unescaping quotes', it;s about Python Dos ways and formatted List files. You need to read Chapter 3.14:Lists and Chapter 5:Data Structures, in Python - Docs 2.5/tut/tut.html
Actually - just worked it out - its not the Python script after all - its fine! I haven't figured what your script is doing. I don't see any definitions...
There is a Python module to decipher itc files, but first I need to decipher the folder structure. <key>Library Persistent ID</key><string>76710B0D0E49CFBE</string> That's a typical Python 'Dictionary' format.