Skip to content

Commit

Permalink
Modificato passaggio dei parametri
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiaOldani committed Aug 3, 2023
1 parent cffd272 commit 5c38c5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
15 changes: 7 additions & 8 deletions generator/form/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
from utils.slots import Slots


def generate_dat_file(
animators_per_slot,
max_repetition_same_slot,
max_number_daily_slots
):
def generate_dat_file():
ENDPOINT = "http://USERNAME.wufoo.com/api/v3/forms/FORM_HASH/entries.json?pageSize=100"
FORM_API_KEY = "API_KEY"

Expand Down Expand Up @@ -65,13 +61,16 @@ def generate_dat_file(
result = result.strip() + ";\n\n"
f.write(result)

f.write(f"param AnimatoriPerTurno := {animators_per_slot};\n\n")
ANIMATORS_PER_SLOT = 2
f.write(f"param AnimatoriPerTurno := {ANIMATORS_PER_SLOT};\n\n")

MAX_REPETITION_SAME_SLOT = 2
f.write(
f"param MassimaRipetizioneStessoTurno := {max_repetition_same_slot};\n\n"
f"param MassimaRipetizioneStessoTurno := {MAX_REPETITION_SAME_SLOT};\n\n"
)

f.write(f"param MassimoNumeroTurniGiornalieri := {max_number_daily_slots};\n")
MAX_NUMBER_DAILY_SLOTS = 1
f.write(f"param MassimoNumeroTurniGiornalieri := {MAX_NUMBER_DAILY_SLOTS};\n")


if __name__ == "__main__":
Expand Down
12 changes: 1 addition & 11 deletions generator/main.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import os
import subprocess
import sys

from form.form import generate_dat_file
from telegram.telegram import send_pdf, send_turns
from template.template import generate_template


def main():
argv = sys.argv[1:]
animators_per_slot = int(argv[0])
max_repetition_same_slot = int(argv[1])
max_number_daily_slots = int(argv[2])

generate_dat_file(
animators_per_slot,
max_repetition_same_slot,
max_number_daily_slots
)
generate_dat_file()

turns = generate_template()

Expand Down

0 comments on commit 5c38c5f

Please sign in to comment.