"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/datahandler/splashid.py" between
revelation-0.5.3.tar.xz and revelation-0.5.4.tar.xz

About: Revelation is a password manager for the GNOME 3 desktop.

splashid.py  (revelation-0.5.3.tar.xz):splashid.py  (revelation-0.5.4.tar.xz)
skipping to change at line 66 skipping to change at line 66
name = "SplashID CSV" name = "SplashID CSV"
importer = True importer = True
exporter = False exporter = False
encryption = False encryption = False
def import_data(self, input, password): def import_data(self, input, password):
" Import data from a file into the entry store" " Import data from a file into the entry store"
# Replace any vertical tabs with spaces, SplashID seems to use # Replace any vertical tabs with spaces, SplashID seems to use
# these to seperate lines within a Notes field: # these to seperate lines within a Notes field:
if input.count('\x0b'): if input.count(b'\x0b'):
input = input.replace('\x0b', ' ') input = input.replace(b'\x0b', b' ')
entrystore = data.EntryStore() entrystore = data.EntryStore()
# Maintain a hash of folder names to folder entries so we # Maintain a hash of folder names to folder entries so we
# can use each category encountered to create a new folder # can use each category encountered to create a new folder
# by that name, or use an existing one if we've already # by that name, or use an existing one if we've already
# created it: # created it:
folders = {} folders = {}
for line in input.splitlines(): for line in input.splitlines():
for row in csv.reader([line]): for row in csv.reader([line.decode()]):
# Raise FormatError if we don't have all 9 fields # Raise FormatError if we don't have all 9 fields
if len(row) != 9: if len(row) != 9:
raise base.FormatError raise base.FormatError
# Import the entry # Import the entry
e = entry.GenericEntry() e = entry.GenericEntry()
e.name = row[1] e.name = row[1]
e.description = " / ".join([ desc.strip() for desc in row[ 5:8] if desc.strip() != "" ]) e.description = " / ".join([ desc.strip() for desc in row[ 5:8] if desc.strip() != "" ])
e.updated = time.time() e.updated = time.time()
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)