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 
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()
def __init__(self, arg_line)