How to use the rwslib.builders.common.bool_to_true_false function in rwslib

To help you get started, we’ve selected a few rwslib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mdsol / rwslib / rwslib / builders / metadata.py View on Github external
def build(self, builder):
        """Build XML by appending to builder"""
        params = dict(OID=self.oid,
                      Active=bool_to_true_false(self.active),
                      BypassDuringMigration=bool_to_true_false(self.bypass_during_migration),
                      NeedsRetesting=bool_to_true_false(self.needs_retesting)
                      )

        builder.start('mdsol:EditCheckDef', params)
        for step in self.check_steps:
            step.build(builder)

        for action in self.check_actions:
            action.build(builder)
        builder.end('mdsol:EditCheckDef')
github mdsol / rwslib / rwslib / builders / metadata.py View on Github external
def build(self, builder):
        """Build XML by appending to builder"""
        params = dict(
            OID=self.oid,
            Active=bool_to_true_false(self.active),
            BypassDuringMigration=bool_to_true_false(self.bypass_during_migration),
            NeedsRetesting=bool_to_true_false(self.needs_retesting)
        )

        if self.variable_oid is not None:
            params['VariableOID'] = self.variable_oid

        if self.field_oid is not None:
            params['FieldOID'] = self.field_oid

        if self.form_oid is not None:
            params['FormOID'] = self.form_oid

        if self.folder_oid is not None:
            params['FolderOID'] = self.folder_oid

        if self.record_position is not None:
            params['RecordPosition'] = str(self.record_position)
github mdsol / rwslib / rwslib / builders / metadata.py View on Github external
params['FolderOID'] = self.folder_oid

        if self.record_position is not None:
            params['RecordPosition'] = str(self.record_position)

        if self.form_repeat_number is not None:
            params['FormRepeatNumber'] = str(self.form_repeat_number)

        if self.folder_repeat_number is not None:
            params['FolderRepeatNumber'] = str(self.folder_repeat_number)

        if self.all_variables_in_folders is not None:
            params['AllVariablesInFolders'] = bool_to_true_false(self.all_variables_in_folders)

        if self.all_variables_in_fields is not None:
            params['AllVariablesInFields'] = bool_to_true_false(self.all_variables_in_fields)

        if self.logical_record_position is not None:
            params['LogicalRecordPosition'] = self.logical_record_position.value

        builder.start('mdsol:DerivationDef', params)
        for step in self.derivation_steps:
            step.build(builder)
        builder.end('mdsol:DerivationDef')
github mdsol / rwslib / rwslib / builders / metadata.py View on Github external
def build(self, builder):
        """Build XML by appending to builder"""
        params = dict(
            OID=self.oid,
            Active=bool_to_true_false(self.active),
            BypassDuringMigration=bool_to_true_false(self.bypass_during_migration),
            NeedsRetesting=bool_to_true_false(self.needs_retesting)
        )

        if self.variable_oid is not None:
            params['VariableOID'] = self.variable_oid

        if self.field_oid is not None:
            params['FieldOID'] = self.field_oid

        if self.form_oid is not None:
            params['FormOID'] = self.form_oid

        if self.folder_oid is not None:
            params['FolderOID'] = self.folder_oid
github mdsol / rwslib / rwslib / builders / metadata.py View on Github external
params['FormOID'] = self.form_oid

        if self.folder_oid is not None:
            params['FolderOID'] = self.folder_oid

        if self.record_position is not None:
            params['RecordPosition'] = str(self.record_position)

        if self.form_repeat_number is not None:
            params['FormRepeatNumber'] = str(self.form_repeat_number)

        if self.folder_repeat_number is not None:
            params['FolderRepeatNumber'] = str(self.folder_repeat_number)

        if self.all_variables_in_folders is not None:
            params['AllVariablesInFolders'] = bool_to_true_false(self.all_variables_in_folders)

        if self.all_variables_in_fields is not None:
            params['AllVariablesInFields'] = bool_to_true_false(self.all_variables_in_fields)

        if self.logical_record_position is not None:
            params['LogicalRecordPosition'] = self.logical_record_position.value

        builder.start('mdsol:DerivationDef', params)
        for step in self.derivation_steps:
            step.build(builder)
        builder.end('mdsol:DerivationDef')