1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PyTivo Video Manager HME App for pyhme

Discussion in 'Developers Corner' started by jbernardis, Apr 20, 2011.

  1. innocentfreak

    innocentfreak Active Member

    8,950
    3
    Aug 25, 2001
    Florida
    Thanks, yeah that would work for me. Like all the stuff I am seeing so far. I just wish I had more time to sit down and play with it.
     
  2. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Alright - I think this should please everyone. 0.6b is available at github.

    I added scaling back in, but only for images that are too large. It compares the image height to the view height, and the image width to the view width, and chooses the ratio that is the larger of the two to apply to both axes.


    Again, as I noted in my earlier message, the cache will not think that its contents are out of date, so images that are too big that are already in the cache will not be reread. It is best to simply delete the cache before restarting the server.
     
  3. innocentfreak

    innocentfreak Active Member

    8,950
    3
    Aug 25, 2001
    Florida
    Thanks so far looks to be working great.
     
  4. orangeboy

    orangeboy yes, I AM orangeboy!

    4,083
    0
    Apr 19, 2004
    East Moline, IL
    Sound familiar 'freak? :D
     
  5. innocentfreak

    innocentfreak Active Member

    8,950
    3
    Aug 25, 2001
    Florida
    Lol someone got me in the habit so I planned to do it even if he didn't tell me to ;)
     
  6. westside_guy

    westside_guy Annoyingly ephemeral

    464
    1
    Mar 13, 2005
    The soggy...
    Python is installed on the Mac by default - and this works very well on my Mac.
     
  7. cweb

    cweb New Member

    106
    0
    May 29, 2004
    I'm attempting to get vidmgr running under osx for me. When I run start.py I get the message: "Skipping: vidmgr - No module named Image".

    Any clue what it is looking for?
     
  8. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Yes - it's looking for the python image library. Google "PIL", and download and install the version that goes with your python. Then this should go away.

    I use the PIL to resize thumbnail images if they are too big.
     
  9. cweb

    cweb New Member

    106
    0
    May 29, 2004
    Well after what seemed like a zillion hours, I got PIL to install on my OS X 10.6.7 with python 2.7.2. and vidmgr starts up. However, when I access the app from my tivo it just immediately exits back to the "Music, Photos, & Showcases" screen.

    It seems that at least one problem is it doesn't like the path to the pyTivo.conf file (~/Library/'Application Support'/pyTivoX/). It appears the space throws it. Quotes doesn't seem to help.

    Any thoughts. Thanks.
     
  10. lew

    lew Active Member

    3,961
    3
    Mar 12, 2002
    What metadata program are you using?
     
  11. innocentfreak

    innocentfreak Active Member

    8,950
    3
    Aug 25, 2001
    Florida
    I use sick beard. It wasn't designed for my usage, but I like it. It makes it much easier to organize and track even the shows I don't transfer to my pc.
     
  12. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I would try putting the entire string in quotes - not just the part with the space: ( '~/Library/Application Support/pyTivoX/' ). I don't have a mac though so I can't test this idea.

    The parsing of the config file is done with the python configparser module, and I'm not sure of the details of its operation. The doc page (http://docs.python.org/library/configparser.html) doesn't really say anything about this situation.
     
  13. cweb

    cweb New Member

    106
    0
    May 29, 2004
    I tried your single quotes response (both with ~ and with full path) with no luck. Its's the space between Application and Support that is throwing it.

    As an experiment, I copied pytivo.conf to a temp directory with no spaces in the path and the program worked great! I just need a way to correctly parse the real path. I don't believe pytivo or pytivox allows you to specify a settings directory.
     
  14. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Here is the code that reads in the config file name:
    key = "pytivo" + str(i) + ".config"
    if not cfg.has_option(section, key): break
    cfgfile = cfg.get(section, key)
    self.parseCfgFile(cfgfile, ip, port, sep)


    and here is the code that reads the config file:
    def parseCfgFile(self, cf, ip, defport, sep):
    pyconfig = ConfigParser.ConfigParser()
    configs_found = pyconfig.read(cf)


    I'm not doing any processing or manipulation of the filename. I'm just reading in the string using a configparser get method and I'm passing that string to the configparser read method. SOmewhere in there this is happening, but there is nothing (at least evident to me) that I can do differently in the vidmgr code.

    Does anybody on a MAC have any insight into this?

    Have you tried without any quoting whatsoever?
     
  15. cweb

    cweb New Member

    106
    0
    May 29, 2004
    Problem solved. I looked at other python apps (pytivo and streambaby) to see how there configs laid out the path name. I have to use the whole path name (/Users/xxxxx/Library/Application Support/pyTivoX/pyTivo.conf with no quotes) vs the short hand path (~/Library/Application Support/pyTivoX/pyTivo.conf).

    I thought I had done this previously a couple of times before, but perhaps there was a spelling error along the way. Anyway it now works.

    Thanks.
     
  16. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    In *nix (and probably the Mac) the interpreter (bash, ksh, csh, etc) expands the ~ into the home directory name, but if the ~ is enclosed in quote marks, then it is taken to be a literal - which is to say a directory named "~". OTOH, placing quote marks within the interior of the path is probably not a valid expression for Python. The bottom line is, putting unexpanded expressions like ~ or * in a config file is not generally a good idea unless you know for a fact the interpreter you are using will expand the expressions in the way you think it will. Even then, it's not a terribly good idea.
     
  17. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Yeah - I know nothing of MAC's either, but on Unix systems, the ~ and * expressions used in filenames (known as globbing) is expanded by the shell. The program being invoked knows nothing about whether or not these expressions are used - it simply receives a list of fully expanded matching filenames.
     
  18. wmcbrine

    wmcbrine Ziphead

    10,367
    22
    Aug 2, 2003
    OS X is just another flavor of BSD at this level. It is a Unix system.
     
  19. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    That I knew. What I don't now is what interpreters it employs at the CL, and of course I'm not directly familiar with how Python interprets strings.
     
  20. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    In terms of what is received from parameters passed by stdin, I would expect this to be true, but not necessarily from a config file read directly by the interpreter - in this case Python. Unless I misread the original post, he's putting this expression in a config file, isn't he? I don't recall that I have ever attempted to pass a globbed expression to the kernel. I wouldn't expect it to work, so I've never even tried.
     

Share This Page