Browse Source

fixed broken link

pull/18/head
theycallmemac 3 years ago
parent
commit
02f1008a7c
4 changed files with 17 additions and 14 deletions
  1. +1
    -3
      scripts/builders.py
  2. +5
    -5
      scripts/controls.py
  3. +10
    -4
      scripts/index.py
  4. +1
    -2
      setup.py

+ 1
- 3
scripts/builders.py View File

@@ -31,9 +31,7 @@ def build_timetable(room, week, day, hour):
AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/58.0.3029.110
Safari/537.36""")]
url = "https://www101.dcu.ie/timetables/feed.php?room=" + room + \
"&week1=" + week + "&hour=" + str(hour) + \
"&day=" + day + "&template=location"
url = "https://www.dcu.ie/timetables/feed.php?room=" + room + "&week1=" + week + "&hour=" + str(hour) + "&day=" + day + "&template=location"
browser.open(url)
return browser, url



+ 5
- 5
scripts/controls.py View File

@@ -24,11 +24,11 @@ __license__ = 'GPL-3.0'

def get_statuses(status, options, room):
if options.available:
if len(status) <= 9:
if len(status) <= 9:
print(room + ": " + status)
else:
print(room + ": " + status)
def run_loop(lst, options, details):
week, day, time = details[0:3]
for room in lst:
@@ -45,7 +45,7 @@ def book_grattan(details):
else:
print("Form submission withdrawn.")
sys.exit()
def book_computing(details):
creds = []
user, password, from_who, to_who, message = builders.draft_email(details)
@@ -101,8 +101,8 @@ def available_now_control(options, lst, times):
minute = '00'
checks.check_arguments(int(week), int(day))
time = checks.search_dictionary(times, hour + minute)
details = [week, day, time]
run_loop(lst, options, details)
details = [week, day, time]
run_loop(lst, options, details)
sys.exit()



+ 10
- 4
scripts/index.py View File

@@ -64,21 +64,25 @@ def opt_is_room(options, rooms, details, times):
else:
controls.lookup_room_control(g, c, details, times)


def booking_option(rooms, details):
c, g = rooms[0:2]
print("Booking requires more arguments. See the help for details.") if len(details) < 4 else controls.booking_control(c, g, details)
sys.exit()




def lookup_option(options, rooms, details, times):
opt_is_room(options, rooms, details, times)
lst = get_lst(rooms[0], rooms[1], options)
controls.lookup_building_control(options, lst, details, times)
def now_option(options, rooms, times):
c, g = rooms[0:2]
lst = get_lst(c, g, options)
controls.available_now_control(options, lst, times)
def required():
parser = setup_options()
(options, arguments) = parser.parse_args()
@@ -88,7 +92,9 @@ def required():
def requesting_booking(options, rooms, details):
if options.book and len(details) < 5:
booking_option(rooms, details)
else:
pass

def displaying_info(options, rooms, details, times):
if options.lookup:
lookup_option(options, rooms, details, times)


+ 1
- 2
setup.py View File

@@ -1,7 +1,6 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from setuptools import find_packages
from setuptools import setup, find_packages
setup(name='dcurooms',
version='1.0.0',
description='Shows room information around the DCU campus',


Loading…
Cancel
Save