Example #1
0
 def createChildNode(self, name):
     mod = importFromWxPyDemo(name)
     if mod is None:
         return None
     else:
         demoFile = os.path.splitext(mod.__file__)[0]+'.py'
         imgIdx = Controllers.identifyFile(demoFile)[0].imgIdx
         return wxPythonDemoNode(name, demoFile, self.clipboard, imgIdx, 
                                 self, self.bookmarks)
Example #2
0
 def createChildNode(self, name):
     mod = importFromWxPyDemo(name)
     if mod is None:
         return None
     else:
         demoFile = os.path.splitext(mod.__file__)[0] + '.py'
         imgIdx = Controllers.identifyFile(demoFile)[0].imgIdx
         return wxPythonDemoNode(name, demoFile, self.clipboard, imgIdx,
                                 self, self.bookmarks)
Example #3
0
    def __init__(self, name, resourcepath, clipboard, imgIdx, parent,
                 xmlrpcsvr, root, properties, metatype):
        Mod = Controllers.identifyFile(os.path.basename(resourcepath),
                                       localfs=False)[0]
        imgIdx = Mod.imgIdx
        self.defaultViews = self.supportedViews.get(Mod.modelIdentifier,
                                                    (SourceViews.TextView, ))

        LFSNode.__init__(self, name, resourcepath, clipboard, imgIdx, parent,
                         xmlrpcsvr, root, properties, metatype)
    def __init__(self, name, resourcepath, clipboard, imgIdx, parent, xmlrpcsvr,
          root, properties, metatype):
        Mod = Controllers.identifyFile(
              os.path.basename(resourcepath), localfs=False)[0]
        imgIdx = Mod.imgIdx
        self.defaultViews = self.supportedViews.get(Mod.modelIdentifier,
              (SourceViews.TextView,))

        LFSNode.__init__(self, name, resourcepath, clipboard, imgIdx,
              parent, xmlrpcsvr, root, properties, metatype)
Example #5
0
 def createChildNode(self, name, isFolder, props, respath=''):
     if not respath:
         respath = self.resourcepath+'/'+name
     item = SSHItemNode(name, props, respath, self.clipboard,
           isFolder, isFolder and EditorHelper.imgFolder or \
           EditorHelper.imgTextModel)
     if not isFolder:
         item.imgIdx = Controllers.identifyFile(name, localfs=False)[0].imgIdx
     item.category = self.category
     item.bookmarks = self.bookmarks
     return item
Example #6
0
    def createChildNode(self, entry, value, forceFolder=True):
        if forceFolder: Node = NonCheckPyFolderNode
        else: Node = FileSysNode

        node = Node(entry, value, self.clipboard, -1, self, self.bookmarks)
        if node.isFolderish():
            node.imgIdx = EditorHelper.imgFSDrive
        else:
            node.imgIdx = Controllers.identifyFile(value #localfs=node.filter == 'BoaFiles'
                                                  )[0].imgIdx
        return node
Example #7
0
    def createChildNode(self, name, resourcepath, isFolder):

        imgIdx = isFolder and EditorHelper.imgFolder or \
              EditorHelper.imgTextModel
        if not isFolder:
            from Models import Controllers
            imgIdx = Controllers.identifyFile(name, localfs=False)[0].imgIdx
        zin = self.ChildClass(name, resourcepath and resourcepath+'/'+name or name,
              self.clipboard, isFolder, imgIdx, self, self.zipFileNode, self.ChildClass)
        zin.category = self.category
        return zin
Example #8
0
    def createChildNode(self, entry, value, forceFolder=True):
        if forceFolder: Node = NonCheckPyFolderNode
        else: Node = FileSysNode

        node = Node(entry, value, self.clipboard, -1, self, self.bookmarks)
        if node.isFolderish():
            node.imgIdx = EditorHelper.imgFSDrive
        else:
            node.imgIdx = Controllers.identifyFile(
                value  #localfs=node.filter == 'BoaFiles'
            )[0].imgIdx
        return node
Example #9
0
    def createChildNode(self, name, resourcepath, isFolder):

        imgIdx = isFolder and EditorHelper.imgFolder or \
              EditorHelper.imgTextModel
        if not isFolder:
            from Models import Controllers
            imgIdx = Controllers.identifyFile(name, localfs=False)[0].imgIdx
        zin = self.ChildClass(
            name, resourcepath and resourcepath + '/' + name or name,
            self.clipboard, isFolder, imgIdx, self, self.zipFileNode,
            self.ChildClass)
        zin.category = self.category
        return zin
Example #10
0
    def createChildNode(self, name, props):
        if not name: name = '/'

        if name[-1] == '/':
            basename = os.path.basename(name[:-1])
            isFolder = True
        else:
            basename = os.path.basename(name)
            isFolder = False
        item = DAVItemNode(basename, props, name, self.clipboard,
              isFolder and EditorHelper.imgFolder or EditorHelper.imgTextModel, self)
        if not isFolder:
            item.imgIdx = \
                  Controllers.identifyFile(name, localfs=False)[0].imgIdx
        item.category = self.category
        item.bookmarks = self.bookmarks
        return item
