2021-09-17 13:02:54 +02:00
|
|
|
#!/usr/bin/python3
|
|
|
|
from courses import Courses
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
def open_spec(specification: str):
|
|
|
|
current = Courses().current
|
|
|
|
|
|
|
|
switcher = {
|
|
|
|
'full': current.notes.open_full,
|
2021-09-18 14:43:18 +02:00
|
|
|
'master': current.notes.open_master,
|
|
|
|
'terminal': current.notes.open_terminal
|
2021-09-17 13:02:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if specification in switcher.keys():
|
|
|
|
return switcher[specification]()
|
|
|
|
|
|
|
|
link_type = {
|
|
|
|
'webpage': 'webpage',
|
|
|
|
'w': 'webpage',
|
|
|
|
'url': 'webpage',
|
|
|
|
'u': 'webpage',
|
|
|
|
'ecampus': 'ecampus',
|
|
|
|
'e': 'ecampus',
|
|
|
|
'sciebo': 'sciebo',
|
|
|
|
's': 'sciebo',
|
|
|
|
'basis': 'basis',
|
|
|
|
'b': 'basis',
|
|
|
|
'github': 'github',
|
|
|
|
'g': 'github'
|
|
|
|
}
|
|
|
|
return current.links.open(link_type[specification])
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
for arg in sys.argv[1:]:
|
|
|
|
open_spec(arg)
|