Store internally as a string. Provide validation routines.
Bases: lib.formField.Field
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.ReadFileField
Bases: lib.formField.PositiveNonZeroIntegerField
PIL defines the resolution in two dimensions as a tuple (x, y). Phatch ignores this possibility and simplifies by using only one resolution
Bases: lib.formField.NotEmptyCharField
Bases: object
Base class for fields. This needs to be subclassed but, never used directly.
Required to overwrite: description - describes the expected value
Optional to overwrite to_python - raise here exceptions in case of validation errors (defaults
to string).
to_string - (defaults to string)
Never overwrite: validate - will work right out of the box as exceptions are raised by
the to_python method
get - gets the current value as a string set - sets the current value as a string
You can access the value by self.value_as_string
This field interpolates <variables> within a info. << or >> will be interpolated as < or >
Parameters: |
|
---|
Invisible fields request a different kind of user interaction to change their values than a normal field. In Phatch this is used eg for enabling/disabling actions.
A get_relevant_* method of a Form will show/hide fields which depend on other conditions.
For code: Interpolated, but not translated - value_as_string can be optionally provided to test the expression
Ignore test parameter (only for compatiblity with TestField)
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.NotEmptyCharField
Without extension
Bases: lib.formField.IntegerField
Can be in bytes (bt), kilo bytes (kb), mega bytes (mb), or giga bytes (gb).
>>> FileSizeField('5kb').get()
5120
>>> FileSizeField('5mb').get()
5242880
Bases: lib.formField.Field
Bases: lib.formField.FloatField, lib.formField.SliderField
A value with boundaries set by a slider.
Bases: lib.formField.DictionaryReadFileField
Bases: object
Bases: lib.formField.Field
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.ReadFileField
Bases: lib.formField.PositiveNonZeroIntegerField
PIL defines the resolution in two dimensions as a tuple (x, y). Phatch ignores this possibility and simplifies by using only one resolution
Bases: lib.formField.NotEmptyCharField
Bases: object
Base class for fields. This needs to be subclassed but, never used directly.
Required to overwrite: description - describes the expected value
Optional to overwrite to_python - raise here exceptions in case of validation errors (defaults
to string).
to_string - (defaults to string)
Never overwrite: validate - will work right out of the box as exceptions are raised by
the to_python method
get - gets the current value as a string set - sets the current value as a string
You can access the value by self.value_as_string
This field interpolates <variables> within a info. << or >> will be interpolated as < or >
Parameters: |
|
---|
Invisible fields request a different kind of user interaction to change their values than a normal field. In Phatch this is used eg for enabling/disabling actions.
A get_relevant_* method of a Form will show/hide fields which depend on other conditions.
For code: Interpolated, but not translated - value_as_string can be optionally provided to test the expression
Ignore test parameter (only for compatiblity with TestField)
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.NotEmptyCharField
Without extension
Bases: lib.formField.IntegerField
Can be in bytes (bt), kilo bytes (kb), mega bytes (mb), or giga bytes (gb).
>>> FileSizeField('5kb').get()
5120
>>> FileSizeField('5mb').get()
5242880
Bases: lib.formField.Field
Bases: lib.formField.FloatField, lib.formField.SliderField
A value with boundaries set by a slider.
Bases: lib.formField.DictionaryReadFileField
Bases: lib.formField.ChoiceField
Bases: lib.formField.ChoiceField
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.PilConstantMixin, lib.formField.ChoiceField
Bases: lib.formField.IntegerField
Can be pixels, cm, inch, %.
Bases: lib.formField.FloatField
Bases: lib.formField.IntegerField
Bases: lib.formField.PositiveFloatField
Bases: lib.formField.PositiveIntegerField
Bases: lib.formField.TestFieldMixin, lib.formField.FileField
This is a test field to ensure that the file exists. It could also have been called the MustExistFileField.
Bases: lib.formField.IntegerField
A value with boundaries set by a slider.
Describe here the fields. This is called from the __init__ method.
Parameter: | fields (odict) – an (usually empty) ordered dictionary |
---|
Bases: lib.formField.ChoiceField
Bases: lib.formField.ChoiceField
Bases: lib.formField.NotEmptyCharField
Bases: lib.formField.PilConstantMixin, lib.formField.ChoiceField
Bases: lib.formField.IntegerField
Can be pixels, cm, inch, %.
Bases: lib.formField.FloatField
Bases: lib.formField.IntegerField
Bases: lib.formField.PositiveFloatField
Bases: lib.formField.PositiveIntegerField
Bases: lib.formField.TestFieldMixin, lib.formField.FileField
This is a test field to ensure that the file exists. It could also have been called the MustExistFileField.
Bases: lib.formField.IntegerField
A value with boundaries set by a slider.
Mixin class, the to_python method should
See set_form_field_value in treeEdit.py
Collects files with a certain extension in different folders and stores the files in a dictionary of which the keys are titled versions of the filename.
Phatch uses this for fonts, highlights and masks.
>>> files_dictionary(['/etc/apt'], ['.list'])
{'Sources': '/etc/apt/sources.list'}