Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2005 Joint Institute for VLBI in Europe 2 # 3 # This program is free software; you can redistribute it and/or modify 4 # it under the terms of the GNU General Public License as published by 5 # the Free Software Foundation; either version 2 of the License, or 6 # (at your option) any later version. 7 # 8 # This program is distributed in the hope that it will be useful, 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 # GNU General Public License for more details. 12 13 # You should have received a copy of the GNU General Public License 14 # along with this program; if not, write to the Free Software 15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 17 """ 18 19 This module provides the AIPSDisk class and serves as a container for 20 several AIPS-related defaults. It provides some basic infrastructure 21 used by the AIPSTask and AIPSData modules. 22 23 """ 24 25 # Generic Python stuff. 26 import os, sys 27 28 # Generic AIPS functionality. 29 from AIPSUtil import ehex 30 31 # Debug log. Define before including proxies. 32 debuglog = None 33 34 # Available proxies. 35 import LocalProxy 36 from xmlrpclib import ServerProxy 37 3840 41 """Class representing a (possibly remote) AIPS disk. An instance 42 of this class stores an AIPS disk number and the URL of the 43 proxy through which it can be accessed. For local AIPS disks 44 the URL will be None.""" 45 5059 60 61 # Default AIPS user ID. 62 userno = 0 63 64 # List of available proxies. 65 proxies = [ LocalProxy ] 66 67 # AIPS disk mapping. 68 disks = [ None ] # Disk numbers are one-based. 69 70 # AIPS seems to support a maximum of 35 disks. 71 for disk in xrange(1, 36): 72 area = 'DA' + ehex(disk, 2, '0') 73 if not area in os.environ: 74 break 75 disks.append(AIPSDisk(None, disk)) 76 continue 77 78 # Message log. 79 log = None 80 81 82 # The code below is the result of a serious design flaw. It should 83 # really die, but removing it will probably affect most scripts. 8452 """Return the proxy through which this AIPS disk can be 53 accessed.""" 54 if self.url: 55 return ServerProxy(self.url, allow_none=True) 56 return LocalProxy57 58 pass # class AIPSDisk86 87 """Backwards compatibility gunk.""" 88114 115 AIPS = _AIPS() 11690 return sys.modules[__name__].userno92 sys.modules[__name__].userno = value93 userno = property(_get_userno, _set_userno) 9496 return sys.modules[__name__].disks98 sys.modules[__name__].disks = value99 disks = property(_get_disks, _set_disks) 100102 return sys.modules[__name__].log104 sys.modules[__name__].log = value105 log = property(_get_log, _set_log) 106108 return sys.modules[__name__].debuglog110 sys.modules[__name__].debuglog = value111 debuglog = property(_get_debuglog, _set_debuglog) 112 113 pass # class _AIPS
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Nov 28 17:13:10 2008 | http://epydoc.sourceforge.net |