Skip to content

Commit

Permalink
Add TODOs and backlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
stratofax committed Sep 20, 2022
1 parent 5a3a03e commit 12196c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/electos/ballotmaker/ballots/ballot_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@

logging.getLogger(__name__)

# TODO: use enums in ContestType: https://github.com/TrustTheVote-Project/BallotLab/pull/113#discussion_r973606562
# Also: see line 147
CANDIDATE = "candidate"
BALLOT_MEASURE = "ballot measure"


# set up frames
# 1 = True, 0 = FALSE
SHOW_BOUNDARY = 0
Expand Down Expand Up @@ -141,7 +145,8 @@ def build_ballot(
doc.addPageTemplates(three_column_template)
doc.addPageTemplates(one_column_template)

# TODO: use ballot_data.candidate_contests & .ballot_measures instead
# TODO: use ballot_data.candidate_contests & .ballot_measures instead.
# See thread for details: https://github.com/TrustTheVote-Project/BallotLab/pull/113#discussion_r973608016
candidate_contests = []
ballot_measures = []
# get contests
Expand Down Expand Up @@ -174,6 +179,7 @@ def build_ballot(
# insert column break after every 2 contests
if (can_con_count % 2 == 0) and (can_con_count < 4):
elements.append(CondPageBreak(c_height * inch))
# TODO: write more informative log message, see: https://github.com/TrustTheVote-Project/BallotLab/pull/113#discussion_r973608278
logging.info(f"Added {can_con_count} candidate contests.")
elements.append(NextPageTemplate("1col"))
elements.append(PageBreak())
Expand Down
4 changes: 4 additions & 0 deletions src/electos/ballotmaker/ballots/build_ballots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ def get_election_header(election: ElectionData) -> dict:
def build_ballots(election: ElectionData) -> Path:

# create the directories needed
# TODO: clean up datetime code: https://github.com/TrustTheVote-Project/BallotLab/pull/113#discussion_r973609852
now = datetime.now()
date_time = now.strftime("%Y_%m_%dT%H%M%S")
home_dir = Path.home()
program_dir = Path(home_dir, PROGRAM_NAME)
new_ballot_dir = Path(program_dir, date_time)
logging.info(f"New ballots will be saved in {new_ballot_dir}")
# TODO: Use original EDF file name (no ext) in output dir
# See: https://github.com/TrustTheVote-Project/BallotLab/pull/113#discussion_r973776838
Path(new_ballot_dir).mkdir(parents=True, exist_ok=False)
# TODO: list actual dir in log output: https://github.com/TrustTheVote-Project/BallotLab/pull/113#discussion_r973610221
logging.info("Output directory created.")
election_header = get_election_header(election)

Expand Down

0 comments on commit 12196c1

Please sign in to comment.