From 1efce34a6bf84e9cc1cf0a6dec42866491f9c213 Mon Sep 17 00:00:00 2001 From: mswindler Date: Fri, 30 Aug 2019 15:02:27 -0600 Subject: [PATCH] Progress on #30 --- launch/unix/manager.sh | 2 +- pipe/app/manager/gui/dialogs.py | 6 ++-- pipe/app/manager/gui/main.py | 6 ++-- pipe/app/manager/gui/resources.py | 2 +- pipe/app/manager/gui/viewmodel.py | 4 +-- pipe/app/manager/main.py | 47 ++++++++++++++++++++----------- 6 files changed, 41 insertions(+), 26 deletions(-) diff --git a/launch/unix/manager.sh b/launch/unix/manager.sh index 5ca87de..c81351e 100755 --- a/launch/unix/manager.sh +++ b/launch/unix/manager.sh @@ -3,7 +3,7 @@ SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source $SOURCEDIR/env.sh export CURRENT_PROGRAM='manager' -export PYTHONPATH=${PYTHONPATH} +export PYTHONPATH="/opt/hfs17.0.352/python/lib/python2.7/site-packages-ui-forced":${PYTHONPATH} echo "Starting Manager..." python pipe/app/manager/main.py diff --git a/pipe/app/manager/gui/dialogs.py b/pipe/app/manager/gui/dialogs.py index c8eb0b4..184edcd 100644 --- a/pipe/app/manager/gui/dialogs.py +++ b/pipe/app/manager/gui/dialogs.py @@ -10,10 +10,10 @@ from PySide2 import QtWidgets, QtGui, QtCore from PySide2.QtCore import Slot -from pipelion.lion_mng.reader import * -from pipelion.lion_mng.body import Body +# from pipelion.lion_mng.reader import * +# from pipelion.lion_mng.body import Body from programWidget import ProgramShelfWidget -from pipelion.lion_mng.writer import cloneDataToUser +# from pipelion.lion_mng.writer import cloneDataToUser import viewmodel as ViewModel class BodyOverviewController(): diff --git a/pipe/app/manager/gui/main.py b/pipe/app/manager/gui/main.py index ba6c0c2..bd0e08c 100644 --- a/pipe/app/manager/gui/main.py +++ b/pipe/app/manager/gui/main.py @@ -10,10 +10,10 @@ from PySide2.QtCore import Slot from app import * -from resources import * -from pipelion.lion_mng.logger import Logger +# from resources import * +# from pipelion.lion_mng.logger import Logger from window import * -from resources import * +# from resources import * import viewmodel as ViewModel def main(): diff --git a/pipe/app/manager/gui/resources.py b/pipe/app/manager/gui/resources.py index f53effb..b3bec26 100644 --- a/pipe/app/manager/gui/resources.py +++ b/pipe/app/manager/gui/resources.py @@ -1,6 +1,6 @@ import sys import os -import pipelion.lion_mng.reader as Reader +# import pipelion.lion_mng.reader as Reader class PipelionResources(): diff --git a/pipe/app/manager/gui/viewmodel.py b/pipe/app/manager/gui/viewmodel.py index 5e5cf88..adedeed 100644 --- a/pipe/app/manager/gui/viewmodel.py +++ b/pipe/app/manager/gui/viewmodel.py @@ -11,8 +11,8 @@ from PySide2.QtCore import Qt, Slot, Signal, QObject from tables import * -import pipelion.lion_mng.reader as Reader -from pipelion.lion_mng.logger import Logger +# import pipelion.lion_mng.reader as Reader +# from pipelion.lion_mng.logger import Logger from resources import * from dialogs import * diff --git a/pipe/app/manager/main.py b/pipe/app/manager/main.py index dbeb176..59a6650 100644 --- a/pipe/app/manager/main.py +++ b/pipe/app/manager/main.py @@ -1,27 +1,33 @@ import os +import sys -print("here") -print(os.getcwd()) - -from PySide import * -print("PyQt version:", PYQT_VERSION_STR) +import PySide2 try: - from PySide import QtGui as QtWidgets - from PySide import QtGui as QtGui - from PySide import QtCore + from PySide import QtGui as QtWidgets + from PySide import QtGui as QtGui + from PySide import QtCore except ImportError: - from PySide2 import QtWidgets, QtGui, QtCore + from PySide2 import QtWidgets + from PySide2 import QtGui + from PySide2 import QtCore import datetime import operator -import os +import pipe.gui.select_from_list as sfl from pipe.am.body import AssetType, Asset, Shot -from pipe.am.environment import Department, Status +from pipe.am.environment import Department from pipe.am.project import Project # from byugui import request_email + +class Status: + ALL = ["one", "two"] + +def get_status(): + return "one" + REF_WINDOW_WIDTH = 1080 REF_WINDOW_HEIGHT = 650 @@ -554,9 +560,9 @@ def init_assigned_user(self, element, item, column): self.tree.setItemWidget(item, column, lineedit) def init_status(self, element, item, column): - item.setText(column, element.get_status()) + item.setText(column, get_status()) combobox = TreeComboBoxItem(item, column) - element_type = element.get_status() + element_type = get_status() type_idx = 0 for idx, type in enumerate(Status.ALL): combobox.addItem(type) @@ -603,7 +609,7 @@ def update_assigned_user(self, element, item, column): self.status_bar.showMessage('"' + user + '" is not a valid username') def update_status(self, element, item, column): - element.update_status(str(item.text(column))) + # element.update_status(str(item.text(column))) self.status_bar.clearMessage() def update_start_date(self, element, item, column): @@ -668,9 +674,18 @@ def sizeHint(self): if __name__ == '__main__': + print("here") + print("sys.argv ", sys.argv) + + try: + self.app = QtWidgets.QApplication(sys.argv) + except: + print("failed to create qapp") + + list = Status.ALL - import sys - app = QtWidgets.QApplication(sys.argv) + print("here 2") window = ElementBrowser() + print("here") window.show() sys.exit(app.exec_())