Skip to content

Commit 6cd00ed

Browse files
authored
Merge pull request #5 from filips123/improve-date-and-list-handling
2 parents 518e984 + 5f6be3a commit 6cd00ed

File tree

8 files changed

+828
-821
lines changed

8 files changed

+828
-821
lines changed

API/gimvicurnik/updaters/menu.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@ def _get_date(url):
9494

9595
# Example: KOSILO-4jan-8jan-2021.pdf
9696
# Another example: KOSILO-25jan-29jan-2021-PDF.pdf
97-
date = re.search(r"(?:KOSILO|MALICA)-(\d+)([a-z]+)-\d+[a-z]+-(\d+)(?i:-PDF)?.pdf", url)
97+
date = re.search(r"(?:KOSILO|MALICA)-(\d+)([a-z]+)-\d+[a-z]+-(\d+)(?i:-PDF)?\.pdf", url)
9898

9999
if date:
100100
return datetime.date(
101101
year=int(date.group(3)), month=short_month_to_number[date.group(2)], day=int(date.group(1))
102102
)
103103

104104
# Example: 09-splet-oktober-1-teden-09-M.pdf
105-
date = re.search(r"\d+-splet-([a-z]+)-(\d)-teden-\d+-[MK]-?\d?.pdf", url)
105+
# Another example: 05-splet-februar-3-teden-M-PDF.pdf
106+
date = re.search(r"\d+-splet-([a-z]+)-(\d)-teden-?\d*-[MK]-?\d?(?i:-PDF)?\.pdf", url)
106107

107108
if date:
108109
year = datetime.datetime.now().year
@@ -121,6 +122,7 @@ def _get_date(url):
121122
# Get start of nth week of month
122123
first = datetime.date(year, month, 1)
123124
diff = -first.weekday() if month == 9 else 7 - first.weekday()
125+
diff = diff if diff < 7 else 0
124126
new = first + datetime.timedelta(weeks=week - 1, days=diff)
125127

126128
return new

API/poetry.lock

Lines changed: 75 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

API/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ python = "^3.6"
4141
PyYAML = "^5.4.1"
4242
Flask = "^1.1.2"
4343
click = "^7.1.2"
44-
schema = "^0.7.3"
44+
schema = "^0.7.4"
4545
requests = "^2.25.1"
46-
SQLAlchemy = "^1.3.22"
46+
SQLAlchemy = "^1.3.23"
4747
pdf2docx = "^0.4.6"
4848
beautifulsoup4 = { extras = ["lxml"], version = "^4.9.3" }
49-
sentry-sdk = { extras = ["flask", "sqlalchemy"], version = "^0.19.5", optional = true }
49+
sentry-sdk = { extras = ["flask", "sqlalchemy"], version = "^0.20.0", optional = true }
5050

5151
[tool.poetry.dev-dependencies]
52-
flakehell = "^0.7.1"
52+
flakehell = "^0.9.0"
5353
black = "^20.8b1"
5454
flake8-black = "^0.2.1"
5555
flake8-bugbear = "^20.11.1"

website/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@
2121
},
2222
"dependencies": {
2323
"@mdi/js": "^5.9.55",
24-
"@sentry/tracing": "^6.0.3",
25-
"@sentry/vue": "^6.0.3",
24+
"@sentry/tracing": "^6.1.0",
25+
"@sentry/vue": "^6.1.0",
2626
"pulltorefreshjs": "^0.1.21",
2727
"register-service-worker": "^1.7.2",
2828
"vue": "^2.6.12",
2929
"vue-class-component": "^7.2.6",
3030
"vue-property-decorator": "^9.1.2",
3131
"vue-router": "^3.5.1",
32-
"vuetify": "^2.4.3",
32+
"vuetify": "^2.4.4",
3333
"vuex": "https://github.com/filips123/vuex#preservestate-options-dist",
3434
"vuex-module-decorators": "https://github.com/filips123/vuex-module-decorators#combined-dist",
3535
"vuex-persist": "^3.1.3"
3636
},
3737
"devDependencies": {
3838
"@types/pulltorefreshjs": "^0.1.4",
39-
"@typescript-eslint/eslint-plugin": "^4.14.1",
40-
"@typescript-eslint/parser": "^4.14.1",
39+
"@typescript-eslint/eslint-plugin": "^4.15.0",
40+
"@typescript-eslint/parser": "^4.15.0",
4141
"@vue/cli-plugin-babel": "^4.5.11",
4242
"@vue/cli-plugin-eslint": "^4.5.11",
4343
"@vue/cli-plugin-pwa": "^4.5.11",
@@ -50,14 +50,14 @@
5050
"eslint": "^7.19.0",
5151
"eslint-plugin-import": "^2.22.1",
5252
"eslint-plugin-node": "^11.1.0",
53-
"eslint-plugin-promise": "^4.2.1",
53+
"eslint-plugin-promise": "^4.3.1",
5454
"eslint-plugin-simple-import-sort": "^7.0.0",
5555
"eslint-plugin-vue": "^7.5.0",
56-
"sass": "^1.32.5",
56+
"sass": "^1.32.7",
5757
"sass-loader": "^10.1.1",
58-
"typescript": " ^4.1.3",
58+
"typescript": " ^4.1.5",
5959
"vue-cli-plugin-vuetify": "^2.1.0",
6060
"vue-template-compiler": "^2.6.12",
61-
"vuetify-loader": "^1.7.1"
61+
"vuetify-loader": "^1.7.2"
6262
}
6363
}

website/src/components/settings/entitySelection/SelectClass.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ import { displaySnackbar } from '@/utils/snackbar'
3030
export default class SelectClass extends Vue {
3131
@Prop() isDialog!: boolean
3232
33-
availableClasses = StorageModule.classList
3433
selectedClasses: string[] = []
3534
saveSelection = true
3635
36+
get availableClasses (): ({value: string, text: string} | string)[] {
37+
return StorageModule.classList || []
38+
}
39+
3740
closeDialog (): void {
3841
this.$emit('closeDialog')
3942
}

website/src/components/settings/entitySelection/SelectClassroom.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ import { displaySnackbar } from '@/utils/snackbar'
3131
export default class SelectClassroom extends Vue {
3232
@Prop() isDialog!: boolean
3333
34-
availableClassrooms = [{ value: 'empty', text: 'Proste učilnice' }, ...(StorageModule.classroomList || [])]
3534
selectedClassroom: string | null = null
3635
saveSelection = true
3736
37+
get availableClassrooms (): ({value: string, text: string} | string)[] {
38+
return [{ value: 'empty', text: 'Proste učilnice' }, ...(StorageModule.classroomList || [])]
39+
}
40+
3841
closeDialog (): void {
3942
this.$emit('closeDialog')
4043
}

website/src/components/settings/entitySelection/SelectTeacher.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ import { displaySnackbar } from '@/utils/snackbar'
2727
export default class SelectTeacher extends Vue {
2828
@Prop() isDialog!: boolean
2929
30-
availableTeachers = StorageModule.teacherList
3130
selectedTeacher: string | null = null
3231
saveSelection = true
3332
33+
get availableTeachers (): ({value: string, text: string} | string)[] {
34+
return StorageModule.teacherList || []
35+
}
36+
3437
closeDialog (): void {
3538
this.$emit('closeDialog')
3639
}

0 commit comments

Comments
 (0)