* Also check if file isEmpty ..

This commit is contained in:
Gökmen Göksel
2008-12-23 21:31:07 +00:00
parent ac2ae47d03
commit 6d5a0dfbb2
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ import pisi.context as ctx
# ActionsAPI Modules # ActionsAPI Modules
import pisi.actionsapi import pisi.actionsapi
import pisi.actionsapi.get as get import pisi.actionsapi.get as get
from pisi.actionsapi.shelltools import system, can_access_file, unlink from pisi.actionsapi.shelltools import system, can_access_file, unlink, isEmpty
from pisi.actionsapi.pisitools import dodoc from pisi.actionsapi.pisitools import dodoc
class CompileError(pisi.actionsapi.Error): class CompileError(pisi.actionsapi.Error):
@@ -57,7 +57,7 @@ def install(parameters = ''):
CONTRIBUTORS LICENSE COPYING* Change* MANIFEST* README*' CONTRIBUTORS LICENSE COPYING* Change* MANIFEST* README*'
for doc in DDOCS.split(): for doc in DDOCS.split():
if can_access_file(doc): if can_access_file(doc) and not isEmpty(doc):
dodoc(doc) dodoc(doc)
def run(parameters = ''): def run(parameters = ''):
+4
View File
@@ -207,6 +207,10 @@ def isDirectory(filePath):
'''Return True if filePath is an existing directory''' '''Return True if filePath is an existing directory'''
return os.path.isdir(filePath) return os.path.isdir(filePath)
def isEmpty(filePath):
'''Return True if filePath is an empty file'''
return os.path.getsize(filePath) == 0
def realPath(filePath): def realPath(filePath):
'''return the canonical path of the specified filename, eliminating any symbolic links encountered in the path''' '''return the canonical path of the specified filename, eliminating any symbolic links encountered in the path'''
return os.path.realpath(filePath) return os.path.realpath(filePath)