From 3e474f1b795bc021744ab060d3ab48bf9f7570c6 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 18 Oct 2018 20:13:34 -0400 Subject: [PATCH] Move some variables around to saner places --- common.py | 8 +++++++- doorUpdater.py | 9 +-------- hid/DoorController.py | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common.py b/common.py index cf64ff3..b6e35c3 100644 --- a/common.py +++ b/common.py @@ -23,7 +23,13 @@ doors = {doorName: DoorController(doorData['ip'], name=doorName, access=doorData['access']) for doorName, doorData in config["doors"].items()} -fieldnames = "CardNumber,CardFormat,PinRequired,PinCode,ExtendedAccess,ExpiryDate,Forename,Initial,Surname,Email,Phone,Custom1,Custom2,Schedule1,Schedule2,Schedule3,Schedule4,Schedule5,Schedule6,Schedule7,Schedule8".split(",") +# mapping of member levels to schedules +memberLevels = {"CMS Staff": "7x24", + "CMS Weekends Only": "Weekends Only", + "CMS Weekdays Only": "Weekdays Only", + "CMS Unlimited": "Unlimited", + "CMS Nights & Weekends": "Nights and Weekends", + "CMS Day Pass": "Unlimited"} def getMembershipworksData(folders, columns): """ Pull the members csv from the membershipworks api diff --git a/doorUpdater.py b/doorUpdater.py index 69003b8..f3833a4 100755 --- a/doorUpdater.py +++ b/doorUpdater.py @@ -8,14 +8,7 @@ from hashlib import md5 import os from common import * - -# mapping of member levels to schedules -memberLevels = {"CMS Staff": "7x24", - "CMS Weekends Only": "Weekends Only", - "CMS Weekdays Only": "Weekdays Only", - "CMS Unlimited": "Unlimited", - "CMS Nights & Weekends": "Nights and Weekends", - "CMS Day Pass": "Unlimited"} +from hid.DoorController import fieldnames def makeMember(member, doorAuth): """Create an output CSV row for the member""" diff --git a/hid/DoorController.py b/hid/DoorController.py index 95c5839..f2a8f69 100644 --- a/hid/DoorController.py +++ b/hid/DoorController.py @@ -8,6 +8,7 @@ E = ElementMaker(namespace="http://www.hidglobal.com/VertX", nsmap={"hid": "http://www.hidglobal.com/VertX"}) ROOT = E_plain.VertXMessage +fieldnames = "CardNumber,CardFormat,PinRequired,PinCode,ExtendedAccess,ExpiryDate,Forename,Initial,Surname,Email,Phone,Custom1,Custom2,Schedule1,Schedule2,Schedule3,Schedule4,Schedule5,Schedule6,Schedule7,Schedule8".split(",") class DoorController(): def __init__(self, ip, username, password, name="", access=""):