echo dosya yoksa yaratsın, curDIR mevcut klasörü, ENV ise argüman olarak verilen env. değişkenini döndürsün

This commit is contained in:
S.Çağlar Onur
2005-08-30 19:21:39 +00:00
parent 47950a019c
commit a6d9d4b65f
2 changed files with 13 additions and 10 deletions
+7 -1
View File
@@ -11,7 +11,7 @@
# Please read the COPYING file.
# Standart Python Modules
import os.path
import os
# PISI Modules
import pisi.actionsapi
@@ -26,6 +26,12 @@ class BinutilsError(pisi.actionsapi.Error):
env = glb.env
dirs = glb.dirs
def curDIR():
return os.getcwd()
def ENV(env):
return os.environ[env];
# variables.Env
def pkgDIR():
+6 -9
View File
@@ -38,15 +38,12 @@ def makedirs(destinationDirectory):
pass
def echo(destionationFile, content):
if can_access_file(destionationFile):
try:
f = open(destionationFile, 'a')
f.write("%s\n" % content)
f.close()
except IOError:
ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n')
else:
ctx.ui.error('\n!!! ActionsAPI [echo]: File doesn\'t exists...\n')
try:
f = open(destionationFile, 'a')
f.write("%s\n" % content)
f.close()
except IOError:
ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n')
def chmod(sourceFile, mode = 0755):
'''change the mode of sourceFile to the mode'''