| 71 | return str(s or '') |
| 72 | |
| 73 | def __init__(self, record_uid='', folder='', title='', login='', password='', login_url='', notes='', |
| 74 | custom_fields=None, revision=''): |
| 75 | self.record_uid = record_uid |
| 76 | self.record_type = '' |
| 77 | self.folder = Record.xstr(folder) |
| 78 | self.title = Record.xstr(title) |
| 79 | self.login = Record.xstr(login) |
| 80 | self.password = Record.xstr(password) |
| 81 | self.login_url = Record.xstr(login_url) |
| 82 | self.notes = Record.xstr(notes) |
| 83 | self.custom_fields = custom_fields or [] # type: list |
| 84 | self.attachments = None |
| 85 | self.revision = revision |
| 86 | self.unmasked_password = None |
| 87 | self.totp = None |
| 88 | self.version = 2 |
| 89 | self.password_label = '' # custom label on the v3 password field (e.g. "Passphrase") |
| 90 | self.login_label = '' # custom label on the v3 login field |
| 91 | self.url_label = '' # custom label on the v3 url field |
| 92 | self.totp_label = '' # custom label on the v3 oneTimeCode field |
| 93 | |
| 94 | def load(self, data, **kwargs): |
| 95 | self.version = kwargs.get('version', 2) |