Skip to content

Commit d15a681

Browse files
committed
qtvcp -use Path for library path instead of INFO
1 parent 8414b5e commit d15a681

9 files changed

Lines changed: 24 additions & 26 deletions

File tree

lib/python/qtvcp/lib/writer/writer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
from PyQt5.QtCore import Qt
1212

1313
from .ext import *
14-
from qtvcp.core import Info
14+
from qtvcp.core import Path
1515

16-
INFO = Info()
17-
ICONPATH = os.path.join(INFO.LIB_PATH, 'images/widgets/writer')
18-
IMAGEPATH = os.path.join(INFO.LIB_PATH, 'images')
16+
PATH = Path()
17+
ICONPATH = os.path.join(PATH.SHAREDIR, 'images/widgets/writer')
18+
IMAGEPATH = os.path.join(PATH.SHAREDIR, 'images')
1919

2020

2121
class Main(QtWidgets.QMainWindow):

lib/python/qtvcp/widgets/dialog_widget.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from qtvcp.widgets.machine_log import MachineLog
3939
from qtvcp.lib.notify import Notify
4040
from qtvcp.widgets.dialogMixin import GeometryMixin
41-
from qtvcp.core import Status, Action, Info, Tool
41+
from qtvcp.core import Status, Action, Info, Tool, Path
4242
from qtvcp import logger
4343

4444
# Instantiate the libraries with global reference
@@ -52,6 +52,7 @@
5252
ACTION = Action()
5353
INFO = Info()
5454
TOOL = Tool()
55+
PATH = Path()
5556
NOTICE = Notify()
5657
LOG = logger.getLogger(__name__)
5758

@@ -2019,7 +2020,7 @@ class RunFromLineDialog(QDialog, GeometryMixin):
20192020
def __init__(self, parent=None):
20202021
super(RunFromLineDialog, self).__init__(parent)
20212022
# Load the widgets UI file:
2022-
self.filename = os.path.join(INFO.LIB_PATH,'widgets_ui', 'runFromLine_dialog.ui')
2023+
self.filename = os.path.join(PATH.SHAREDIR,'widgets_ui', 'runFromLine_dialog.ui')
20232024
try:
20242025
self.instance = uic.loadUi(self.filename, self)
20252026
except AttributeError as e:

lib/python/qtvcp/widgets/mdi_touchy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from PyQt5 import QtCore, QtWidgets, uic
2121

2222
from qtvcp.widgets.widget_baseclass import _HalWidgetBase
23-
from qtvcp.core import Status, Action, Info
23+
from qtvcp.core import Status, Action, Info, Path
2424
from qtvcp import logger
2525

2626
# Instiniate the libraries with global reference
@@ -29,6 +29,7 @@
2929
STATUS = Status()
3030
ACTION = Action()
3131
INFO = Info()
32+
PATH = Path()
3233
LOG = logger.getLogger(__name__)
3334

3435
class mdi:
@@ -172,7 +173,7 @@ def __init__(self, parent=None):
172173
super(MDITouchy, self).__init__(parent)
173174
self.setMinimumSize(265, 325)
174175
# Load the widgets UI file:
175-
self.filename = os.path.join(INFO.LIB_PATH,'widgets_ui', 'mdi_touchy.ui')
176+
self.filename = os.path.join(PATH.SHAREDIR,'widgets_ui', 'mdi_touchy.ui')
176177
try:
177178
self.instance = uic.loadUi(self.filename, self)
178179
except AttributeError as e:

lib/python/qtvcp/widgets/nurbs_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self, parent=None, path=None):
6666
self.bluck_update = True
6767

6868
# Load the widgets UI file:
69-
self.filename = os.path.join(INFO.LIB_PATH,'widgets_ui', 'nurbs_editor.ui')
69+
self.filename = os.path.join(PATH.SHAREDIR,'widgets_ui', 'nurbs_editor.ui')
7070
try:
7171
self.instance = uic.loadUi(self.filename, self)
7272
except AttributeError as e:

lib/python/qtvcp/widgets/richtext_selector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from PyQt5.QtCore import *
55
from PyQt5.QtPrintSupport import *
66

7-
from qtvcp.core import Info
7+
from qtvcp.core import Info, Path
88

99
import os
1010
import sys
1111
import uuid
1212

13-
INFO = Info()
13+
PATH = Path()
1414

1515
FONT_SIZES = [7, 8, 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, 64, 72, 96, 144, 288]
1616
IMAGE_EXTENSIONS = ['.jpg','.png','.bmp']
@@ -70,7 +70,7 @@ class MainWindow(QMainWindow):
7070
def __init__(self, *args, **kwargs):
7171
super(MainWindow, self).__init__(*args, **kwargs)
7272

