Ignore:
Timestamp:
Feb 4, 2020 9:24:48 PM (20 months ago)
Author:
maronga
Message:

removed PALM_BIN dependencies in GUI tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_jm

    r2825 r4393  
    2525# -----------------
    2626# $Id$
     27# Removed PALM_BIN dependency
     28#
     29# 2825 2018-02-20 21:48:27Z maronga
    2730# Modified header
    2831#
     
    7780
    7881
     82
    7983# Determine PALM directories
    8084try:
    81    devnull = open(os.devnull, 'w')
    82    out = sub.check_output("echo $PALM_BIN", shell=True, stderr=sub.STDOUT)
    83    palm_bin = out.rstrip()
    84    palm_dir = out.split("palm")[0] + "palm/" + out.split("palm")[1].split("/")[1]
    85    out = None
    86      
     85   devnull = open(os.devnull, 'w')     
     86   palm_dir = os.getcwd()
     87   palm_bin = palm_dir + '/trunk/SCRIPTS'
    8788   job_dir = palm_dir + '/JOBS'
    8889   user_dir = palm_dir + '/USER_CODE'
    89    
     90   with open(palm_bin + '/palm_jm', 'r') as fh:
     91      # file found
     92      out = None
    9093except:   
    91    print "Error. $PALM_BIN is not set."
     94   print ('Error. palm_jm probably called in wrong directory.')
    9295   raise SystemExit
    93 
    9496
    9597
    9698# MainWindow class
    9799class JobManager(QtGui.QMainWindow):
    98    
     100
     101       
    99102    def __init__(self):
     103
    100104        super(JobManager, self).__init__()
    101        
    102         self.InitUi()   
    103        
     105             
     106        self.InitUi()        
     107
    104108   
    105109    # Initialized MainWindow UI
    106110    def InitUi(self):
    107111
     112        print(palm_bin + '/palm_jm_files/palm_jm.ui')
     113
    108114        # Load predefined mainwindow
    109115        uic.loadUi(palm_bin + '/palm_jm_files/palm_jm.ui', self)
    110116
    111117        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir  + "/trunk/SCRIPTS/palmrungui_files/logo.png"))
    112 
    113118
    114119   
    115120        # Display MainWindow
    116121        self.show()
     122       
    117123        QtGui.QApplication.processEvents()
    118124
     125       
    119126        self.load_jobs()
    120127
    121    
    122128    def update_all(self):
    123129 
Note: See TracChangeset for help on using the changeset viewer.