Back to index

python-cliapp  1.20120630
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
cliapp.settings.StringListSetting Class Reference
Inheritance diagram for cliapp.settings.StringListSetting:
Inheritance graph
[legend]
Collaboration diagram for cliapp.settings.StringListSetting:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def default_metavar
def get_value
def set_value
def has_value
def parse_value
def format
def call_get_value
def call_set_value

Public Attributes

 default
 using_default_value
 value
 names
 help
 metavar
 group

Static Public Attributes

string action = 'append'
string type = 'string'
int nargs = 1
 choices = None

Private Attributes

 _string_value

Detailed Description

Definition at line 74 of file settings.py.


Constructor & Destructor Documentation

def cliapp.settings.StringListSetting.__init__ (   self,
  names,
  default,
  help,
  metavar = None,
  group = None 
)

Reimplemented from cliapp.settings.Setting.

Definition at line 78 of file settings.py.

00078 
00079     def __init__(self, names, default, help, metavar=None, group=None):
00080         Setting.__init__(self, names, [], help, metavar=metavar, group=group)
00081         self.default = default
00082         self.using_default_value = True


Member Function Documentation

def cliapp.settings.Setting.call_get_value (   self) [inherited]

Definition at line 50 of file settings.py.

00050 
00051     def call_get_value(self):
00052         return self.get_value()
        

Here is the call graph for this function:

def cliapp.settings.Setting.call_set_value (   self,
  value 
) [inherited]

Definition at line 53 of file settings.py.

00053 
00054     def call_set_value(self, value):
00055         self.set_value(value)

Here is the call graph for this function:

Reimplemented from cliapp.settings.Setting.

Definition at line 83 of file settings.py.

00083 
00084     def default_metavar(self):
00085         return self.names[0].upper()

Reimplemented from cliapp.settings.Setting.

Definition at line 102 of file settings.py.

00102 
00103     def format(self): # pragma: no cover
00104         return ', '.join(self.value)
00105 

Reimplemented from cliapp.settings.Setting.

Definition at line 86 of file settings.py.

00086 
00087     def get_value(self):
00088         if self._string_value.strip():
00089             return [s.strip() for s in self._string_value.split(',')]
00090         else:
00091             return self.default
        

Reimplemented from cliapp.settings.Setting.

Definition at line 96 of file settings.py.

00096 
00097     def has_value(self):
00098         return self.value != []
        
def cliapp.settings.StringListSetting.parse_value (   self,
  string 
)

Reimplemented from cliapp.settings.Setting.

Definition at line 99 of file settings.py.

00099 
00100     def parse_value(self, string):
00101         self.value = [s.strip() for s in string.split(',')]
        
def cliapp.settings.StringListSetting.set_value (   self,
  strings 
)

Reimplemented from cliapp.settings.Setting.

Definition at line 92 of file settings.py.

00092 
00093     def set_value(self, strings):
00094         self._string_value = ','.join(strings)
00095         self.using_default_value = False


Member Data Documentation

Reimplemented from cliapp.settings.Setting.

Definition at line 93 of file settings.py.

string cliapp.settings.StringListSetting.action = 'append' [static]

Reimplemented from cliapp.settings.Setting.

Definition at line 76 of file settings.py.

cliapp.settings.Setting.choices = None [static, inherited]

Reimplemented in cliapp.settings.ChoiceSetting.

Definition at line 32 of file settings.py.

Definition at line 80 of file settings.py.

Definition at line 39 of file settings.py.

Definition at line 37 of file settings.py.

Definition at line 38 of file settings.py.

Definition at line 35 of file settings.py.

int cliapp.settings.Setting.nargs = 1 [static, inherited]

Reimplemented in cliapp.settings.BooleanSetting.

Definition at line 31 of file settings.py.

string cliapp.settings.Setting.type = 'string' [static, inherited]

Definition at line 81 of file settings.py.

Reimplemented from cliapp.settings.Setting.

Definition at line 100 of file settings.py.


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