Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
Argument Class Reference
Inheritance diagram for Argument:
Boolean Destination Empty Faction FactionList FactionTuple PositiveFraction PositiveInt PositiveIntList PositiveNumber SaveVar ShipFactionPair ShipType ShipTypeList String System SystemTuple TextList TextListTuple ZeroInt

Public Member Functions

def __init__
 
def set
 
def isValid
 
def checkValidity
 
def warn
 
def printwarnings
 

Data Fields

 warnings
 
 value
 
 nextarg
 

Static Public Attributes

string NAME = "Argument"
 

Detailed Description

Definition at line 60 of file verify_missions.py.

Constructor & Destructor Documentation

def __init__ (   self,
  nextarg = None,
  value = NoDefault() 
)

Definition at line 64 of file verify_missions.py.

64 
65  def __init__(self, nextarg=None, value=NoDefault()):
66  self.warnings = []
67  self.value = None
68  self.nextarg = nextarg
69  self.set(value)

Member Function Documentation

def checkValidity (   self)

Definition at line 91 of file verify_missions.py.

91 
92  def checkValidity(self):
93  return True
def isValid (   self)

Definition at line 76 of file verify_missions.py.

References Argument.checkValidity(), Argument.nextarg, Argument.printwarnings(), SaveVariableCondition.value, _Stop.value, Argument.value, ErrorDuringImport.value, Boolean.value, DateTime.value, MiniFieldStorage.value, SetSaveVariable.value, Morsel.value, GUIRadioButton.value, Argument.warn(), and Traverser.warn().

76 
77  def isValid(self):
78 # print "valid %s?"%self.NAME
79  if isinstance(self.value, NoDefault):
80  self.warn("No default exists for unset argument")
81  return False
82  elif isinstance(self.value, Default):
83  return True
84  valid = self.checkValidity()
85  arg = self.nextarg
86  if arg is not None:
87  valid = valid or arg.isValid()
88  if not valid:
89  self.printwarnings()
90  return valid
def printwarnings (   self)

Definition at line 97 of file verify_missions.py.

References Argument.NAME, and Argument.warnings.

97 
98  def printwarnings(self):
99  for warning in self.warnings:
100  print "\'%s\' Argument Warning: "%self.NAME + warning
def set (   self,
  newvalue 
)

Definition at line 70 of file verify_missions.py.

References Argument.nextarg, SaveVariableCondition.value, _Stop.value, Argument.value, ErrorDuringImport.value, Boolean.value, DateTime.value, MiniFieldStorage.value, SetSaveVariable.value, Morsel.value, and GUIRadioButton.value.

70 
71  def set(self, newvalue):
72  self.value = newvalue
73  arg = self.nextarg
74  if arg is not None:
75  arg.set(self.value)
def warn (   self,
  text 
)

Definition at line 94 of file verify_missions.py.

94 
95  def warn(self, text):
96  self.warnings.append(text)

Field Documentation

string NAME = "Argument"
static

Definition at line 62 of file verify_missions.py.

nextarg

Definition at line 67 of file verify_missions.py.

value

Definition at line 66 of file verify_missions.py.

warnings

Definition at line 65 of file verify_missions.py.


The documentation for this class was generated from the following file: