Package osh :: Package command :: Module version
[frames] | no frames]

Source Code for Module osh.command.version

 1  # osh 
 2  # Copyright (C) Jack Orenstein <jao@geophile.com> 
 3  # 
 4  # This program is free software; you can redistribute it and/or modify 
 5  # it under the terms of the GNU General Public License as published by 
 6  # the Free Software Foundation; either version 2 of the License, or 
 7  # (at your option) any later version. 
 8  # 
 9  # This program is distributed in the hope that it will be useful, 
10  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
12  # GNU General Public License for more details. 
13  # 
14  # You should have received a copy of the GNU General Public License 
15  # along with this program; if not, write to the Free Software 
16  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
17   
18  """C{version} 
19   
20  The osh version number is sent to the output stream. 
21  """ 
22   
23  import osh.config 
24  import osh.core 
25   
26  # CLI 
27 -def _version():
28 return _Version()
29 30 # API
31 -def version():
32 """The osh version number is sent to the output stream. 33 """ 34 return _Version()
35
36 -class _Version(osh.core.Generator):
37 38 # object interface 39
40 - def __init__(self):
41 osh.core.Generator.__init__(self, '', (0, 0))
42 43 44 # BaseOp interface 45
46 - def setup(self):
47 pass
48
49 - def doc(self):
50 return __doc__
51 52 # Generator interface 53
54 - def execute(self):
55 version = osh.config.OSH_VERSION 56 if osh.config.OSH_SUBVERSION: 57 version += '/' + osh.config.OSH_SUBVERSION 58 self.send(version)
59