-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathEducativeScraper.py
42 lines (31 loc) · 1.32 KB
/
EducativeScraper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import ctypes
import platform
import shutil
from src.Common.Constants import constants
from src.UI.HomeScreenGUI import HomeScreen
from src.Utility.ConfigUtility import ConfigUtility
from src.Utility.FileUtility import FileUtility
class EducativeScraper:
def __init__(self):
self.version = "v3.8.0 Master Branch"
print(f"""
Educative Scraper ({self.version}), developed by Anilabha Datta
Project Link: https://github.com/anilabhadatta/educative.io_scraper/
Check out ReadMe for more information about this project.
Use the GUI to start scraping.
""")
if platform.system() == "Windows":
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("EducativeScraper")
self.fileUtil = FileUtility()
self.loadBasicUtility()
def createDefaultConfigIfNotExists(self):
if not self.fileUtil.checkIfFileExists(constants.defaultConfigPath):
shutil.copy(constants.commonConfigPath, constants.defaultConfigPath)
def loadBasicUtility(self):
self.fileUtil.createFolderIfNotExists(constants.OS_ROOT)
self.createDefaultConfigIfNotExists()
def run(self):
HomeScreen().createHomeScreen(self.version)
if __name__ == '__main__':
app = EducativeScraper()
app.run()