Chaning to make sure to copy the content of symbolic links
adding size calculation to estimate the size of the style directory
as it can contain large images, it is helpful to know when uploading.
-from __future__ import print_function
+#from __future__ import print_function
import os
import subprocess
import errno
import os
import subprocess
import errno
else: raise
def publish(src,target):
else: raise
def publish(src,target):
- cmd = ["rsync","-a","--delete","--partial",src,target]
+ cmd = ["rsync","-a","--copy-links","--partial",src,target]
retcode = subprocess.call(cmd)
if retcode:
error('%s : retruncode %s' % (' '.join(cmd),str(retcode)))
retcode = subprocess.call(cmd)
if retcode:
error('%s : retruncode %s' % (' '.join(cmd),str(retcode)))
def get_folder_size(folder):
total_size = os.path.getsize(folder)
def get_folder_size(folder):
total_size = os.path.getsize(folder)
+ if os.path.isfile(folder):
+ return total_size
for item in os.listdir(folder):
itempath = os.path.join(folder, item)
if os.path.isfile(itempath):
for item in os.listdir(folder):
itempath = os.path.join(folder, item)
if os.path.isfile(itempath):
total_size += get_folder_size(itempath)
return total_size
total_size += get_folder_size(itempath)
return total_size
-def warning(*objs):
- print("WARNING: ", *objs, file=sys.stderr)
+#proc = subprocess.Popen(args, env={'PATH': os.getenv('PATH')})
+def translate(files):
+ for f in files:
+ out = subprocess.check_output(["translate.sh", f])
+ sys.stdout.write('#')
-def error(*objs):
- print("ERROR: ", *objs, file=sys.stderr)
+#def warning(*objs):
+# print("WARNING: ", *objs, file=sys.stderr)
+
+#def error(*objs):
+# print("ERROR: ", *objs, file=sys.stderr)