Ignore:
Timestamp:
04/20/12 03:15:24 (2 years ago)
Author:
mitar
Branch:
default
Message:

Support for widgets loading from modules, registered through entry point.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/orng/widgetParser.py

    r9671 r10827  
    1818 
    1919class WidgetMetaData: 
    20     xmlAttrs = ["name", "description", "contact", "category", "icon", "hasDoc"] 
     20    xmlAttrs = ["name", "description", "contact", "category", "icon", "hasDoc", "prototype"] 
    2121     
    2222    def __init__(self, data, defaultCategory="Prototypes", enforceDefaultCategory=False, filename=None, hasDoc="0"):  # data can either be a string with module (.py file) contents or an xml.dom.Element 
     
    2828            self.category="" 
    2929            self.tags="" 
     30            self.prototype="0" 
    3031            self.filename=None 
    3132            self.hasDoc = hasDoc 
     
    3839        else:   # python module 
    3940            setattr(self, "filename", filename) 
    40             for attr, deflt in (("name", None), ("contact", "") , ("icon", "icons/Unknown.png"), ("priority", "5000"), ("description", ""), ("category", defaultCategory), ("tags", "")): 
     41            for attr, deflt in (("name", None), ("contact", "") , ("icon", "icons/Unknown.png"), ("priority", "5000"), ("description", ""), ("category", defaultCategory), ("tags", ""), ("prototype", "0")): 
    4142                istart, iend = data.find("<"+attr+">"), data.find("</"+attr+">") 
    4243                setattr(self, attr, istart >= 0 and iend >= 0 and data[istart+2+len(attr):iend].strip() or deflt) 
Note: See TracChangeset for help on using the changeset viewer.