[tuxdroid-svn] r5946 - in software_suite_v3/software/gadget: default/trunk online_only/trunk
Status: Beta
Brought to you by:
ks156
From: remi <c2m...@c2...> - 2009-12-07 14:28:15
|
Author: remi Date: 2009-12-07 15:27:59 +0100 (Mon, 07 Dec 2009) New Revision: 5946 Added: software_suite_v3/software/gadget/default/trunk/here.py software_suite_v3/software/gadget/online_only/trunk/here.py Modified: software_suite_v3/software/gadget/default/trunk/build.py software_suite_v3/software/gadget/online_only/trunk/build.py Log: * Fixed method to detect gadgets paths Modified: software_suite_v3/software/gadget/default/trunk/build.py =================================================================== --- software_suite_v3/software/gadget/default/trunk/build.py 2009-12-07 13:31:31 UTC (rev 5945) +++ software_suite_v3/software/gadget/default/trunk/build.py 2009-12-07 14:27:59 UTC (rev 5946) @@ -8,27 +8,17 @@ import os from builder.GadgetPackager import GadgetPackager +from here import localFilePath -# ============================================================================== -# Class to retrieve the py file path. -# ============================================================================== -class localFilePath(object): - """Class to retrieve the local file path. - """ - def getPath(self): - """Get the local file path. - """ - mPath, mFile = os.path.split(__file__) - return mPath - if __name__ == "__main__": - basePath = localFilePath().getPath() + basePath = os.path.realpath(localFilePath().getPath()) + def checkIsDir(directoryName): + path = os.path.join(basePath, directoryName) + return os.path.isdir(path) + # List all the directories - if os.name == 'nt': - directoriesList = filter (os.path.isdir, os.listdir(basePath)) - else: - directoriesList = filter (os.path.isdir, os.listdir(os.getcwd())) + directoriesList = filter (checkIsDir, os.listdir(basePath)) for gadget in directoriesList: # Be sure that the directory is a gadget if gadget.find("gadget") != -1: Added: software_suite_v3/software/gadget/default/trunk/here.py =================================================================== --- software_suite_v3/software/gadget/default/trunk/here.py (rev 0) +++ software_suite_v3/software/gadget/default/trunk/here.py 2009-12-07 14:27:59 UTC (rev 5946) @@ -0,0 +1,13 @@ +import os + +# ============================================================================== +# Class to retrieve the py file path. +# ============================================================================== +class localFilePath(object): + """Class to retrieve the local file path. + """ + def getPath(self): + """Get the local file path. + """ + mPath, mFile = os.path.split(__file__) + return mPath Modified: software_suite_v3/software/gadget/online_only/trunk/build.py =================================================================== --- software_suite_v3/software/gadget/online_only/trunk/build.py 2009-12-07 13:31:31 UTC (rev 5945) +++ software_suite_v3/software/gadget/online_only/trunk/build.py 2009-12-07 14:27:59 UTC (rev 5946) @@ -8,27 +8,17 @@ import os from builder.GadgetPackager import GadgetPackager +from here import localFilePath -# ============================================================================== -# Class to retrieve the py file path. -# ============================================================================== -class localFilePath(object): - """Class to retrieve the local file path. - """ - def getPath(self): - """Get the local file path. - """ - mPath, mFile = os.path.split(__file__) - return mPath - if __name__ == "__main__": - basePath = localFilePath().getPath() + basePath = os.path.realpath(localFilePath().getPath()) + def checkIsDir(directoryName): + path = os.path.join(basePath, directoryName) + return os.path.isdir(path) + # List all the directories - if os.name == 'nt': - directoriesList = filter (os.path.isdir, os.listdir(basePath)) - else: - directoriesList = filter (os.path.isdir, os.listdir(os.getcwd())) + directoriesList = filter (checkIsDir, os.listdir(basePath)) for gadget in directoriesList: # Be sure that the directory is a gadget if gadget.find("gadget") != -1: Added: software_suite_v3/software/gadget/online_only/trunk/here.py =================================================================== --- software_suite_v3/software/gadget/online_only/trunk/here.py (rev 0) +++ software_suite_v3/software/gadget/online_only/trunk/here.py 2009-12-07 14:27:59 UTC (rev 5946) @@ -0,0 +1,13 @@ +import os + +# ============================================================================== +# Class to retrieve the py file path. +# ============================================================================== +class localFilePath(object): + """Class to retrieve the local file path. + """ + def getPath(self): + """Get the local file path. + """ + mPath, mFile = os.path.split(__file__) + return mPath |