FabiUnne / youtube-upload

Automatically exported from code.google.com/p/youtube-upload
0 stars 0 forks source link

from xml.etree import ElementTree #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After lots of testing in my Dev envt I have hit a issue on my Production 
server.  My hosting company only give me Python 2.4.3.

I suspect this is a issue as this "from xml.etree import ElementTree" command 
seems to kill the script.

Do you know of any work arounds, or am I stuck, and really need a new host with 
2.5 ?

thanks

What version of youtube-upload are you using? On what operating system?
0.4

Please provide any additional information:

Original issue reported on code.google.com by cam...@campersalmanac.com on 5 Oct 2010 at 10:53

GoogleCodeExporter commented 9 years ago
You can check if your distro has a backport named python2.4-elementtree or 
similar.

If not, you can mock "get_categories" so it returns a static dict with pairs 
(term, label). 

Original comment by tokland on 5 Oct 2010 at 11:12

GoogleCodeExporter commented 9 years ago
Sorry mate, my Python is not that good, I have confirmed I dont have 
python2.4-elementtree .

Are you able to give me more info on the mock "get_categories" ?

Original comment by cam...@campersalmanac.com on 5 Oct 2010 at 11:37

GoogleCodeExporter commented 9 years ago
I only ever use the Travel category.   Can I do something like the below?

    @classmethod
    def get_categories(cls):
        """Return categories dictionary with pairs (term, label)."""
        #def get_pair(element):
        #    """Return pair (term, label) for a (non-deprecated) XML element."""
        #    if all(not(str(x.tag).endswith("deprecated")) for x in element.getchildren()):
         #       return (element.get("term"), element.get("label"))            
        #xmldata = urllib.urlopen(cls.CATEGORIES_SCHEME).read()
        #xml = ElementTree.XML(xmldata)
        return ('Travel', 'Travel')

Original comment by cam...@campersalmanac.com on 5 Oct 2010 at 12:35

GoogleCodeExporter commented 9 years ago
It expects a dictionary:

return {"Travel": "Travel"}

Original comment by tokland on 5 Oct 2010 at 1:24

GoogleCodeExporter commented 9 years ago

Original comment by tokland on 13 May 2014 at 2:55