def _command_use(self, strPath): # make sure we only use a resource once if strPath in self._objUse: return objFolder = filesystem.openPackageFolder(strPath, self.bolSafeMode) arrFiles = objFolder.listFiles() for strFile in arrFiles: strFilePath = objFolder.getAlias(strFile) if strFilePath not in self._objFile: self._objFile[strFilePath] = objFolder.getFileStr(strFile) # mark this resource as used self._objUse[strPath] = True
# # author : Flame Herbohn (and contributors) # download : https://github.com/appmode/ # license : GNU AGPL 3.0 (see license/agpl-3.0.txt for details) # # ------------------------------------------------------------------------------# from google.appengine.dist import use_library use_library("django", "1.2") from w3.base import * from w3c import filesystem import os import mimetypes # get path strPath = os.environ.get("PATH_INFO").strip("/") # open folder objFolder = filesystem.openPackageFolder(strPath) # return file print "Content-Type: %s" % mimetypes.guess_type(strPath)[0] print "" try: print objFolder.getFileStr() except: for strFile in objFolder.listFiles(): print '<a href="%s">%s</a><br>' % (objFolder.getAlias(strFile), strFile)
# # author : Flame Herbohn (and contributors) # download : https://github.com/appmode/ # license : GNU AGPL 3.0 (see license/agpl-3.0.txt for details) # #------------------------------------------------------------------------------# from google.appengine.dist import use_library use_library('django', '1.2') from w3.base import * from w3c import filesystem import os import mimetypes # get path strPath = os.environ.get('PATH_INFO').strip('/') # open folder objFolder = filesystem.openPackageFolder(strPath) # return file print "Content-Type: %s" % mimetypes.guess_type(strPath)[0] print '' try: print objFolder.getFileStr() except: for strFile in objFolder.listFiles(): print "<a href=\"%s\">%s</a><br>" % (objFolder.getAlias(strFile), strFile)