From 62ccb6f95884b38f1730db21ee0ab17c93a2471d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Sun, 28 Aug 2005 17:00:14 +0000 Subject: [PATCH] echo eklendi... --- pisi/actionsapi/shelltools.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index 826410c0..93385cca 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -37,6 +37,17 @@ def makedirs(destinationDirectory): except OSError: 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') + def chmod(sourceFile, mode = 0755): '''change the mode of sourceFile to the mode''' for file in glob.glob(sourceFile):