Changeset 99


Ignore:
Timestamp:
11/23/05 15:52:53 (18 years ago)
Author:
bas
Message:

distro/src/PBSQuery.py:

  • Can now handle exceptions, eg if we can not make an connection with the server

distro/pbs_python.spec:

  • New spec file from Martin
Location:
trunk/pbs_swig/distro
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_swig/distro/CHANGES

    r98 r99  
    77find the pbs/torque libraries. If unset it will use
    88some useful defaults to find the libaries.
    9 
    109Suggested by: Troy Baer
    1110
    12 
     11PBSQuery.py:
     12        - If we can not make an connection with the server
     13          the raise an exception.
     14
     15pbs_python.spec:
     16        -  It can now handle mode bits
     17        Author: Martin Pels from SARA
     18       
    1319=========== Version 2.8.0
    1420
  • trunk/pbs_swig/distro/pbs_python.spec

    r88 r99  
    11Summary: This package contains the pbs python module.
    22Name: pbs_python
    3 Version: 2.7.10
     3Version: 2.8.1
    44Release: 1
    55Copyright: See LICENSE
     
    1010%description
    1111This package contains the pbs python module.
    12 
    13 %prep
    14 %setup -q
    1512
    1613%build
     
    2421
    2522%files
    26 %defattr(-,root,root)
     23%defattr(-,root,root,0755)
    2724%doc README TODO examples
    2825
     26/usr/lib/python2.2/site-packages
     27/usr/lib/python2.2/site-packages/pbs
    2928/usr/lib/python2.2/site-packages/pbs/pbs.py
    3029/usr/lib/python2.2/site-packages/pbs/PBSQuery.py
     
    3534
    3635%changelog
     36* Tue Nov 22 2005 Martin Pels <pels@sara.nl>
     37- Changed default directory permissions
    3738* Tue Nov 01 2005 Martin Pels <pels@sara.nl>
    3839- Initial version
     40
  • trunk/pbs_swig/distro/src/PBSQuery.py

    r93 r99  
    6161import pbs
    6262
     63class PBSError(Exception):
     64        def __init__(self, msg=''):
     65                self.msg = msg
     66                Exception.__init__(self, msg)
     67        def __repr__(self):
     68                return self.msg
     69        __str__ = __repr__
     70
    6371
    6472class PBSQuery:
     
    7381       """Connect to the PBS/Torque server"""
    7482       self.con = pbs.pbs_connect(self.server)
     83       if self.con < 0:
     84          str = "Could not make an connection with %s\n" %(self.server)
     85          raise PBSError(str)
    7586
    7687    def _disconnect(self):
     
    8697            self.attribs[i].name = attrib
    8798            i = i + 1
     99
     100    def _pbsstr_2_list(self, str, delimiter):
     101        """Convert an string to an python list and use delimiter as spit char"""
     102        l = sting.splitfields(str, delimiter)
     103        if len(l) > 1:
     104           return l
    88105
    89106    def _list_2_dict(self, l, class_func):
Note: See TracChangeset for help on using the changeset viewer.