Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from xml.etree import ElementTree #18

Closed
GoogleCodeExporter opened this issue Jan 29, 2016 · 5 comments
Closed

from xml.etree import ElementTree #18

GoogleCodeExporter opened this issue Jan 29, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

It expects a dictionary:

return {"Travel": "Travel"}

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

  • Changed state: Done

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant