Пример #1
0
def InitPathsAndBuiltins():
    import cFunctions
    import __builtin__

    eg.folderPath = eg.FolderPath()
    eg.mainDir = eg.folderPath.mainDir
    eg.configDir = eg.folderPath.configDir
    eg.corePluginDir = eg.folderPath.corePluginDir
    eg.localPluginDir = eg.folderPath.localPluginDir
    eg.imagesDir = eg.folderPath.imagesDir
    eg.languagesDir = eg.folderPath.languagesDir
    eg.sitePackagesDir = eg.folderPath.sitePackagesDir

    if not exists(eg.configDir):
        try:
            makedirs(eg.configDir)
        except:
            pass

    if not exists(eg.localPluginDir):
        try:
            makedirs(eg.localPluginDir)
        except:
            eg.localPluginDir = eg.corePluginDir

    if eg.Cli.args.isMain:
        if exists(eg.configDir):
            chdir(eg.configDir)
        else:
            chdir(eg.mainDir)

    __builtin__.wx = wx

    corePluginPackage = ModuleType("eg.CorePluginModule")
    corePluginPackage.__path__ = [eg.corePluginDir]
    userPluginPackage = ModuleType("eg.UserPluginModule")
    userPluginPackage.__path__ = [eg.localPluginDir]

    sys.modules["eg.CorePluginModule"] = corePluginPackage
    sys.modules["eg.UserPluginModule"] = userPluginPackage
    sys.modules['eg.cFunctions'] = cFunctions

    eg.pluginDirs = [eg.corePluginDir, eg.localPluginDir]
    eg.cFunctions = cFunctions
    eg.CorePluginModule = corePluginPackage
    eg.UserPluginModule = userPluginPackage
Пример #2
0
eg.globals.eg = eg
eg.event = None
eg.eventTable = {}
eg.eventString = ""
eg.notificationHandlers = {}
eg.programCounter = None
eg.programReturnStack = []
eg.indent = 0
eg.pluginList = []
eg.mainThread = threading.currentThread()
eg.stopExecutionFlag = False
eg.lastFoundWindows = []
eg.currentItem = None
eg.actionGroup = eg.Bunch()
eg.actionGroup.items = []
eg.folderPath = eg.FolderPath()

def _CommandEvent():
    """Generate new (CmdEvent, Binder) tuple
        e.g. MooCmdEvent, EVT_MOO = EgCommandEvent()
    """
    evttype = wx.NewEventType()

    class _Event(wx.PyCommandEvent):
        def __init__(self, id, **kw):
            wx.PyCommandEvent.__init__(self, evttype, id)
            self.__dict__.update(kw)
            if not hasattr(self, "value"):
                self.value = None

        def GetValue(self):