From d82bc6abcdb05ed9f215edd398096dbec41f0952 Mon Sep 17 00:00:00 2001 From: "osboxes.org" Date: Wed, 8 Jan 2020 14:36:04 -0700 Subject: [PATCH] Added 3 explicit casts to devel server to make py v3.5 compatible --- devel/moth.py | 8 ++-- productionLaunch.sh | 34 +++++++++++++++ state/initialized | 1 + state/points.log | 0 state/teamids.txt | 101 +++++++++++++++++++++++++++++++++++++++++++ state/teams/fjr88kjk | 1 + 6 files changed, 141 insertions(+), 4 deletions(-) create mode 100755 productionLaunch.sh create mode 100644 state/initialized create mode 100644 state/points.log create mode 100644 state/teamids.txt create mode 100644 state/teams/fjr88kjk diff --git a/devel/moth.py b/devel/moth.py index d228b72..947411c 100644 --- a/devel/moth.py +++ b/devel/moth.py @@ -423,7 +423,7 @@ class Category: self.catmod = None try: - self.catmod = loadmod('category', os.path.join(path, 'category.py')) + self.catmod = loadmod('category', str(os.path.join(str(path), 'category.py'))) except FileNotFoundError: self.catmod = None @@ -433,7 +433,7 @@ class Category: pointvals = self.catmod.pointvals() else: pointvals = [] - for fpath in glob.glob(os.path.join(self.path, "[0-9]*")): + for fpath in glob.glob(str(os.path.join(str(self.path), "[0-9]*"))): pn = os.path.basename(fpath) points = int(pn) pointvals.append(points) @@ -441,12 +441,12 @@ class Category: def puzzle(self, points): puzzle = Puzzle(self.seed, points) - path = os.path.join(self.path, str(points)) + path = str(os.path.join(str(self.path), str(points))) if self.catmod: with pushd(self.path): self.catmod.make(points, puzzle) else: - with pushd(self.path): + with pushd(str(self.path)): puzzle.read_directory(path) return puzzle diff --git a/productionLaunch.sh b/productionLaunch.sh new file mode 100755 index 0000000..50b47be --- /dev/null +++ b/productionLaunch.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +workingDirectory=$1 + +if [ -z "${workingDirectory}" ] || [ "$1" == "-clean" ]; then + workingDirectory=$PWD +fi + +if [ "$1" == "-clean" ] || [ "$2" == "-clean" ]; then + echo "Cleaning" + rm -rf "$workingDirectory/compiled-puzzles" + rm -rf "$workingDirectory/mothballs" + rm -rf "$workingDirectory/state" + exit +fi + +echo "Working in directory $workingDirectory" + +bash $workingDirectory/build.sh + +mkdir $workingDirectory/compiled-puzzles + +FILES=$workingDirectory/example-puzzles/* +#for f in $FILES +#do +# $workingDirectory/devel/package-puzzles.py $workingDirectory/compiled-puzzles $f +#done + +#mkdir $workingDirectory/mothballs +#cp $workingDirectory/compiled-puzzles/* $workingDirectory/mothballs + +mkdir $workingDirectory/state + +sudo docker run --rm -it -p 8080:8080 -v $workingDirectory/state:/state -v $workingDirectory/mothballs:/mothballs dirtbags/moth diff --git a/state/initialized b/state/initialized new file mode 100644 index 0000000..733ed60 --- /dev/null +++ b/state/initialized @@ -0,0 +1 @@ +Remove this file to reinitialize the contest diff --git a/state/points.log b/state/points.log new file mode 100644 index 0000000..e69de29 diff --git a/state/teamids.txt b/state/teamids.txt new file mode 100644 index 0000000..c2ab91e --- /dev/null +++ b/state/teamids.txt @@ -0,0 +1,101 @@ +88p=8bqy +fjr88kjk +7netqwyp +wi2npenr +t7repm=n +e=hqr4ik +c2yfaexj +fm7jjdjp +kwcphbjp +hjf2k7bh +jqbaczbe +brrp7iy6 +=hp3ndpn +fyi4dwbx +iimrdjnp +kchwjrc4 +rabdwhwh +zyy78ct3 +kpidmeid +jj6bxixm +mxmr6i42 +ktn88xcw +bnbw3j2c +ww7iz=xm +4na63cdr +73hq=6r4 +r=ja2mr= +38hy22qd +mtqczk== +jji=rkzd +8dy=wa8e +74r6xc=3 +q3p6jj6d +kftapwim +=bmwc44n +bkzc6bzq +ntjdbxby +fi84tmnr +zjm4kt7y +h3qr33jh +mazk=tr4 +=7qcec46 +4dwrthxx +ctrj2n6n +7wrzbf6w +inxffqna +m4rd=nww +hkq6rn88 +wfmcd6di +hh8m6i7r +jhxe6w22 +abx7wmfh +zz=6k=h7 +88ycirdr +znnm8x4= +ek4p888c +tf6i=6p= +ncd46a82 +2kqnx7ci +aqny4b=h +2862zt2t +2mqzpy8c +kjzcdcid +h=zj38de +cwtnpxc8 +knzfnrqc +dbnf6zdj +7q3qx2mx +itjhbxxr +e6dd87z3 +a28p4eit +7h6xx2a7 +rzwdjnyw +rd=wxhat +=whxbhyi +xyfmjqfy +cdymnizb +enkjpkax +yj83r84z +d4y7e4if +edhhkzbt +fzciwxt6 +adxwbtbe +qn2rkn8c +7h6ypb6h +7pxfc43j +rt8x4fdd +jki3w2hd +tmqyjxj4 +iib264pq +tf7inmeb +c4qyfhck +ayj66cmb +e7hfaxzk +qikr=37k +d6hm374w +8ty4f2dn +qpr7fz3n +28ax7c7q +nd7i=jde +jkfcq4bi diff --git a/state/teams/fjr88kjk b/state/teams/fjr88kjk new file mode 100644 index 0000000..56cafd2 --- /dev/null +++ b/state/teams/fjr88kjk @@ -0,0 +1 @@ +testteam