Back to index

moin  1.9.0~rc2
Public Member Functions
fckcommands.GetFoldersAndFilesCommandMixin Class Reference
Inheritance diagram for fckcommands.GetFoldersAndFilesCommandMixin:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def getFoldersAndFiles

Detailed Description

Definition at line 56 of file fckcommands.py.


Member Function Documentation

def fckcommands.GetFoldersAndFilesCommandMixin.getFoldersAndFiles (   self,
  resourceType,
  currentFolder 
)
Purpose: command to recieve a list of folders and files

Definition at line 57 of file fckcommands.py.

00057 
00058        def getFoldersAndFiles(self, resourceType, currentFolder):
00059               """
00060               Purpose: command to recieve a list of folders and files
00061               """
00062               # Map the virtual path to our local server
00063               serverPath = mapServerFolder(self.userFilesFolder,currentFolder)
00064               # Open the folders / files node
00065               folders = """<Folders>"""
00066               files = """<Files>"""
00067               for someObject in os.listdir(serverPath):
00068                      someObjectPath = mapServerFolder(serverPath, someObject)
00069                      if os.path.isdir(someObjectPath):
00070                             folders += """<Folder name="%s" />""" % (
00071                                           convertToXmlAttribute(someObject)
00072                                           )
00073                      elif os.path.isfile(someObjectPath):
00074                             size = os.path.getsize(someObjectPath)
00075                             if size > 0:
00076                                    size = round(size/1024)
00077                                    if size < 1:
00078                                           size = 1
00079                             files += """<File name="%s" size="%d" />""" % (
00080                                           convertToXmlAttribute(someObject),
00081                                           size
00082                                           )
00083               # Close the folders / files node
00084               folders += """</Folders>"""
00085               files += """</Files>"""
00086               return folders + files

Here is the call graph for this function:


The documentation for this class was generated from the following file: