Commit 9302746c authored by Deb's avatar Deb
Browse files

add moodlesize as parameter

parent ccefd8e3
Pipeline #456364 failed with stage
in 56 seconds
......@@ -84,6 +84,9 @@ def main(args):
"-d", "--dry", action='store_true', help="Flag for dry run.")
parser.add_argument(
"-t", "--tmp", default="./tmp", help="Temporary folder. Default:./tmp")
parser.add_argument(
"--moodlefilesize", default="250",
help="Moodle upload file size in MiB. Default: 250")
parser.add_argument(
"--nowarn", action='store_true', help="Disables warnings")
......@@ -97,6 +100,7 @@ def main(args):
csv_delim = args.csvdelim
csv_quote = args.csvquote
csv_enc = args.csvenc
size_limit = int(args.moodlefilesize) # Moodle upload size limit in MiB
# Print status
starttime = time.time()
......@@ -211,7 +215,7 @@ Processing {} students'''.format(num_students))
if not os.path.islink(file_path):
foldersize += os.path.getsize(file_path)
if bytesto(foldersize,'m') < 250:
if bytesto(foldersize,'m') < size_limit:
z.write(file_path,os.path.join(os.path.relpath(file_path, tmp_folder),file))
os.remove(file_path)
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment