This is a tool to auto-fill the EMS paperwork for the Ohio Union AV managers. This tool is provided as-is and is under no longer under active development, due to graduation.
Mac users: See macOS Installation Script for an automated installation, or follow the manual steps below.
Python is the scripting language that the autofill tool is written in. There are two versions of Python: Python 2.x and Python 3.x which are incompatible with each other. This tool is written in Python 3. It's been tested with version 3.4 and later.
- Download and install the latest version of Python 3
- Ensure Python is added to PATH
- Windows:
- Launch Command Prompt
- Type
python --version
- If the output is not
Python 3.x.x
(e.g.'python' is not recognized as an internal or external command, operable program or batch file.
orPython 2.7.x
):- Click Start, type
environment variables
and click on "Edit environment variables for your account" - Under
System variables
, look forPath
, and double click on it - Add a new entry with path
C:\python3
and another with pathC:\python3\Scripts
or the other installation path from Step 1. - Move those entries to the top.
- If double-clicking on
Path
launched a box with a single text box, typeC:\python3;C:\python3\Scripts;
to the beginning of the text box. Make sure the;
is at the end. - NOTE: If the output of
python --version
wasPython 2.7.x
, this may cause any application that uses Python 2 to have issues. Consider renamingpython.exe
inC:\python3
topython3.exe
andpythonw.exe
topythonw3.exe
. This will preserve compatibility with Python 2 applications, while Python 3 commands below will need to be run withpython3
instead ofpython
- Exit and relaunch Command Prompt, and verify
python --version
returnsPython 3.x.x
. If it doesn't, double check your steps.
- Click Start, type
- macOS:
- Launch Terminal
- Type
python3 --version
- If the output is not
Python 3.x.x
(e.g.-bash: python: command not found
), type the following commands in Terminal:- Type
cd ~
- Type
nano .bash_profile
- If there's a line starting with
export PATH=
, right afterexport PATH=
, type/usr/local/bin/:
, so the line now looks likeexport PATH=/usr/local/bin:[...]
- Otherwise, on a new blank line, type
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
- Inside the Terminal window with
nano .bash_profile
open, typectrl + X
to exit nano, thenEnter
to save, thenEnter
to save that file name. - Type
source .bash_profile
to apply changes from.bash_profile
- Verify python3 is in the correct path by typing
python3 --version
and verify the output saysPython 3.x.x
. If it doesn't, double check your steps.
- Type
- Windows:
Pip is a Python package installer. It is used to install Python packages, specifically Selenium.
- Launch Command Prompt/Terminal
- Type
python3 -m pip install -U pip
. - Resolve any errors before continuing
Selenium (WebDriver) is a web-application testing tool that automates actions on a web browser. Selenium provides the interface between the Python commands and the actual websites.
- Launch Command Prompt/Terminal
- Type
python3 -m pip install -U selenium
. - Resolve any errors before continuing
Google Chrome is a popular web browser, and is the only browser supported by this tool. Other browsers could be used after minor modifications to the script, but that has not been tested.
- Install the regular version of Google Chrome (not Google Chrome Canary or Chromium or Google Chrome Channels)
ChromeDriver is a server that provides the interface for Selenium Webdriver to work with Google Chrome.
- Download the latest version of Chromedriver from link above.
- Extract into
- Windows:
C:\chromedriver\
- macOS:
/Users/%USERNAME%/chromedriver/
where%USERNAME%
is your username - can be found at the top of the Terminal window
- Windows:
- Only file inside
chromedriver/
should bechromedriver
- Add
chromedriver/
to PATH:- Windows:
- Click Start, type
environment variables
and click on "Edit environment variables for your account" - Under
System variables
, look forPath
, and double click on it - Add a new entry with path
C:\chromedriver
- Move the entry to the top.
- If double-clicking on
Path
launched a box with a single text box, typeC:\chromedriver;
to the beginning of the text box. Make sure the;
is at the end. - Exit and relaunch Command Prompt
- Click Start, type
- macOS:
cd ~
nano .bash_profile
- If there's a line starting with
export PATH=
, right afterexport PATH=
, type/Users/%USERNAME%/chromedriver/:
, so the line now looks likeexport PATH=/Users/%USERNAME%/chromedriver:[...]
. Replace%USERNAME%
as above. - Otherwise, on a new blank line, type
export PATH=/Users/%USERNAME%/chromedriver:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
- Inside the Terminal window with
nano .bash_profile
open, typectrl + X
to exit nano, thenEnter
to save, thenEnter
to save that file name. - Type
source .bash_profile
to apply changes from.bash_profile
- Windows:
- Verify chromedriver is in the correct path by typing
chromedriver --version
and verify it returnsChromeDriver x.x[...]
. If it doesn't, double check your steps.
This zip folder contains the autofill tool and the configuration files to run it.
Download the latest EMS.Paperwork.Tool.zip
from
https://github.com/samyun/Ohio-Union-EMS-Autofill-Tool/releases/latest and extract it to a new folder.
This installation script is for macOS only. It's been tested with a fresh installation of macOS Sierra 10.12.5.
- Download the latest
installation.sh
from https://github.com/samyun/Ohio-Union-EMS-Autofill-Tool/releases/latest and save it to a location of your drive (eg ~/) - Launch Terminal and navigate to the directory containing
installation.sh
- e.g.
cd ~/
- e.g.
- Type
./installation.sh [-flags]
- Flags:
- -d: Install the development environment
- -i: Skip installations
- -r: Reinstall dependencies
- -v: verbose
- -h: help
- For a standard installation, type
./installation.sh
and follow the prompts. This will check for components, install missing dependencies, and download and extract the latest release ofEMS.Paperwork.Tool.zip
- For a developer's installation, type
./installation.sh -d
and follow the prompts. This run the same as the standard installation, but it will also clone themaster
branch of the source code.
- Flags:
This tool was designed to allow Ohio Union AV Managers to quickly and easily complete the EMS paperwork for the next day. Using Python3 and Selenium, an open source web browser automation tool, this tool will launch an instance of Google Chrome, navigate to https://whentowork.com, log in, and pull the schedule for the day specified. Then the tool will navigate to https://ohiounion.osu.edu/ems and complete the scheduling assignments based on the schedule pulled from W2W. This tool may work with other Ohio Union manager positions by changing various settings.json attributes, such as Production, but it is not tested.
- Make sure dependencies are installed
- Edit settings.json
- Enter first name, last name, EMS credentials, WhenToWork credentials etc
- In Terminal/Command Prompt, change directory to 'EMS Paperwork Tool/' and run: python3 autofill_tool.py
- current_manager_first_name: The current manager's first name. Used to assign early-morning setups that should be done the night before
- current_manager_last_name: The current manager's last name. Used to assign early-morning setups that should be done the night before
- ems_username: OSU name.#
- ems_password: OSU password
- w2w_username: WhenToWork username
- w2w_password: WhenToWork password
- use_w2w_manager_for_previous_day_setup: true to use the AV Manager for the previous evening for previous day setups, false to use "current_manager_first_name".
- minutes_to_advance_setup: Amount of time prior to the event start time that setup should be scheduled. e.g: If event starts at 5:00 PM, "minutes_to_advance_setup" = 30 means setup time is 4:30 PM.
- minutes_to_advance_checkin: Amount of time prior to the event start time that check-in should be scheduled. e.g: If event starts at 5:00 PM, "minutes_to_advance_checkin" = 15 means check-in time is 4:45 PM.
- minutes_to_delay_teardown: Amount of time after the event end time that teardown should be scheduled. e.g: If event ends at 5:00 PM, "minutes_to_delay_teardown" = 30 means teardown time is 5:30 PM.
- previous_day_setup_cutoff: The cut-off time to schedule the setup for the previous night. e.g.: If the cut-off time if 10:00 AM, an event that starts at 9:45 AM would be setup the night prior at "setup_time_night_before" time by "current_manager_last_name", "current_manager_first_name".
- late_open_previous_day_setup_cutoff: The cut-off time to schedule the setup for the previous night on late opens
- setup_time_night_before: The time to setup the event if it's set up the night prior. e.g: If the event starts prior to the "previous_day_setup_cutoff", and "setup_time_night_before" = 12:00 AM, the setup would be scheduled at 12:00 AM.
- use_w2w: true to use WhenToWork to find the schedule. false to use a separate "schedule.json"
- custom_date: false to use 'tomorrow's' date. true to have the script prompt for the date.
- skip_already_scheduled: true to skip events that have either setup, check-in, or teardown already scheduled. false to schedule those anyways. NB: if this is set to false, it will add the schedules, even if they already exist.
- skip_already_confirmed: true to skip events where the setup, check-in, or teardown are already scheduled. false to schedule those events anyways.
- skip_checking_for_av: true to skip checking for AV equipment, false to check for AV equipment
- skip_events_with_no_av: true to schedule events where the "A/V Equipment" section is "None Found". false to schedule those events anyways.
- skip_rooms: true to skip events that are in one of the rooms in "skip_following_rooms". false to schedule those events anyways.
- manager_position: The name of the manager position that appears in https://ohiounion.osu.edu/ems that should be used
- order_to_assign_general_shift: The order to schedule events. These are the positions in the W2W headers. eg. If the order is "A", "B", "C", the script will try to schedule an "A" first. If there are no A's, it will try to schedule a "B". If there are no A's nor B's, the script will try to schedule a "C". If there are no A's, B's, nor C's, it will skip assignment for that time only.
- skip_following_rooms: The rooms to skip if "skip_rooms" is true.
- create reports for shift-leads
- better installation package
- auto-confirm shifts