1. biolab
  2. Untitled project
  3. orange


orange / Orange / __init__.py

astaric d26f235 
astaric 510c2b5 
mitar b8aa619 

astaric bbad223 
mitar eafe1ac 

Miha Stajdohar 4d70c10 
Aleš Erjavec 51b3ee9 
Miha Stajdohar 4d70c10 

Aleš Erjavec 51b3ee9 
mitar 8527a75 

Aleš Erjavec 51b3ee9 
mitar eafe1ac 
Aleš Erjavec 51b3ee9 

Aleš Erjavec ad313b1 
mitar eafe1ac 

mitar 0baeb90 

mitar 56092f8 

mitar 0baeb90 

mitar eafe1ac 

Aleš Erjavec 1707c80 

mitar 0baeb90 
Aleš Erjavec 1707c80 
mitar eafe1ac 
Marko Toplak cd73789 

Aleš Erjavec 51b3ee9 

astaric f9e50d3 

Aleš Erjavec 51b3ee9 

Aleš Erjavec ad313b1 
Aleš Erjavec 51b3ee9 
astaric 38a9de5 
Aleš Erjavec 51b3ee9 

Blaz Zupan 7889130 
Aleš Erjavec 51b3ee9 

Marko Toplak c4cbae8 

Marko Toplak 94a831b 

mitar eafe1ac 

astaric 510c2b5 
Aleš Erjavec 51b3ee9 

astaric a7b0563 
Marko Toplak 52d5b2c 
mitar eafe1ac 
Marko Toplak 52d5b2c 
from __future__ import absolute_import

# This is overwritten with version from version.py, which is generated by
# setup.py automatically
__version__ = "unknown"

ADDONS_ENTRY_POINT = 'orange.addons'

import os, sys

if not os.environ.get('READTHEDOCS', None):
    from . import orange
    # Definitely ugly, but I see no other workaround.
    # When, e.g. data.io executes "from orange import ExampleTable"
    # orange gets imported again since it is not in sys.modules
    # before this entire file is executed
    sys.modules["orange"] = orange

# Little trick so that legacy imports work automatically
import Orange.orng
sys.path = Orange.orng.__path__ + sys.path

import warnings
import pkg_resources

alreadyWarned = False
disabledMsg = "Some features will be disabled due to failing modules\n"
def _import(name):
    global alreadyWarned
        __import__(name, globals(), locals(), [], -1)
    except ImportError, err:
        warnings.warn("%sImporting '%s' failed: %s" %
            (disabledMsg if not alreadyWarned else "", name, err),
            UserWarning, 2)
        alreadyWarned = True

def _import_addons():
    globals_dict = globals()
    for entry_point in pkg_resources.iter_entry_points(ADDONS_ENTRY_POINT):
            module = entry_point.load()
            # Dot is not allowed in an entry point name (it should
            # be a Python identifier, because it is used as a class
            # name), so we are using __ instead
            name = entry_point.name.replace('__', '.')
            if '.' not in name:
                globals_dict[name] = module
                path, mod = name.rsplit('.', 1)
                parent_module_name = 'Orange.%s' % (path,)
                    parent_module = sys.modules[parent_module_name]
                except KeyError:
                    warnings.warn("Loading add-on '%s' failed because destination namespace point '%s' was not found." % (entry_point.name, parent_module_name), UserWarning, 2)
                setattr(parent_module, mod, module)
            sys.modules['Orange.%s' % (name,)] = module
        except ImportError, err:
            warnings.warn("Importing add-on '%s' failed: %s" % (entry_point.name, err), UserWarning, 2)
        except pkg_resources.DistributionNotFound, err:
            warnings.warn("Loading add-on '%s' failed because of a missing dependency: '%s'" % (entry_point.name, err), UserWarning, 2)
        except Exception, err:
            warnings.warn("An exception occurred during the loading of '%s':\n%r" %(entry_point.name, err), UserWarning, 2)





















_import("utils") #TODO hide utils from the user


    from . import version
    # Always use short_version here (see PEP 386)
    __version__ = version.short_version
    __hg_revision__ = version.hg_revision
except ImportError:
    # Leave the default version defined at the top.

del _import
del _import_addons
del alreadyWarned
del disabledMsg