Code Monkey home page Code Monkey logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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

from youtube-upload.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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 [email protected] on 5 Oct 2010 at 11:37

from youtube-upload.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
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 [email protected] on 5 Oct 2010 at 12:35

from youtube-upload.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
It expects a dictionary:

return {"Travel": "Travel"}

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

  • Changed state: Done

from youtube-upload.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024

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

from youtube-upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.