Browse Source

initial prototype from requirements report.

This is the initial prototype made by Sean Fradl as part of the
requirements report. It still fulfills most of the requirements for this
assignment as it appears that only a prototype is required. Some minor
changes may be necessary.
master
fraz 1 year ago
parent
commit
702ebaa512
6 changed files with 6 additions and 583 deletions
  1. +1
    -1
      src/App.js
  2. +5
    -2
      src/Components/Table.js
  3. +0
    -0
      src/Components/case2.js
  4. +0
    -517
      src/python/case2.json
  5. +0
    -16
      src/python/case2parsed.json
  6. +0
    -47
      src/python/parse.py

+ 1
- 1
src/App.js View File

@@ -3,7 +3,7 @@ import './App.css';
import Table from './Components/Table';
import Inputs from './Components/Inputs';
import {BrowserRouter, Switch, Route} from 'react-router-dom'
import {case2} from './python/case2.js'
import {case2} from './Components/case2.js'

class App extends React.Component{
constructor(){


+ 5
- 2
src/Components/Table.js View File

@@ -1,5 +1,6 @@
import React from 'react';
import '../App.css';
import {Link} from 'react-router-dom'

class Table extends React.Component{
constructor(){
@@ -58,9 +59,10 @@ class Table extends React.Component{
}

return(
<React.Fragment>
<Link to="/">Timetable Search</Link>
<table>
{console.log(this.props)}
<caption>Timetable For: {this.props.for.toUpperCase()}</caption>
<caption>Timetable For: {this.props.for.toUpperCase()} - Week 12</caption>
<thead style={thead}>
<tr style={trow}>
<td style={{border: 'none'}} className="leftCol"></td>
@@ -75,6 +77,7 @@ class Table extends React.Component{
{displayTable()}
</tbody>
</table>
</React.Fragment>
)
}
}


src/python/case2.js → src/Components/case2.js View File


+ 0
- 517
src/python/case2.json View File

@@ -1,517 +0,0 @@
[{
"CategoryTypeIdentity": "241e4d36-60e0-49f8-b27e-99416745d98d",
"CategoryTypeName": "Programmes of Study",
"CategoryEvents": [{
"EventIdentity": "464545de-8094-59b3-001d-d4d868b55922",
"HostKey": "1920#SPLUSB6C846",
"Description": null,
"EndDateTime": "2019-11-05T17:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T16:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:33:51.051166+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA218[1] Intro to Databases, CA119[1] Intro to Databases",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Roantree M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA119/CA218[1]L1/01",
"Identity": "35563f75-befe-4efe-ab4a-155bd66f0b71"
}, {
"EventIdentity": "dac75556-6bac-438d-a2c9-3b8b5380d045",
"HostKey": "1920#SPLUSB6C85E",
"Description": "Intro to Databases",
"EndDateTime": "2019-11-05T14:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T13:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:22:52.7354192+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA218[1] Intro to Databases, CA119[1] Intro to Databases",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Roantree M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA119/CA218[1]L2/01",
"Identity": "48170ef9-8652-4a86-a909-f3679310a8b8"
}, {
"EventIdentity": "f3993d03-524a-a5e2-6339-6138e4b17ca3",
"HostKey": "1920#SPLUSB6C86E",
"Description": "Intro to databases",
"EndDateTime": "2019-11-07T18:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.LG26, GLA.LG25",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T16:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-11T16:04:23.8332451+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA218[1] Intro to Databases, CA119[1] Intro to Databases",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Roantree M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA119/CA218[1]P1/01",
"Identity": "c778aece-12b9-433a-afc7-ee184511de94"
}, {
"EventIdentity": "ff540b51-2930-df3c-06a9-9413672e4412",
"HostKey": "1920#SEM1SE0C4FA",
"Description": "LOGIC",
"EndDateTime": "2019-11-04T11:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T10:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:20:01.7110262+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA208[1] LOGIC",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Sinclair D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA208[1]L1",
"Identity": "20145c9a-3bf1-4226-952d-49e7ad238275"
}, {
"EventIdentity": "b03e33fc-f67f-aaa4-b250-7bfbd778bf7f",
"HostKey": "1920#SPLUSF0B774",
"Description": "LOGIC",
"EndDateTime": "2019-11-07T11:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T10:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:22:49.4384725+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA208[1] LOGIC",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Sinclair D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA208[1]L2",
"Identity": "dfd19a20-387b-4115-a4fe-700e394fe706"
}, {
"EventIdentity": "b44d3aac-8cc1-bb10-5e81-b3b3010ca4a6",
"HostKey": "1920#SPLUS01B8B3",
"Description": "LOGIC",
"EndDateTime": "2019-11-04T12:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.L101, GLA.L125",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T11:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:25:45.7884621+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA208[1] LOGIC",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Sinclair D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA208[1]P1",
"Identity": "74869f0a-a9cb-4720-bb25-9c6783973376"
}, {
"EventIdentity": "d468d694-ff6a-bdfc-e126-01a56bf0a3fd",
"HostKey": "1920#SPLUS641D03",
"Description": "Systems Analysis",
"EndDateTime": "2019-11-07T14:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T13:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:23:22.3163286+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA214/228[1] Systems Analysis",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Yilmaz M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA214/228[1]L1",
"Identity": "f0485217-535b-45be-a330-3b4a0e12d752"
}, {
"EventIdentity": "fcdb3766-02f3-19d2-e1dd-da95c71731ac",
"HostKey": "1920#SPLUS641D05",
"Description": "Systems Analysis",
"EndDateTime": "2019-11-05T12:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.SA301",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T11:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:28:37.5448021+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA214/228[1] Systems Analysis",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Yilmaz M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA214/228[1]L2",
"Identity": "43dcc1c6-fc34-4981-adab-1914a221c8a8"
}, {
"EventIdentity": "0ff73494-d6ae-119c-8bee-be270e4b3018",
"HostKey": "1920#SPLUSF9ECA1",
"Description": "Computer Programming 3 (Data Structure and Algorithms)",
"EndDateTime": "2019-11-04T13:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T12:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:34:09.3682517+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA268[1] Computer Programming 3 (Data Structure and Algorithms)",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Daly C",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA268(1)L1",
"Identity": "e3037683-43c6-476a-bff3-7663815801fe"
}, {
"EventIdentity": "c921d938-c7b8-491d-84a8-51b23e5b93c1",
"HostKey": "1920#SPLUSF9ECA3",
"Description": "Computer Programming 3 (Data Structure and Algorithms)",
"EndDateTime": "2019-11-07T10:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T09:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:36:17.555BB8179+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA268[1] Computer Programming 3 (Data Structure and Algorithms)",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Daly C",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA268(1)L2",
"Identity": "9758a0a1-fac6-448b-a96b-cf6c57caa13c"
}, {
"EventIdentity": "0e1c94c7-e4bd-f25c-4cf5-8c5624cf595f",
"HostKey": "1920#SPLUSF9ECA5",
"Description": "Computer Programming 3 (Data Structure and Algorithms)",
"EndDateTime": "2019-11-05T11:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.L125, GLA.LG25",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T09:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-26T15:38:26.0247305+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA268[1] Computer Programming 3 (Data Structure and Algorithms)",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Daly C",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA268(1)P1",
"Identity": "ed7aa179-9314-4589-8b66-ee06433cb85c"
}, {
"EventIdentity": "0e3b360f-f1d7-5c6d-fbbd-51ae73237be7",
"HostKey": "1920#SPLUSC0E34B 001",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-04T16:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T15:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-17T13:20:37.6861585+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]L1",
"Identity": "23ec4305-d9a3-4fa8-a49a-945326ce3918"
}, {
"EventIdentity": "0668b093-9d62-80c9-3128-9022a20cae2a",
"HostKey": "1920#SPLUSFC9EDD 001",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-04T17:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T16:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-17T13:10:26.7122119+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]L2",
"Identity": "3d23504d-235a-4d1f-811f-02db95f6a162"
}, {
"EventIdentity": "a7c58b79-69ec-f4d3-0a58-652e282686bb",
"HostKey": "1920#SPLUSAC20C8",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-06T11:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.XG14",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-06T10:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-10-31T15:52:34.2723602+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "7",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]L3z",
"Identity": "a517ca50-8ae0-41c6-bdea-f48063f0ef73"
}, {
"EventIdentity": "b627d7f4-98da-164f-c3e8-496f97c48f7e",
"HostKey": "1920#SPLUS57685A 002",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-08T13:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.L101, GLA.L128, GLA.LG27",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-08T11:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-10-31T14:52:33.8916952+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]P1",
"Identity": "0be58a9c-0ae4-43c5-b898-5523e34882a7"
}],
"Name": "CASE2",
"Identity": "38b55ac0-a242-23d3-4a10-79f11bdd780c"
}]

+ 0
- 16
src/python/case2parsed.json View File

@@ -1,16 +0,0 @@
1
1
3
0
3
0
3
1
0
3
1
0
0
2
4
{"8": ["Free", "Free", "Free", "Free", "Free"], "9": ["Free", "GLA.L125, GLA.LG25\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free", "GLA.CG12\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free"], "10": ["GLA.HG23\nLOGIC\nSinclair D", "Free", "GLA.XG14\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "GLA.CG12\nLOGIC\nSinclair D", "Free"], "11": ["GLA.L101, GLA.L125\nLOGIC\nSinclair D", "GLA.SA301\nSystems Analysis\nYilmaz M", "Free", "Free", "GLA.L101, GLA.L128, GLA.LG27\nComputer Architecture & Assembly Level Programming\nFitzpatrick D"], "12": ["GLA.HG23\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free", "Free", "Free", "Free"], "13": ["Free", "GLA.CG12\nIntro to Databases\nRoantree M", "Free", "GLA.HG23\nSystems Analysis\nYilmaz M", "Free"], "14": ["Free", "Free", "Free", "Free", "Free"], "15": ["GLA.HG23\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "Free", "Free", "Free", "Free"], "16": ["GLA.HG23\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "GLA.CG12\nCA218[1] Intro to Databases, CA119[1] Intro to Databases\nRoantree M", "Free", "GLA.LG26, GLA.LG25\nIntro to databases\nRoantree M", "Free"], "17": ["Free", "Free", "Free", "Free", "Free"], "18": ["Free", "Free", "Free", "Free", "Free"]}

+ 0
- 47
src/python/parse.py View File

@@ -1,47 +0,0 @@
import json
import sys


def main(fname):
with open(fname, 'r') as f:
d = json.loads(f.read())
d = d[0]

start = {
8: [None,None,None,None,None,],
9: [None,None,None,None,None,],
10: [None,None,None,None,None,],
11: [None,None,None,None,None,],
12: [None,None,None,None,None,],
13: [None,None,None,None,None,],
14: [None,None,None,None,None,],
15: [None,None,None,None,None,],
16: [None,None,None,None,None,],
17: [None,None,None,None,None,],
18: [None,None,None,None,None,],
}

for v in d['CategoryEvents']:
key = int(v['StartDateTime'].split("T")[1][:2])
day = int(v['StartDateTime'].split("T")[0][-2:]) - 4
print(day)
location = v['Location']
module = v['Description']
if not(module):
module = v['ExtraProperties'][0]['Value']
lecturer = v['ExtraProperties'][1]['Value']
s = location + "\n" + module + "\n" + lecturer
start[key][day] = s
for k in range(8,19):
for i in range(5):
if start[k][i] == None:
start[k][i] = "Free"
print(json.dumps(start))



if __name__ == "__main__":
main(sys.argv[1])

Loading…
Cancel
Save