Compare commits

..

No commits in common. "79678a89208eb1cdcfcc9a85437bfe6cf883b338" and "e71fd48975e785316899bbeae130d257267843f5" have entirely different histories.

3 changed files with 7 additions and 20 deletions

View File

@ -101,7 +101,7 @@ def main():
"charset": "utf8",
"sql_mode": "PIPES_AS_CONCAT",
"use_unicode": True,
},
}
)
HIDEvent.create_table()
for door in config.doors.values():

View File

@ -45,6 +45,9 @@ def do_import(config):
# create/update member
Member.from_csv_dict(member).magic_save()
if member["Account Name"] == "Adam Goldsmith":
print(member)
# update member's flags
for type, flags in membershipworks._parse_flags().items():
for flag, id in flags.items():
@ -73,7 +76,7 @@ def do_import(config):
)
for transaction in transactions:
Transaction.from_csv_dict(transaction).insert_instance().execute()
Transaction.from_csv_dict(transaction).magic_save()
# TODO: folders, levels, addons
@ -86,7 +89,7 @@ def main():
"charset": "utf8",
"sql_mode": "PIPES_AS_CONCAT",
"use_unicode": True,
},
}
)
do_import(config)

View File

@ -7,22 +7,6 @@ import pyclip
from .config import Config
TIME_FMT = "%l:%M%P"
DATETIME_FMT = "%a %b %e %Y, " + TIME_FMT
def format_datetime_range(start_ts: int, end_ts: int):
start = datetime.fromtimestamp(start_ts)
end = datetime.fromtimestamp(end_ts)
start_str = start.strftime(DATETIME_FMT)
if start.date() == end.date():
end_str = end.strftime(TIME_FMT)
else:
# TODO: this probably implies multiple instances. Should read
# RRULE or similar from the event notes
end_str = end.strftime(DATETIME_FMT)
return f"{start_str} — {end_str}"
def format_event(event_details, truncate: bool):
try:
@ -38,7 +22,7 @@ def format_event(event_details, truncate: bool):
out = f"""<h2 style="text-align: center;">
<a href="{url}">{img}{event_details['ttl']}</a>
</h2>
<div><i>{format_datetime_range(event_details['sdp'], event_details['edp'])}</i></div>
<div><i>{event_details['szp']} &mdash; {event_details['ezp']}</i></div>
"""
if not truncate:
out += f"""