Verified Commit 0b3ee937 authored by Julien Jerphanion's avatar Julien Jerphanion 馃實

Create parent dir for database if not present

parent 8e96158e
Pipeline #42834 passed with stage
in 51 seconds
commit aae49eb806e541301447a437bd929252438405e7 (HEAD -> fix-piers-problems, origin/fix-piers-problems)
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Wed Jul 3 00:07:15 2019 +0200
Create parent dir for database if not present
commit 8e96158ecd0262871853fb89fc90ad6032c7f37d
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Wed Jul 3 00:02:24 2019 +0200
Blackify
commit 2968290b22b5e56f345bcb373e1d6ef7b0cf31d9
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Wed Jul 3 00:00:08 2019 +0200
Remove Literal String Interpolation for portability
Literal String Interpolation was introduced in python 3.6.
See: https://www.python.org/dev/peps/pep-0498/
To be more portable and use older version of python, we remove
this syntax.
commit 9189f8052bc868e94b889e9350180253494a3b04
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Tue Jul 2 23:59:04 2019 +0200
Fix Scrappers and Parsers
commit 10ced9334022809cea87ed7c656c81e2a83afc2b
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Tue Jul 2 23:56:52 2019 +0200
Add instructions on README
commit c6c626e0e914290e0be8badbb2ae8be79b35056b
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Tue Jul 2 08:34:15 2019 +0200
Remove js_dump arg
commit 3caddc310e235222aa725ba315fac6dad58464fe (origin/master, master)
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Sat May 11 10:26:59 2019 +0200
Fix typos
commit baf759c8478f69a6a8a1f574149407c0695369e1
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Thu Apr 11 23:22:25 2019 +0200
Quickly adapt for french transcript
commit 668b622a26abf48f9ca1856e0aaa4c17c52b2a7f
Author: Julien Jerphanion (@jjerphan) <git@jjerphan.xyz>
Date: Sun Apr 7 22:26:55 2019 +0200
Add XMLParser and template
commit 02c5f18e5f9fbe70118be92f937d708abf1c06a7
Merge: d139795 a9d9c74
Author: Julien Jerphanion <julien.jerphanion@etu.utc.fr>
Date: Fri Jan 11 16:58:17 2019 +0100
Merge branch 'improve_latexer' into 'master'
Improving LaTeXer
See merge request jjerphan/Enhanced-Transcript!6
commit a9d9c740e624e9da8174204aaa53df7c62f33c7f (origin/improve_latexer, improve_latexer)
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jan 11 16:51:15 2019 +0100
Updating `requests` in requirements.txt
commit 6251c86d51173ea8e7281c8aa5252a53e8fedb1c (origin/improve_latexer_tmp)
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jan 11 16:47:22 2019 +0100
Done Improving LaTeXer
commit 6e81b33a51a2dc1bd1606ea589c95bf8b22fab49
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jan 11 16:43:39 2019 +0100
Done Improving LaTeXer
commit 6a3115a7c94e247fdca88ec17371d886fb228d9a
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jan 11 12:40:30 2019 +0100
Done Improving LaTeXer
commit d1397951488c2268bc0514d4bcdb84baa7128999
Merge: 7e89faf 00076d5
Author: Julien Jerphanion <julien.jerphanion@etu.utc.fr>
Date: Thu Jan 10 22:52:56 2019 +0100
Merge branch 'studentsDetails' into 'master'
Improving StudentDetails Handling
See merge request jjerphan/Enhanced-Transcript!3
commit 00076d56ca81999ee15279111900343f8f6a09d4 (origin/studentsDetails)
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Mon Aug 13 07:34:08 2018 +0800
Student Details now scrapped directly
commit 7e89faf707b36a38a41cc38f8698793e7b391756
Merge: f5d634f dfe8d93
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Thu Jan 10 14:21:25 2019 +0100
Merge branch 'loriotbe/Enhanced-Transcript-issue_courses'
commit f5d634f40548c5fa5cb3514d8a7d60e03e0ccd5b
Merge: 234d2f0 6a9aa62
Author: Julien Jerphanion <julien.jerphanion@etu.utc.fr>
Date: Thu Jan 10 11:53:20 2019 +0100
Merge branch 'setupCI' into 'master'
CI Setup
See merge request jjerphan/Enhanced-Transcript!5
commit 6a9aa6280014011336c53b57310f529b4820be64 (origin/setupCI)
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jan 9 10:45:07 2019 +0100
Minimalist flake8 setup + splitting settings_and_misc
commit 39d04adba5bec59fb65636f67b72764d051c01c6
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jan 9 10:23:44 2019 +0100
Adding tag for job on the linter
commit dfe8d93f9f780c309a419f98fea1723801b5220b (origin/loriotbe/Enhanced-Transcript-issue_courses)
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jan 9 09:22:32 2019 +0100
Replacing behavior for exceptions
commit f06950f15a1dbf3dd434571a94dbd5b685d3734a
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jan 9 09:18:57 2019 +0100
Formatting doc comments
commit a28182f90735c8ab387a38273d73aad487ed85c8
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Sun Dec 30 12:04:26 2018 +0100
Refactoring
commit f3618a4823f0ba5ed8cd028964475079c30334d3
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Dec 28 19:39:07 2018 +0100
Setup CI 馃殌
commit 7005c008548c495a5f1c8ba282e96954ba740956
Author: Benjamin Loriot <benjamin.loriot@etu.utc.fr>
Date: Fri Oct 5 18:57:37 2018 +0200
Fix issue of table index for scrapping the uvs
commit 9538fd5f93afb994691f4faa14cc1230efae49d6
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Thu Jul 26 20:24:58 2018 +0200
Minimal tests
commit 234d2f012a15d87ed3f7da26c24ec072c840a2c3 (tag: v1.0)
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Thu Jul 26 18:39:54 2018 +0200
Add minimal documentation in README.md
commit 76373be1a37851f7cc64067eee6e312c6bf3b57c
Author: Julien Jerphanion <julien.jerphanion@etu.utc.fr>
Date: Thu Jul 26 16:44:52 2018 +0200
Add LICENSE
commit 7989ff4ec1f9bd39c4166a91f9f961c66adc6a9f
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Thu Jul 26 16:37:25 2018 +0200
Done Refactoring
commit 1732100ff4bf7d223a5362d1f0911d98a956a4a4
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Thu Jul 26 15:12:22 2018 +0200
WIP : Refactoring
commit 2322e5453b354cda687a3706d4bce0bc581f1b70
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Thu Jul 26 11:55:08 2018 +0200
WIP : Refactoring and code commenting
commit 65703a6e4f92e86cd94529ba1105d37174983aae
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jul 25 22:18:15 2018 +0200
Adding settings and code doc
commit 059f3aba163da4d24372731ff3ffd25317860ce7
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jul 25 21:36:01 2018 +0200
Changing semesters' headers
commit 17bec528331b49625420bade6605b536f8b53bbe
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Wed Jul 25 17:56:33 2018 +0200
Small corrections
commit dee54308b182987a15ce8b1fd0dbfc74b4057223
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Tue Jul 24 22:23:51 2018 +0200
Updating requirements
commit e8aa7e20aa4fc73464fb43d37b9c2e9dfb85a5e4
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Tue Jul 24 22:20:44 2018 +0200
Reorganising + Adding translation
commit 478a46b416806981320460b008811c03c2811222
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Tue Jul 24 19:10:37 2018 +0200
Customisation for LaTeX & misc.
commit 6d78fb9e180c64ff4a25d55491f4b64eb3ab5823
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Tue Jul 24 15:17:08 2018 +0200
Extracting + LaTeXing : m'ok
commit 462545e7aae121ba206fec3de06bf3d6fbb1002f
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Sun Jul 22 10:44:50 2018 +0200
Documenting code and first LaTeXisation
commit 350c4d4f94a171b5553942d72af37dbef3377aef
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Sat Jul 21 11:56:12 2018 +0200
WIP : Extraction of courses info
commit 29a127d5fdde3bb9e6e907c43ffa2929091429aa
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jul 20 22:51:24 2018 +0200
WIP : Insertion working ; to clean and to end formatting
commit 8347d0d06fc0e4b587abb7e846b060f7e8bea059
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jul 20 18:32:30 2018 +0200
WIP : 鈽 Models FK ; 鈽 Formatting Results
Next Steps : Scrapping Courses Details and Inserting
commit 46d61083e1fd21cf9d10d7c1e54937e161cd6cdd
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jul 20 17:38:29 2018 +0200
WIP extraction and insertion
commit bd370b46c0aa09da2e55fa3fc692a05f0e08535e
Author: Julien Jerphanion <julien.jerphanion@protonmail.com>
Date: Fri Jul 20 13:15:31 2018 +0200
Initial commit
......@@ -60,24 +60,21 @@ def get_db_string(force_local=False, database_url_file: str = DB_URL_FILE):
:param database_url_file:
:return:
"""
if not force_local and os.path.exists(database_url_file):
file = open(database_url_file, "r")
content = file.readline()
file.close()
parsed = content.replace('"', "").replace("\n", "")
if len(parsed) > 0:
print("Using remote database")
return parsed
db_string = "sqlite:///" + LOCAL_DATABASE
if force_local:
print("Using local database (forced)")
return db_string
if not (os.path.exists(database_url_file)):
print("Using local SQLite database : " + db_string)
return db_string
file = open(database_url_file, "r")
content = file.readline()
file.close()
parsed = content.replace('"', "").replace("\n", "")
if len(parsed) == 0:
print("Using local SQLite database : " + db_string)
else:
print("Using remote database")
return parsed
print("Using local SQLite database : {}".format(db_string))
parent_dir = os.path.dirname(database_url_file)
os.makedirs(parent_dir, exist_ok=True)
return db_string
class StudentDetails:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment