コード例 #1
0
ファイル: worksheet.py プロジェクト: pbhatnagar3/codalab-cli
 def validate(self):
     '''
     Check a number of basic conditions that would indicate serious errors if
     they do not hold. Right now, validation only checks this worksheet's uuid
     and its name.
     '''
     spec_util.check_uuid(self.uuid)
     spec_util.check_name(self.name)
コード例 #2
0
ファイル: worksheet.py プロジェクト: pbhatnagar3/codalab-cli
 def validate(self):
     '''
     Check a number of basic conditions that would indicate serious errors if
     they do not hold. Right now, validation only checks this worksheet's uuid
     and its name.
     '''
     spec_util.check_uuid(self.uuid)
     spec_util.check_name(self.name)
コード例 #3
0
 def validate(self):
     spec_util.check_uuid(self.child_uuid)
     spec_util.check_uuid(self.parent_uuid)
     if not self.CHILD_PATH_REGEX.match(self.child_path):
         raise UsageError(
             'child_subpath must match %s, was %s'
             % (self.CHILD_PATH_REGEX.pattern, self.child_path)
         )
コード例 #4
0
ファイル: permission.py プロジェクト: ppasupat/codalab-cli
 def validate(self):
     '''
     Check a number of basic conditions that would indicate serious errors if
     they do not hold. Right now, validation only checks this worksheet's uuid
     and its name.
     '''
     spec_util.check_uuid(self.uuid)
     spec_util.check_name(self.name)
     precondition(isinstance(self.owner_id, basestring), 'Invalid value: owner_id.')
     precondition(isinstance(self.user_defined, bool), 'Invalid value: user_defined.')
コード例 #5
0
 def validate(self):
     '''
     Check a number of basic conditions that would indicate serious errors if
     they do not hold. Right now, validation only checks this worksheet's uuid
     and its name.
     '''
     spec_util.check_uuid(self.uuid)
     spec_util.check_name(self.name)
     precondition(isinstance(self.owner_id, basestring),
                  'Invalid value: owner_id.')
     precondition(isinstance(self.user_defined, bool),
                  'Invalid value: user_defined.')
コード例 #6
0
 def validate(self, require_child_path=False):
     """
     Validates that the dependency is well formed.
     :param require_child_path: If True, make sure the child path is not empty
         This is a needed condition for Run bundles, but not so for Make bundles
     """
     spec_util.check_uuid(self.child_uuid)
     spec_util.check_uuid(self.parent_uuid)
     if not self.CHILD_PATH_REGEX.match(self.child_path):
         raise UsageError('child_path must match %s, was %s' %
                          (self.CHILD_PATH_REGEX.pattern, self.child_path))
     if require_child_path and len(self.child_path) == 0:
         raise UsageError('child_path empty')
コード例 #7
0
ファイル: bundle.py プロジェクト: avinava07/codalab-cli
 def validate(self):
     '''
     Check a number of basic conditions that would indicate serious errors if
     they do not hold. Subclasses may override this method for further
     validation, but they should always call the super's method.
     '''
     spec_util.check_uuid(self.uuid)
     abstract_init = 'init-ed abstract bundle: %s' % (self.__class__.__name__,)
     precondition(self.BUNDLE_TYPE, abstract_init)
     type_mismatch = 'Mismatch: %s vs %s' % (self.bundle_type, self.BUNDLE_TYPE)
     precondition(self.bundle_type == self.BUNDLE_TYPE, type_mismatch)
     # Check that metadata conforms to specs and check each dependency.
     self.metadata.validate(self.METADATA_SPECS)
     for dep in self.dependencies:
         dep.validate()
コード例 #8
0
 def validate(self):
     '''
     Check a number of basic conditions that would indicate serious errors if
     they do not hold. Subclasses may override this method for further
     validation, but they should always call the super's method.
     '''
     spec_util.check_uuid(self.uuid)
     abstract_init = 'init-ed abstract bundle: %s' % (self.__class__.__name__,)
     precondition(self.BUNDLE_TYPE, abstract_init)
     type_mismatch = 'Mismatch: %s vs %s' % (self.bundle_type, self.BUNDLE_TYPE)
     precondition(self.bundle_type == self.BUNDLE_TYPE, type_mismatch)
     # Check that metadata conforms to specs and check each dependency.
     self.metadata.validate(self.METADATA_SPECS)
     for dep in self.dependencies:
         dep.validate()