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:
@@ -11,7 +11,7 @@
|
|||||||
# Please read the COPYING file.
|
# Please read the COPYING file.
|
||||||
|
|
||||||
# Standart Python Modules
|
# Standart Python Modules
|
||||||
import os.path
|
import os
|
||||||
|
|
||||||
# PISI Modules
|
# PISI Modules
|
||||||
import pisi.actionsapi
|
import pisi.actionsapi
|
||||||
@@ -26,6 +26,12 @@ class BinutilsError(pisi.actionsapi.Error):
|
|||||||
env = glb.env
|
env = glb.env
|
||||||
dirs = glb.dirs
|
dirs = glb.dirs
|
||||||
|
|
||||||
|
def curDIR():
|
||||||
|
return os.getcwd()
|
||||||
|
|
||||||
|
def ENV(env):
|
||||||
|
return os.environ[env];
|
||||||
|
|
||||||
# variables.Env
|
# variables.Env
|
||||||
|
|
||||||
def pkgDIR():
|
def pkgDIR():
|
||||||
|
|||||||
@@ -38,15 +38,12 @@ def makedirs(destinationDirectory):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def echo(destionationFile, content):
|
def echo(destionationFile, content):
|
||||||
if can_access_file(destionationFile):
|
|
||||||
try:
|
try:
|
||||||
f = open(destionationFile, 'a')
|
f = open(destionationFile, 'a')
|
||||||
f.write("%s\n" % content)
|
f.write("%s\n" % content)
|
||||||
f.close()
|
f.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n')
|
ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n')
|
||||||
else:
|
|
||||||
ctx.ui.error('\n!!! ActionsAPI [echo]: File doesn\'t exists...\n')
|
|
||||||
|
|
||||||
def chmod(sourceFile, mode = 0755):
|
def chmod(sourceFile, mode = 0755):
|
||||||
'''change the mode of sourceFile to the mode'''
|
'''change the mode of sourceFile to the mode'''
|
||||||
|
|||||||
Reference in New Issue
Block a user