On Sun, Mar 22, 2009 at 11:33 AM, Davide Alberani <davide.alber...@gmail.com
> wrote:
> On Mar 21, Kanesodi <kanes...@gmail.com> wrote:
>
> > > Please, be sure to use vdbpy 1.1 _and_ IMDbPY 4.0.
> >
> > You're right, my mistake was using 3.6 version
>
> Good to know. :-)
>
> > For sake of search engines and users who might come across this mail,
> > here is a little guide:
>
> Thanks!
>
> > My source here would be simple command ls My files are located on
> > a FreeNAS system (BSD),
>
> Cool. :-)
>
> > using command-line I execute ls > ls.txt which gives me a file
> > containing a list of folders like this:
>
> A list of directory names? Out of curiosity, what program originated
> them?
>
> > one movie on each line. Then I would clean up the file removing years
> > (or maybe not needed).
>
> No need to strip the year.
>
> > And here I'm stuck.. how can I get vdbpy to read every line and
> > generate files like dump function does?
>
> vdbpy_batch.py was thought to fetch info from the videoDB database,
> and then update missing information, so in my opinion your best chance
> is to modify it to suit your needs.
>
> My idea (untested):
> starting from line 139, remove the first 11 lines (they handle the
> connection to the database) and replace them with a quick-and-dirty
> hack like:
> titlesFd = open('/path/to/your/list/of/title.txt', 'r')
> # there 2 lines replace 'for vid, title, imdbID in movies:'
> for line in titlesFd:
> vid, title, imdbID = 0, line.strip(), ''
>
I tried and it worked!! not the first time but with a bit searching I
managed to get it working.
The problem was indent and space stuff python is picky about. So I opened
the original version of this email and cut&paste the way you intended to be.
Along the way I also got an error: NameError: name 'i' is not defined
I just copied line 142 of unmodified vdbpy_batch.py and
paste it just after vid, title, imdbID = 0, line.strip(), ''
>
>
> And then, to convert the 'update' step in an 'insert', change:
> cmd = 'vdbpy_add.py -f "%s" -u "%s"' % (CONF_FILE, vid)
> to
> cmd = 'vdbpy_add.py -f "%s"' % CONF_FILE
I forgot to do this, since I always use a clean set of files every tryout
order to avoid mistakes by doing too much and creating problems which cause
you taking medicine and being locked away because of madness :P
>
>
> After than you should be able to run 'vdbpy_batch.py dump' to
> read every lines in your list of title; it will create a file
> for every title, with the results of the search.
> Following the BATCH.txt instructions, edit these files (if there
> are too many: give up and hope the first match is the right one ;-)
> and then run 'vdbpy_batch.py update'.
True, after running vdbpy_batch.py every file contains atleast 10 or more
results The first being the correct one and the rest I consider
"suggestions" or are foreign movies with English names.
>
>
> It goes without saying that it could mess up your database, so
> a backup is mandatory. :-)
Real man don't backup, they do cry alot hihi.
Seriously, I always create an enviorement for testing, to make sure I know
what to do or what I have done. In this case I setup a fresh install XAMPP
and a fresh unpacked vdbpy-1.1
besides, I lost all my videodb data a month ago, so there's not much to be
lost :P
>
>
>
> HTH,
It sure did ;-)
Regards,
PS. Maybe some info you might find intresting. Along the way I got some
errors, which I now know what caused it. For you, and others who might come
across:
IndentationError: unexpected indent
Happens when you copy (python) code from original email. Gmail and probly
other email providers use styles to layout the email, which means they might
add extra spaces or tabs. Python is picky about spaces and tabs. Solution:
open original email (in gmail Click the down arrow next to *Reply*, at the
top-right of the message, choose Show original)
Connecting to the VideoDB database...
Unable to connect to the database.
(2002, "Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)")
use 127.0.0.1 instead of localhost in /etc/vdbpyrc ( this is probly
Xampp/MySQL issue)
> --
> Davide Alberani <davide.alber...@gmail.com> [PGP KeyID: 0x465BFD47]
> http://erlug.linux.it/~da/ <http://erlug.linux.it/%7Eda/>
>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Imdbpy-devel mailing list
Imdbpy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel