Back to index

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

List of all members.

Public Member Functions

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

Public Attributes

 names
 help
 metavar
 group

Static Public Attributes

string action = 'store_true'
 nargs = None
 type = None
 choices = None

Properties

 value = property(call_get_value, call_set_value)

Private Attributes

 _string_value

Static Private Attributes

list _trues = ['yes', 'on', '1', 'true']
string _false = 'no'

Detailed Description

Definition at line 119 of file settings.py.


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:

def cliapp.settings.Setting.default_metavar (   self) [inherited]
def cliapp.settings.Setting.format (   self) [inherited]

Reimplemented in cliapp.settings.StringListSetting.

Definition at line 64 of file settings.py.

00064 
00065     def format(self): # pragma: no cover
00066         return str(self.value)
00067 

Reimplemented from cliapp.settings.Setting.

Definition at line 128 of file settings.py.

00128 
00129     def get_value(self):
00130         return self._string_value.lower() in self._trues
        
def cliapp.settings.Setting.has_value (   self) [inherited]

Reimplemented in cliapp.settings.StringListSetting.

Definition at line 58 of file settings.py.

00058 
00059     def has_value(self):
00060         return self.value is not None

def cliapp.settings.Setting.parse_value (   self,
  string 
) [inherited]

Reimplemented in cliapp.settings.StringListSetting.

Definition at line 61 of file settings.py.

00061 
00062     def parse_value(self, string):
00063         self.value = string

def cliapp.settings.BooleanSetting.set_value (   self,
  value 
)

Reimplemented from cliapp.settings.Setting.

Definition at line 131 of file settings.py.

00131 
00132     def set_value(self, value):
00133         def is_true():
00134             if value is True or value is False:
00135                 return value
00136             if type(value) in [str, unicode]:
00137                 return value.lower() in self._trues
00138             return value
00139         if is_true():
00140             self._string_value = self._trues[0]
00141         else:
00142             self._string_value = self._false
00143 


Member Data Documentation

string cliapp.settings.BooleanSetting._false = 'no' [static, private]

Definition at line 126 of file settings.py.

Reimplemented from cliapp.settings.Setting.

Definition at line 139 of file settings.py.

list cliapp.settings.BooleanSetting._trues = ['yes', 'on', '1', 'true'] [static, private]

Definition at line 125 of file settings.py.

string cliapp.settings.BooleanSetting.action = 'store_true' [static]

Reimplemented from cliapp.settings.Setting.

Definition at line 121 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 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.

Reimplemented from cliapp.settings.Setting.

Definition at line 122 of file settings.py.

Reimplemented from cliapp.settings.Setting.

Definition at line 123 of file settings.py.


Property Documentation

Reimplemented in cliapp.settings.StringListSetting.

Definition at line 56 of file settings.py.


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