예제 #1
0
파일: stats.py 프로젝트: Garjy/RIDE
 def get_attributes(self, include_label=False, include_elapsed=False,
                    exclude_empty=False, values_as_strings=False,
                    html_escape=False):
     attrs =  {'pass': self.passed, 'fail': self.failed}
     attrs.update(self._get_custom_attrs())
     if include_label:
         attrs['label'] = self.name
     if include_elapsed:
         attrs['elapsed'] = elapsed_time_to_string(self.elapsed,
                                                   include_millis=False)
     if exclude_empty:
         attrs = dict((k, v) for k, v in attrs.items() if v != '')
     if values_as_strings:
         attrs = dict((k, unicode(v)) for k, v in attrs.items())
     if html_escape:
         attrs = dict((k, self._html_escape(v)) for k, v in attrs.items())
     return attrs
예제 #2
0
 def get_attributes(self,
                    include_label=False,
                    include_elapsed=False,
                    exclude_empty=False,
                    values_as_strings=False,
                    html_escape=False):
     attrs = {'pass': self.passed, 'fail': self.failed}
     attrs.update(self._get_custom_attrs())
     if include_label:
         attrs['label'] = self.name
     if include_elapsed:
         attrs['elapsed'] = elapsed_time_to_string(self.elapsed,
                                                   include_millis=False)
     if exclude_empty:
         attrs = dict((k, v) for k, v in attrs.items() if v != '')
     if values_as_strings:
         attrs = dict((k, unicode(v)) for k, v in attrs.items())
     if html_escape:
         attrs = dict((k, self._html_escape(v)) for k, v in attrs.items())
     return attrs
예제 #3
0
 def _convert_to_timer(self, seconds, millis=True):
     return elapsed_time_to_string(seconds * 1000, include_millis=millis)
예제 #4
0
파일: DateTime.py 프로젝트: jiabinshan/RIDE
 def _convert_to_timer(self, seconds, millis=True):
     return elapsed_time_to_string(seconds * 1000, include_millis=millis)