Package schrodinger :: Module structure :: Class PropertyName
[hide private]
[frames] | no frames]

Class PropertyName

object --+
         |
        PropertyName

The PropertyName class can be used to display the "user-readable" version of an entry or atom property to the user.

Properties are stored in .mae files with names in the form type_family_name, where type is a datatype indicator, family indicates the owner or creator of the property, and name is the name of the property. These strings are used as the keys in the property dictionary attributes of Structure, _StructureAtom, and _StructureBond. Examples include s_m_title, which is a string created by Maestro with the name "title", and i_m_residue_number, which is an integer created by Maestro with the name "residue number".

Instance Methods [hide private]
 
__init__(self, dataname=None, type=None, family=None, username=None)
The PropertyName constructor operates in one of two modes - either a dataname needs to be provided, or each of type, family, and username needs to be provided.
 
dataName(self)
Returns the m2io data name of form type_family_name.
 
userName(self)
Returns the user name of this property.
 
__str__(self)
Convert this PropertyName to a string
 
__eq__(self, other)
Compare this property to a string property name
 
__ne__(self, other)
Check for inequality; opposite of above

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dataname=None, type=None, family=None, username=None)
(Constructor)

 

The PropertyName constructor operates in one of two modes - either a dataname needs to be provided, or each of type, family, and username needs to be provided.

Parameters:
  • dataname (str) - The full property name, e.g. 's_m_title'.
  • type (enum) - The property value type, which must be 's', 'r', 'i', or 'b'. You can also use the predefined module constants PROP_STRING, PROP_FLOAT (or equivalently PROP_REAL), PROP_INTEGER, and PROP_BOOLEAN.
  • family (str) - The family/owner of the property. If the family is one of the recognized long family names (e.g. 'QikProp' - see the keys of the PROP_SHORT_NAME dict), the short family name is assigned automatically.
  • username (str) - The name a user would see displayed in the Maestro project table. Underscores are replaced with spaces unless protected by a backslash (in which case the backslash is not displayed). Internally, PropertyName will store the 'name', which is the fragment of the dataname that is not the type or family.
Overrides: object.__init__

dataName(self)

 

Returns the m2io data name of form type_family_name.

This is the fully qualified name that includes the type, owner and name and should be used for all lookup, indexing, etc.

userName(self)

 

Returns the user name of this property. User name is the shortened, user-readable name that should *only* be used when presenting this property to the user, such as in a GUI pull down menu.

Since data names can NOT have spaces in them, while user names can, we have a convention where a space in a user name is represented as an underscore in the data name, and an underscore in the user name has to be escaped with a backslash in the data name.

Replace '\_' with '_', and '_' with ' ' before returning the user name

__str__(self)
(Informal representation operator)

 

Convert this PropertyName to a string

Overrides: object.__str__