개정판 080e2e98
change application name to 'HYTOS'
Change-Id: I8b52d18de807c1348dd9cbd7de615a27bca7a529
DTI_PID/DTI_PID/App.py | ||
---|---|---|
11 | 11 |
from PyQt5 import QtWidgets |
12 | 12 |
|
13 | 13 |
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) |
14 |
from AppDocData import AppDocData |
|
15 | 14 |
|
16 | 15 |
class App(QApplication): |
17 | 16 |
""" |
18 | 17 |
This is App class inherits from QApplication |
19 | 18 |
""" |
19 |
|
|
20 |
NAME = 'HYTOS' ### program name |
|
21 |
|
|
20 | 22 |
def __init__(self, args): |
21 | 23 |
import locale |
24 |
from AppDocData import AppDocData |
|
22 | 25 |
|
23 | 26 |
super(App, self).__init__(args) |
24 | 27 |
app_doc_data = AppDocData.instance() |
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
16 | 16 |
from PyQt4.QtGui import * |
17 | 17 |
import numpy as np |
18 | 18 |
|
19 |
from App import App |
|
19 | 20 |
from SingletonInstance import SingletonInstane |
20 | 21 |
import symbol |
21 | 22 |
from NominalPipeSize import NominalPipeSize |
... | ... | |
200 | 201 |
@history 2018.06.29 Jeongwoo Change method to get template db path |
201 | 202 |
''' |
202 | 203 |
def getTemplateDbPath(self): |
203 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
|
|
204 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME)
|
|
204 | 205 |
templateDbPath = os.path.join(path, 'Template.db') |
205 | 206 |
return templateDbPath |
206 | 207 |
|
... | ... | |
211 | 212 |
@date 2018.10.01 |
212 | 213 |
""" |
213 | 214 |
|
214 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
|
|
215 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME)
|
|
215 | 216 |
app_database = os.path.join(path, 'App.db') |
216 | 217 |
return app_database |
217 | 218 |
|
... | ... | |
562 | 563 |
''' |
563 | 564 |
def buildAppDatabase(self): |
564 | 565 |
try: |
565 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
|
|
566 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME)
|
|
566 | 567 |
appDatabaseFilePath = os.path.join(path, 'App.db') |
567 | 568 |
|
568 | 569 |
# Creates or opens a file called mydb with a SQLite3 DB |
... | ... | |
599 | 600 |
def loadAppStyle(self): |
600 | 601 |
style = 'Fusion' |
601 | 602 |
|
602 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
|
|
603 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME)
|
|
603 | 604 |
if not os.path.exists(path): os.makedirs(path) |
604 | 605 |
|
605 | 606 |
self.buildAppDatabase() |
... | ... | |
636 | 637 |
try: |
637 | 638 |
self.buildAppDatabase() |
638 | 639 |
|
639 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
|
|
640 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME)
|
|
640 | 641 |
appDatabaseFilePath = os.path.join(path, 'App.db') |
641 | 642 |
|
642 | 643 |
# Creates or opens a file called mydb with a SQLite3 DB |
... | ... | |
751 | 752 |
@history humkyung 2018.04.19 return Project.db in Program Data folder instead of PROJECT_DB_PATH variable |
752 | 753 |
''' |
753 | 754 |
def getPrjDatabasePath(self): |
754 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID')
|
|
755 |
path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME)
|
|
755 | 756 |
if not os.path.exists(path): os.makedirs(path) |
756 | 757 |
|
757 | 758 |
prjDatabaseFilePath = os.path.join(path, 'Project.db') |
... | ... | |
788 | 789 |
@author euisung |
789 | 790 |
@date 2019.04.02 |
790 | 791 |
''' |
791 |
return os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID', 'Explode.svg')
|
|
792 |
return os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME, 'Explode.svg')
|
|
792 | 793 |
|
793 | 794 |
def updateTitleBlockProperties(self, titleBlockProps): |
794 | 795 |
''' |
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
7 | 7 |
from PyQt5.QtGui import * |
8 | 8 |
from PyQt5.QtWidgets import * |
9 | 9 |
import sqlite3 |
10 |
from App import App |
|
10 | 11 |
from AppDocData import AppDocData |
11 | 12 |
from AppDocData import Config |
12 | 13 |
from AppDocData import Color |
... | ... | |
46 | 47 |
|
47 | 48 |
docData = AppDocData.instance() |
48 | 49 |
self.ui.comboBoxOCRData.addItem('eng') |
49 |
tessdata_path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID', 'Tesseract-OCR', 'tessdata')
|
|
50 |
tessdata_path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME, 'Tesseract-OCR', 'tessdata')
|
|
50 | 51 |
if os.path.isfile(os.path.join(tessdata_path, docData.getCurrentProject().getName() + '.traineddata')): |
51 | 52 |
self.ui.comboBoxOCRData.addItem(docData.getCurrentProject().getName()) |
52 | 53 |
|
DTI_PID/DTI_PID/ExceptionHandler.py | ||
---|---|---|
11 | 11 |
from PyQt5.QtSvg import * |
12 | 12 |
from PyQt5 import QtWidgets |
13 | 13 |
import logging |
14 |
from App import App |
|
14 | 15 |
|
15 | 16 |
class QExceptionHandler(QObject): |
16 | 17 |
""" This is exception handler class """ |
... | ... | |
20 | 21 |
def __init__(self): |
21 | 22 |
super(QExceptionHandler, self).__init__() |
22 | 23 |
|
23 |
self.log_path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID', 'id2.log')
|
|
24 |
self.log_path = os.path.join(os.getenv('ALLUSERSPROFILE'), App.NAME, App.NAME + '.log')
|
|
24 | 25 |
self.logger = logging.getLogger(__name__) |
25 | 26 |
logging.basicConfig(filename=self.log_path , filemode='w', level=logging.CRITICAL) |
26 | 27 |
|
DTI_PID/DTI_PID/WebApi/WebApi.py | ||
---|---|---|
4 | 4 |
from flask import Flask |
5 | 5 |
app = Flask(__name__) |
6 | 6 |
|
7 |
DATABASE = 'C:\\ProgramData\\Digital PID\\App.db'
|
|
7 |
DATABASE = 'C:\\ProgramData\\HYTOS\\App.db'
|
|
8 | 8 |
|
9 | 9 |
def get_db(): |
10 | 10 |
db = getattr(Flask, '_database', None) |
내보내기 Unified diff