프로젝트

일반

사용자정보

개정판 9eef2495

ID9eef24955020086b7391fc4f1ede88b21619aa2c
상위 bc2007f3
하위 1cee8954

백흠경이(가) 약 2년 전에 추가함

경로 생성 시 os.path.join을 사용하도록 수정

Change-Id: I0cfa2792f73658c08cbc0c98c23e971dcf193e63

차이점 보기:

HYTOS/HYTOS/App.py
2 2
""" This is application module """
3 3
import sys
4 4
import os
5
from pywinsparkle import pywinsparkle
5
import platform
6

  
7
if platform.system().lower() == 'windows':
8
    from pywinsparkle import pywinsparkle
9

  
6 10

  
7 11
if hasattr(sys, 'frozen'):
8 12
    os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH']
......
24 28
    COMPANY = 'SECL'
25 29
    NAME = 'HYTOS'  # 'Hydraulic Calculation'  # program name
26 30

  
27
    COMMON_APP_DATA_FOLDER = os.path.join(os.getenv('ALLUSERSPROFILE'), NAME)
28
    LOCAL_APP_DATA_FOLDER = os.path.join(os.getenv('USERPROFILE'), NAME)
31
    if platform.system().lower() == 'windows':
32
        COMMON_APP_DATA_FOLDER = os.path.join(os.getenv('ALLUSERSPROFILE'), NAME)
33
        LOCAL_APP_DATA_FOLDER = os.path.join(os.getenv('USERPROFILE'), NAME)
34
    else:
35
        COMMON_APP_DATA_FOLDER = os.path.join(os.getenv('HOME'), NAME)
36
        LOCAL_APP_DATA_FOLDER = os.path.join(os.getenv('HOME'), NAME)
29 37

  
30 38
    def __init__(self, args):
31 39
        import locale
......
39 47

  
40 48
        configs = app_doc_data.getAppConfigs('app', 'stylesheet')
41 49
        if configs and len(configs) == 1:
42
            self.loadStyleSheet(os.path.dirname(os.path.realpath(__file__)) + '\\{}'.format(configs[0].value))
50
            self.loadStyleSheet(os.path.join(os.path.dirname(os.path.realpath(__file__)), f'{configs[0].value}'))
43 51
            self.stylesheet_name = configs[0].value
44 52
        else:
45
            self.loadStyleSheet(os.path.dirname(os.path.realpath(__file__)) + '\\pagefold')
53
            self.loadStyleSheet(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'pagefold'))
46 54
            self.stylesheet_name = 'pagefold'
47 55

  
48 56
        # load language file
......
69 77

  
70 78
    def loadStyleSheet(self, sheetName):
71 79
        try:
72
            file = QFile('%s.qss' % sheetName.lower())
80
            file = QFile(f'{sheetName}.qss')
73 81
            file.open(QFile.ReadOnly)
74 82

  
75 83
            styleSheet = file.readAll()
HYTOS/HYTOS/MainWindow.py
10 10
from FreezeTableWidget import FreezeTableWidget
11 11

  
12 12
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
13
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Commands')
13
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Commands'))
14 14
import CreateCommand
15 15
import AreaZoomCommand
16 16
import PlaceStreamlineCommand
......
25 25
import QtImageViewer
26 26
from SingletonInstance import SingletonInstane
27 27

  
28
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Shapes')
28
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Shapes'))
29 29
from SymbolSvgItem import SymbolSvgItem
30 30

  
31 31
from EngineeringErrorItem import QEngineeringErrorItem
HYTOS/HYTOS/QtImageViewer.py
12 12
    except ImportError:
13 13
        raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.")
14 14
    
15
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Commands')
15
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Commands'))
16 16
import DefaultCommand, HandCommand
17 17

  
18
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Shapes')
18
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Shapes'))
19 19
from SymbolSvgItem import SymbolSvgItem
20 20

  
21 21
__author__ = "Marcel Goldschen-Ohm <marcel.goldschen@gmail.com>"
HYTOS/HYTOS/SymbolEditorDialog.py
14 14
import SymbolEditor_UI
15 15
from AppDocData import * 
16 16

  
17
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Commands')
17
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Commands'))
18 18
import CropCommand, HandCommand, ZoomCommand, PenCommand, EraserCommand, AreaEraserCommand, OriginalPointCommand, ConnectionPointCommand, AreaZoomCommand, RotateImageCommand, FlipImageCommand
19 19

  
20 20

  
HYTOS/HYTOS/SystemInformation.py
12 12
import sys
13 13
import socket
14 14
import platform
15
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\UI')
15
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'UI'))
16 16
from AppDocData import AppDocData, Config
17 17
import SystemInformation_UI
18 18
import math
HYTOS/HYTOS/TextItemFactory.py
16 16
        raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.")
17 17
from AppDocData import *
18 18
import sys, os
19
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '\\Shapes')
19
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Shapes'))
20 20
from EngineeringTextItem import QEngineeringTextItem
21 21
from EngineeringLineNoTextItem import QEngineeringLineNoTextItem
22 22
from QEngineeringSizeTextItem import QEngineeringSizeTextItem

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)