Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
N21-03-07
SoftRelTools
nt
srt_options_line.py
Go to the documentation of this file.
1
#
2
# srt_options_line.py
3
#
4
# Help with parsing an options line. Really simple stuff, actually; does some help with doing
5
# the error detection, etc.
6
#
7
# Created November 1997 Gordon Watts (Brown)
8
#
9
10
import
string
11
12
class
options_line
:
13
def
__init__
(self, arg_line):
14
self.
_arg_list
= arg_line
15
self.
_index
= 0
16
17
def
length
(self):
18
return
len(self.
_arg_list
)
19
20
def
get_next_option
(self, name):
21
if
self.
_index
>= self.
length
():
22
raise
"Missing option "
+ name
23
result = self.
_arg_list
[self.
_index
]
24
self.
_index
= self.
_index
+ 1
25
return
result
26
27
def
has_more_options
(self):
28
return
self.
_index
< self.
length
()
srt_options_line.options_line.has_more_options
def has_more_options(self)
Definition:
srt_options_line.py:27
srt_options_line.options_line
Definition:
srt_options_line.py:12
srt_options_line.options_line.length
def length(self)
Definition:
srt_options_line.py:17
srt_options_line.options_line.__init__
def __init__(self, arg_line)
Definition:
srt_options_line.py:13
srt_options_line.options_line._arg_list
_arg_list
Definition:
srt_options_line.py:14
srt_options_line.options_line.get_next_option
def get_next_option(self, name)
Definition:
srt_options_line.py:20
srt_options_line.options_line._index
_index
Definition:
srt_options_line.py:15
Generated on Sun Mar 7 2021 14:13:40 for NOvA by
1.8.11