Changeset 2484 for palm


Ignore:
Timestamp:
Sep 20, 2017 2:22:42 PM (7 years ago)
Author:
maronga
Message:

updates in palm_jm and palmrungui

Location:
palm/trunk/SCRIPTS
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_jm

    r2068 r2484  
    1616#
    1717# Copyright 1997-2016  Leibniz Universitaet Hannover
    18 #--------------------------------------------------------------------------------#
     18##--------------------------------------------------------------------------------#
    1919#
    2020# Current revisions:
     
    2525# -----------------
    2626# $Id$
     27# Adapted for palmrun with USER_CODE always stored under /JOBS/name/USER_CODE/.
     28# Added PALM logo
     29#
     30# 2068 2016-11-11 21:59:39Z maronga
    2731#
    2832# 2067 2016-11-11 21:55:49Z maronga
     
    6872   palm_dir = out.split("palm")[0] + "palm/" + out.split("palm")[1].split("/")[1]
    6973   out = None
    70    
    71    # remove this line on release
    72 #   palm_dir = '/home/maronga/PUB/thinktank/maronga/job_manager'
    73    
     74     
    7475   job_dir = palm_dir + '/JOBS'
    7576   user_dir = palm_dir + '/USER_CODE'
     
    9596        # Load predefined mainwindow
    9697        uic.loadUi(palm_bin + '/palm_jm_files/palm_jm.ui', self)
     98
     99        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir  + "/trunk/SCRIPTS/palmrungui_files/logo.png"))
     100
     101
    97102   
    98103        # Display MainWindow
     
    100105        QtGui.QApplication.processEvents()
    101106
    102         self.load_jobs()
     107        #self.load_jobs()
    103108
    104109   
     
    149154                self.list_input.addItem(str(list_of_files[i]))
    150155 
    151        job_to_show = user_dir + "/" + self.list_jobs.currentItem().text()
     156       job_to_show = job_dir + "/" + self.list_jobs.currentItem().text() + "/USER_CODE"
    152157       
    153158       if ( os.path.isdir(job_to_show) ):
     
    199204             shutil.copy(tmp_file, new_file)
    200205
    201 #      copy and rename user code (if present)
    202        user_code_to_copy = user_dir + "/" + old_job_name
    203        new_user_code_dir = user_dir + "/" + new_job_name
    204 
    205 #      check if a job exists with the new job name 
    206        if ( os.path.isdir(new_user_code_dir) ):
    207            notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directory with the new name already exists.")
     206
     207
     208
     209       new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
     210       
     211#      check if user code exists in the new job directory
     212       if ( os.path.isdir(new_user_dir) ):
     213           notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.")
    208214           self.setEnabled(True)
    209215           return
    210216       else:
    211            os.makedirs(new_user_code_dir)
    212 
    213        if ( os.path.isdir(user_code_to_copy) ):
    214 
    215           list_of_files = os.listdir(user_code_to_copy)
     217           os.makedirs(new_user_dir)
     218
     219
     220#      copy user code files (if present)       
     221       user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE"
     222
     223       if ( os.path.isdir(user_to_copy) ):
     224
     225          list_of_files = os.listdir(user_to_copy)
    216226         
    217227          for i in range(0,len(list_of_files)):
    218228
    219              tmp_file = user_code_to_copy + "/" + list_of_files[i]       
    220              new_file = new_user_code_dir + "/" + list_of_files[i]
     229             tmp_file = user_to_copy + "/" + list_of_files[i]         
     230             new_file = new_user_dir + "/" + list_of_files[i]
    221231             shutil.copy(tmp_file, new_file)
    222232
     
    269279                shutil.copy(tmp_file, new_file)
    270280
    271 #         copy and rename user code (if present)
    272           user_code_to_copy = user_dir + "/" + old_job_name
    273           new_user_code_dir = user_dir + "/" + new_job_name
    274 
    275 #         check if a job exists with the new job name 
    276           if ( os.path.isdir(new_user_code_dir) ):
    277              notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directory with the new name already exists.")
    278              self.setEnabled(True)
    279              return
     281
     282          new_user_dir  = job_dir + "/" + new_job_name + "/USER_CODE"
     283       
     284#         check if user code exists in the new job directory
     285          if ( os.path.isdir(new_user_dir) ):
     286              notify = QtGui.QMessageBox.warning(self,'Create new user code directory',"Error. Could not create user code directory. A user code directiory with the new name already exists.")
     287              self.setEnabled(True)
     288              return
    280289          else:
    281              os.makedirs(new_user_code_dir)
    282 
    283           if ( os.path.isdir(user_code_to_copy) ):
    284 
    285              list_of_files = os.listdir(user_code_to_copy)
     290              os.makedirs(new_user_dir)
     291
     292
     293#         copy user code files (if present)       
     294          user_to_copy = job_dir + "/" + old_job_name + "/USER_CODE"
     295
     296          if ( os.path.isdir(user_to_copy) ):
     297
     298             list_of_files = os.listdir(user_to_copy)
    286299         
    287300             for i in range(0,len(list_of_files)):
    288301
    289                 tmp_file = user_code_to_copy + "/" + list_of_files[i]       
    290                 new_file = new_user_code_dir + "/" + list_of_files[i]
     302                tmp_file = user_to_copy + "/" + list_of_files[i]         
     303                new_file = new_user_dir + "/" + list_of_files[i]
    291304                shutil.copy(tmp_file, new_file)
    292305
     
    345358       sel_files = self.list_user.selectedItems()
    346359       
    347        input_dir = user_dir + "/" + sel_job + "/"
     360       input_dir = job_dir + "/" + sel_job + "/USER_CODE/"
    348361       
    349362       open_files = ""
  • palm/trunk/SCRIPTS/palm_jm_files/palm_jm.ui

    r2065 r2484  
    198198    </property>
    199199   </widget>
     200   <widget class="QLabel" name="palm_logo">
     201    <property name="geometry">
     202     <rect>
     203      <x>630</x>
     204      <y>340</y>
     205      <width>79</width>
     206      <height>72</height>
     207     </rect>
     208    </property>
     209    <property name="text">
     210     <string/>
     211    </property>
     212    <property name="pixmap">
     213     <pixmap>../../../../nesting_version/trunk/SCRIPTS/palm_jm_files/palm_logo_black_and_blue.png</pixmap>
     214    </property>
     215    <property name="scaledContents">
     216     <bool>true</bool>
     217    </property>
     218   </widget>
    200219  </widget>
    201220  <widget class="QMenuBar" name="menubar">
  • palm/trunk/SCRIPTS/palmrungui.py

    r2480 r2484  
    2525# -----------------
    2626# $Id$
     27# Added PALM logo
     28#
     29# 2480 2017-09-19 06:24:14Z maronga
    2730# option -A (project account number) added
    2831#
     
    9396    def __init__(self, parent=None):
    9497        super(Mainwindow, self).__init__()
    95        
    9698        self.setupUi(self)
     99       
     100        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))   
     101       
    97102        self.recent_jobs(50)
    98103        commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
     
    100105       
    101106        self.tabWidget.setCurrentIndex(0) 
     107       
    102108       
    103109        filename = "%s/.palmrun.gui.default" % (version_path) 
     
    842848    ##############################
    843849    def setup_gui(self, palmrun_str): 
     850     
     851        self.palm_logo.setPixmap(QtGui.QPixmap(palm_dir + "/trunk/SCRIPTS/palmrungui_files/logo.png"))   
     852     
    844853        #  Some initial settings
    845854        user = ""
  • palm/trunk/SCRIPTS/palmrungui_files/mainwindow.ui

    r2480 r2484  
    202202        <x>0</x>
    203203        <y>0</y>
    204         <width>541</width>
    205         <height>331</height>
     204        <width>571</width>
     205        <height>296</height>
    206206       </rect>
    207207      </property>
     
    341341        <x>320</x>
    342342        <y>0</y>
    343         <width>201</width>
     343        <width>251</width>
    344344        <height>281</height>
    345345       </rect>
     
    490490        <x>0</x>
    491491        <y>305</y>
    492         <width>581</width>
     492        <width>431</width>
    493493        <height>206</height>
    494494       </rect>
     
    685685         <x>10</x>
    686686         <y>105</y>
    687          <width>561</width>
     687         <width>431</width>
    688688         <height>20</height>
    689689        </rect>
     
    767767       </property>
    768768      </widget>
     769     </widget>
     770     <widget class="QLabel" name="palm_logo">
     771      <property name="geometry">
     772       <rect>
     773        <x>490</x>
     774        <y>440</y>
     775        <width>77</width>
     776        <height>72</height>
     777       </rect>
     778      </property>
     779      <property name="text">
     780       <string>TextLabel</string>
     781      </property>
     782      <property name="scaledContents">
     783       <bool>true</bool>
     784      </property>
    769785     </widget>
    770786    </widget>
Note: See TracChangeset for help on using the changeset viewer.