changeset 854:14811e1463a1

Give upload command a source and target.
author Martin Geisler <mg@daimi.au.dk>
date Sun, 27 Jul 2008 22:31:53 +0200
parents b5707c789a5a
children 28506572a2ca
files run.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/run.py	Sun Jul 27 22:17:15 2008 +0200
+++ b/run.py	Sun Jul 27 22:31:53 2008 +0200
@@ -179,12 +179,12 @@
     fp.close()
 
 
-@command('upload', 'directory', 'key')
-def upload(directory, key):
-    """Upload directory to http://viff.dk/. This requires an SSH
+@command('upload', 'source', 'target', 'key')
+def upload(source, target, key):
+    """Upload source to http://viff.dk/target. This requires an SSH
     private key that has access to viff.dk."""
-    if not isdir(directory):
-        abort("%s should be a directory", directory)
+    if not isdir(source):
+        abort("%s should be a directory", source)
     if not os.access(key, os.R_OK):
         abort("Cannot read %s", key)
 
@@ -192,7 +192,7 @@
              '--human-readable', '--stats', '--verbose',
              '--chmod', 'go=rX',
              '-e', 'ssh -l viff -i %s' % key,
-             directory, 'viff.dk:~/viff.dk/'])
+             source, 'viff.dk:~/viff.dk/%s' % target])
 
 @command('size')
 def size():