Ignore:
Timestamp:
04/21/12 23:49:28 (2 years ago)
Author:
mitar
Branch:
default
Message:

Support also add-ons in Python eggs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/utils/environ.py

    r10582 r10838  
    9797import os, sys 
    9898import ConfigParser 
     99import pkg_resources 
     100from pkg_resources import working_set 
    99101 
    100102def _path_fix(): 
     
    297299add_orange_directories_to_path() 
    298300directories = dict([(dname, globals()[dname]) for dname in _ALL_DIR_OPTIONS]) 
     301 
     302def load_eggs(search_path): 
     303    distributions, errors = working_set.find_plugins( 
     304        pkg_resources.Environment(search_path) 
     305    ) 
     306    map(working_set.add, distributions) 
     307 
     308    if errors: 
     309        import warnings 
     310        warnings.warn("Error loading eggs: %s" % (errors,)) 
     311 
     312load_eggs([add_ons_dir_user]) 
Note: See TracChangeset for help on using the changeset viewer.