Changeset 831
- Timestamp:
- 03/05/08 15:46:50 (9 months ago)
- Files:
-
- trunk/lib/iraffunctions.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/iraffunctions.py
r828 r831 2031 2031 raise TypeError('unexpected keyword argument: '+key) 2032 2032 if terminal is None and len(kw) == 0: 2033 # will need default values for the next step; try _wutil for them 2034 dftNcol = '80' 2035 dftNlin = '24' 2036 try: 2037 if _sys.stdout.isatty(): 2038 nlines,ncols = _wutil.getTermWindowSize() 2039 dftNcol = str(ncols) 2040 dftNlin = str(nlines) 2041 except: pass # No error message here - may not always be available 2033 2042 # no args: print terminal type and size 2034 2043 print '%s ncols=%s nlines=%s' % (envget('terminal','undefined'), 2035 envget('ttyncols', '80'), envget('ttynlines','24'))2044 envget('ttyncols',dftNcol), envget('ttynlines',dftNlin)) 2036 2045 elif expkw['resize'] or expkw['terminal'] == "resize": 2037 # resize: sets CL env ironmental parameters giving screen size2046 # resize: sets CL env parameters giving screen size; show errors 2038 2047 if _sys.stdout.isatty(): 2039 2048 nlines,ncols = _wutil.getTermWindowSize() … … 2041 2050 elif expkw['terminal']: 2042 2051 set(terminal=expkw['terminal']) 2052 # They are setting the terminal type. Let's at least try to 2053 # get the dimensions if not given. This is more than the CL does. 2054 if (not kw.has_key('nlines')) and (not kw.has_key('ncols')) and \ 2055 _sys.stdout.isatty(): 2056 try: 2057 nlines,ncols = _wutil.getTermWindowSize() 2058 set(ttyncols=str(ncols), ttynlines=str(nlines)) 2059 except: pass # No error msg here - may not always be available 2043 2060 elif expkw['playback'] is not None: 2044 2061 _writeError("stty playback not implemented")
