mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-19 06:28:03 +00:00
Also check the username the user has in his export file, will be used for the mass-import of libravatar data
This commit is contained in:
@@ -20,6 +20,7 @@ def read_gzdata(gzdata=None):
|
|||||||
emails = [] # pylint: disable=invalid-name
|
emails = [] # pylint: disable=invalid-name
|
||||||
openids = [] # pylint: disable=invalid-name
|
openids = [] # pylint: disable=invalid-name
|
||||||
photos = [] # pylint: disable=invalid-name
|
photos = [] # pylint: disable=invalid-name
|
||||||
|
username = None # pylint: disable=invalid-name
|
||||||
|
|
||||||
if not gzdata:
|
if not gzdata:
|
||||||
return False
|
return False
|
||||||
@@ -32,6 +33,11 @@ def read_gzdata(gzdata=None):
|
|||||||
print('Unknown export format: %s' % root.tag)
|
print('Unknown export format: %s' % root.tag)
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
|
# Username
|
||||||
|
for item in root.findall('{%s}account' % SCHEMAROOT)[0].items():
|
||||||
|
if item[0] == 'username':
|
||||||
|
username = item[1]
|
||||||
|
|
||||||
# Emails
|
# Emails
|
||||||
for email in root.findall('{%s}emails' % SCHEMAROOT)[0]:
|
for email in root.findall('{%s}emails' % SCHEMAROOT)[0]:
|
||||||
if email.tag == '{%s}email' % SCHEMAROOT:
|
if email.tag == '{%s}email' % SCHEMAROOT:
|
||||||
@@ -69,4 +75,5 @@ def read_gzdata(gzdata=None):
|
|||||||
'emails': emails,
|
'emails': emails,
|
||||||
'openids': openids,
|
'openids': openids,
|
||||||
'photos': photos,
|
'photos': photos,
|
||||||
|
'username': username,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user