73-
filepath = os.path.join(INFO.LIB_PATH, 'images/widgets/RichTextEditor')
73+
filepath = os.path.join(PATH.SHAREDIR, 'images/widgets/RichTextEditor')
7474

7575
layout = QVBoxLayout()
7676
self.editor = TextEdit()

lib/python/qtvcp/widgets/runFromLine_dialog.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Qtvcp versa probe
2+
#
33
#
44
# Copyright (c) 2018 Chris Morley <chrisinnanaimo@hotmail.com>
55
#
@@ -31,15 +31,11 @@
3131
INFO = Info()
3232
LOG = logger.getLogger(__name__)
3333

34-
current_dir = os.path.dirname(__file__)
35-
SUBPROGRAM = os.path.abspath(os.path.join(current_dir, 'versa_probe_subprog.py'))
36-
HELP = os.path.join(INFO.LIB_PATH,'widgets_ui', 'versa_usage.html')
37-
3834
class RunFromLineDialog(QtWidgets.QDialog, _HalWidgetBase):
3935
def __init__(self, parent=None):
4036
super(RunFromLineDialog, self).__init__(parent)
4137
# Load the widgets UI file:
42-
self.filename = os.path.join(INFO.LIB_PATH,'widgets_ui', 'runFromLine_dialog.ui')
38+
self.filename = os.path.join(PATH.SHAREDIR,'widgets_ui', 'runFromLine_dialog.ui')
4339
try:
4440
self.instance = uic.loadUi(self.filename, self)
4541
except AttributeError as e:

lib/python/qtvcp/widgets/stylesheeteditor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@
4646
QColorDialog)
4747
from PyQt5 import QtGui, QtCore
4848

49-
from qtvcp.core import Info, Path
49+
from qtvcp.core import Path
5050
from qtvcp.qt_makegui import VCPWindow
5151
from qtvcp import logger
5252
LOG = logger.getLogger(__name__)
53-
INFO = Info()
5453
PATH = Path()
5554
WIDGETS = VCPWindow()
5655

@@ -61,7 +60,7 @@ def __init__(self, parent=WIDGETS, path=None, addBuiltinStyles = True):
6160
super(StyleSheetEditor, self).__init__(parent)
6261
self.setMinimumSize(600, 400)
6362
# Load the widgets UI file:
64-
self.filename = os.path.join(INFO.LIB_PATH,'widgets_ui', 'style_dialog.ui')
63+
self.filename = os.path.join(PATH.SHAREDIR,'widgets_ui', 'style_dialog.ui')
6564
try:
6665
self.instance = uic.loadUi(self.filename, self)
6766
except AttributeError as e:

lib/python/qtvcp/widgets/tool_offsetview.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from PyQt5.QtWidgets import (QTableView, QAbstractItemView, QCheckBox,
2424
QItemEditorFactory,QDoubleSpinBox,QSpinBox,QStyledItemDelegate, qApp)
2525
from qtvcp.widgets.widget_baseclass import _HalWidgetBase
26-
from qtvcp.core import Status, Action, Info, Tool
26+
from qtvcp.core import Status, Action, Info, Tool, Path
2727
from qtvcp import logger
2828

2929
#BASE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
@@ -39,12 +39,13 @@
3939
ACTION = Action()
4040
INFO = Info()
4141
TOOL = Tool()
42+
PATH = Path()
4243
LOG = logger.getLogger(__name__)
4344

4445
# Force the log level for this module
4546
#LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
4647

47-
ICONPATH = os.path.join(INFO.LIB_PATH, 'images/widgets/tool_offsetview')
48+
ICONPATH = os.path.join(PATH.SHAREDIR, 'images/widgets/tool_offsetview')
4849

4950
# custom spinbox controls for editing
5051
class ItemEditorFactory(QItemEditorFactory):

lib/python/qtvcp/widgets/virtualkeyboard.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
from PyQt5 import QtGui, QtWidgets, uic
55
from PyQt5.QtCore import Qt, QEvent
66

7-
from qtvcp.core import Info
7+
from qtvcp.core import Info, Path
88
from qtvcp import logger
99
LOG = logger.getLogger(__name__)
1010

11-
INFO = Info()
11+
PATH = Path()
1212

1313
class VirtualKeyboard(QtWidgets.QWidget):
1414
def __init__(self, parent=None):
1515
super(VirtualKeyboard, self).__init__(parent)
1616
# Load the widgets UI file:
17-
self.filename = os.path.join(INFO.LIB_PATH,'widgets_ui', 'virtual_keyboard.ui')
17+
self.filename = os.path.join(PATH.SHAREDIR,'widgets_ui', 'virtual_keyboard.ui')
1818
try:
1919
self.instance = uic.loadUi(self.filename, self)
2020
except AttributeError as e:

0 commit comments

Comments
 (0)