def dump_field_entry(self, output, field, entry, indent_n): field_type = field['type'] if field_type == 'checkbox': for k, v in entry.items(): for option in field['options']: if k == option.get('id', '') and v == 'True': output += indent(indent_n) + option['label'] + '\n' elif field_type in ['selectbox']: for option in field['options']: if entry.get('value', '') == option['id']: output += indent(indent_n) + option['label'] + '\n' elif field_type == 'date': date = entry.get('value') if date is not None: output += indent(indent_n) + ISO8601_to_pretty_str( entry.get('value')) + '\n' elif field_type == 'tos': answer = '☑' if entry.get('value', '') == 'True' else '☐' output += indent(indent_n) + answer + '\n' elif field_type == 'fieldgroup': output = self.dump_fields(output, field['children'], entry, indent_n) else: output += indent_text(entry.get('value', ''), indent_n) + '\n' return output + '\n'
def dump_field_entry(self, output, field, entry, indent_n): field_type = field['type'] if field_type == 'checkbox': for k, v in entry.items(): for option in field['options']: if k == option.get('id', '') and v is True: output += indent(indent_n) + option['label'] + '\n' elif field_type in ['multichoice', 'selectbox']: for option in field['options']: if entry.get('value', '') == option['id']: output += indent(indent_n) + option['label'] + '\n' elif field_type == 'date': date = entry.get('value') if date is not None: output += indent(indent_n) + ISO8601_to_pretty_str(date) + '\n' elif field_type == 'daterange': daterange = entry.get('value') if daterange is not None: daterange = daterange.split(':') output += indent(indent_n) + datetime_to_pretty_str(datetime.fromtimestamp(int(daterange[0])/1000)) + '\n' output += indent(indent_n) + datetime_to_pretty_str(datetime.fromtimestamp(int(daterange[1])/1000)) + '\n' elif field_type == 'tos': answer = '☑' if entry.get('value', '') is True else '☐' output += indent(indent_n) + answer + '\n' elif field_type == 'fieldgroup': output = self.dump_fields(output, field['children'], entry, indent_n) else: output += indent_text(entry.get('value', ''), indent_n) + '\n' return output + '\n'
def dump_field_entry(output, field, entry, indent_n): field_type = field['type'] if field_type == 'checkbox': for k, v in entry.iteritems(): for option in field['options']: if k == option['id'] and v == 'True': output += indent(indent_n) + option['label'] + '\n' elif field_type in ['selectbox', 'multichoice']: for option in field['options']: if entry['value'] == option['id']: output += indent(indent_n) + option['label'] + '\n' elif field_type == 'date': output += indent(indent_n) + ISO8601_to_pretty_str(entry['value']) + '\n' # FIXME: format date elif field_type == 'tos': answer = '☑' if entry['value'] == 'True' else '☐' output += indent(indent_n) + answer + '\n' elif field_type == 'fieldgroup': output = dump_fields(output, field['children'], entry, indent_n) else: output += indent_text(entry['value'], indent_n) return output + '\n'
def EventTime(self): return ISO8601_to_pretty_str(self.data['file']['creation_date'], float(self.data['receiver']['timezone']))
def ExpirationDate(self): return ISO8601_to_pretty_str(self.data['expiration_date'])
def EventTime(self): return ISO8601_to_pretty_str(self.data['message']['creation_date'])
def EventTime(self): return ISO8601_to_pretty_str(self.file['creation_date'], float(self.receiver['timezone']))
def EventTime(self): return ISO8601_to_pretty_str(self.file['creation_date'])