aboutsummaryrefslogtreecommitdiff
path: root/add_teams
diff options
context:
space:
mode:
authorTudor Roman2018-10-09 21:32:20 +0300
committerTudor Roman2018-10-09 21:32:20 +0300
commit2906c92704f04fd50987400d5d60b4af0832aaf8 (patch)
tree4deea5a90acf0fb5addda35617983540e9e3560f /add_teams
downloadrmi_scripts-2906c92704f04fd50987400d5d60b4af0832aaf8.tar.gz
rmi_scripts-2906c92704f04fd50987400d5d60b4af0832aaf8.zip
init
Diffstat (limited to 'add_teams')
-rwxr-xr-xadd_teams23
1 files changed, 23 insertions, 0 deletions
diff --git a/add_teams b/add_teams
new file mode 100755
index 0000000..5fd264e
--- /dev/null
+++ b/add_teams
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+#
+# Adds teams into CMS
+#
+# Made by Tudor Roman, public domain
+#
+# This script expects as its first argument a path to a csv file with two columns,
+# name and id. name should be the long name of the team, like "Romania - Juniors",
+# while id should be a short identifier, like "RO_VJ".
+#
+
+import csv
+import sys
+from subprocess import call
+
+if len(sys.argv) != 2:
+ print("Usage: add_teams <csv_file>")
+ sys.exit(1)
+
+with open(sys.argv[1]) as file:
+ reader = csv.DictReader(file, delimiter=',')
+ for row in reader:
+ call(['cmsAddTeam', row['id'], row['name']])