Example #11
0
    def createChildNode(self, name, props):
        if not name: name = '/'

        if name[-1] == '/':
            basename = os.path.basename(name[:-1])
            isFolder = True
        else:
            basename = os.path.basename(name)
            isFolder = False
        item = DAVItemNode(
            basename, props, name, self.clipboard,
            isFolder and EditorHelper.imgFolder or EditorHelper.imgTextModel,
            self)
        if not isFolder:
            item.imgIdx = \
                  Controllers.identifyFile(name, localfs=False)[0].imgIdx
        item.category = self.category
        item.bookmarks = self.bookmarks
        return item
Example #12
0
    def createChildNode(self, obj, root, respath=None, createConnection=False):
        if respath is None:
            respath=self.resourcepath+'/'+obj.name
        elif respath[0] != '/':
            respath = '/'+respath

        if createConnection:
            item = FTPConnectionNode(obj.name, self.properties, respath,
                self.clipboard, self)
        else:
            item = FTPItemNode(obj.name, self.properties, respath,
                  self.clipboard, False, -1 , self, self.ftpConn, obj, root)

        if item.isFolderish():
            item.imgIdx = EditorHelper.imgFolder
        else:
            item.imgIdx = Controllers.identifyFile(obj.name, localfs=False)[0].imgIdx
        item.category = self.category
        item.bookmarks = self.bookmarks
        return item
Example #13
0
    def createChildNode(self, file, filename=''):
        if not filename:
            filename = os.path.join(self.resourcepath, file)

        ext = os.path.splitext(filename)[1].lower()
        exts, extSubTypes = self.getFilterExts()
        # Files
        if ('.*' in exts or ext in exts) and os.path.isfile(filename):
            for Other, otherIdFunc, imgIdx in self.subExplorerReg['file']:
                if '*' in self.allowedProtocols or \
                      Other.protocol in self.allowedProtocols:
                    if otherIdFunc(filename):
                        return 'fol', Other(file, filename, self.clipboard,
                                            imgIdx, self, self.bookmarks)
            Model = Controllers.identifyFile(filename)[0]
            if extSubTypes.has_key(ext):
                for SubTypeModel in extSubTypes[ext]:
                    if issubclass(Model, SubTypeModel):
                        break
                else:
                    return '', None
            return 'mod', FileSysNode(file, filename, self.clipboard,
                                      Model.imgIdx, self, self.bookmarks, {})
            #{'datetime': time.strftime('%a %b %d %H:%M:%S %Y',
            #             time.gmtime(os.stat(filename)[stat.ST_MTIME]))})
        # Directories
        elif os.path.isdir(filename):
            for other, otherIdFunc, imgIdx in self.subExplorerReg['folder']:
                if self.filter == 'BoaFiles' and \
                  '*' in self.allowedProtocols or '*' in self.allowedProtocols or \
                      other.protocol in self.allowedProtocols:
                    if otherIdFunc(filename):
                        return 'fol', other(file, filename, self.clipboard,
                                            imgIdx, self, self.bookmarks)
            return 'fol', FileSysNode(file, filename, self.clipboard,
                                      EditorHelper.imgFolder, self,
                                      self.bookmarks)
        else:
            return '', None
Example #14
0
    def createChildNode(self, file, filename = ''):
        if not filename:
            filename = os.path.join(self.resourcepath, file)

        ext = os.path.splitext(filename)[1].lower()
        exts, extSubTypes = self.getFilterExts()
        # Files
        if ('.*' in exts or ext in exts) and os.path.isfile(filename):
            for Other, otherIdFunc, imgIdx in self.subExplorerReg['file']:
                if '*' in self.allowedProtocols or \
                      Other.protocol in self.allowedProtocols:
                    if otherIdFunc(filename):
                        return 'fol', Other(file, filename, self.clipboard,
                              imgIdx, self, self.bookmarks)
            Model = Controllers.identifyFile(filename)[0]
            if extSubTypes.has_key(ext):
                for SubTypeModel in extSubTypes[ext]:
                    if issubclass(Model, SubTypeModel):
                        break
                else:
                    return '', None
            return 'mod', FileSysNode(file, filename, self.clipboard,
              Model.imgIdx, self, self.bookmarks, {})
              #{'datetime': time.strftime('%a %b %d %H:%M:%S %Y',
              #             time.gmtime(os.stat(filename)[stat.ST_MTIME]))})
        # Directories
        elif os.path.isdir(filename):
            for other, otherIdFunc, imgIdx in self.subExplorerReg['folder']:
                if self.filter == 'BoaFiles' and \
                  '*' in self.allowedProtocols or '*' in self.allowedProtocols or \
                      other.protocol in self.allowedProtocols:
                    if otherIdFunc(filename):
                        return 'fol', other(file, filename, self.clipboard,
                              imgIdx, self, self.bookmarks)
            return 'fol', FileSysNode(file, filename, self.clipboard,
                  EditorHelper.imgFolder, self, self.bookmarks)
        else:
            return '', None