summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-11-07 22:29:08 +0000
committerCarl Hetherington <cth@carlh.net>2014-11-07 22:29:08 +0000
commitf3bdda1e966c3e873d063683191e14bff67d764d (patch)
tree533d7b24cd595d9f2d906e982396aa47dc89e266
parent744196884e26dd927cff383ab642c781569a77b5 (diff)
Use scp to copy files.
-rwxr-xr-xcdist16
1 files changed, 9 insertions, 7 deletions
diff --git a/cdist b/cdist
index 330ece4..2dffac8 100755
--- a/cdist
+++ b/cdist
@@ -80,7 +80,7 @@ class Config:
try:
f = open('%s/.config/cdist' % os.path.expanduser('~'), 'r')
- while 1:
+ while True:
l = f.readline()
if l == '':
break
@@ -114,11 +114,11 @@ def log(m):
def copytree(a, b):
log('copy %s -> %s' % (a, b))
- shutil.copytree(a, b)
+ os.command('scp -r %s %s' % (a, b))
def copyfile(a, b):
log('copy %s -> %s' % (a, b))
- shutil.copyfile(a, b)
+ os.command('scp %s %s' % (a, b))
def rmdir(a):
log('remove %s' % a)
@@ -142,7 +142,7 @@ def command_and_read(c):
def read_wscript_variable(directory, variable):
f = open('%s/wscript' % directory, 'r')
- while 1:
+ while True:
l = f.readline()
if l == '':
break
@@ -515,7 +515,7 @@ class Project(object):
def set_version_in_wscript(version):
f = open('wscript', 'rw')
o = open('wscript.tmp', 'w')
- while 1:
+ while True:
l = f.readline()
if l == '':
break
@@ -697,13 +697,13 @@ def main():
project.checkout(target)
text = open('ChangeLog', 'r')
- html = open('%s/changelog.html' % args.output, 'w')
+ html = tempfile.NamedTemporaryFile()
versions = 8
last = None
changes = []
- while 1:
+ while True:
l = text.readline()
if l == '':
break
@@ -732,6 +732,8 @@ def main():
else:
changes[-1] += " " + c
+ copyfile(html.file, '%s/changelog.html' % args.output)
+ html.close()
target.cleanup()
elif globals.command == 'manual':