Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
99c35027
Commit
99c35027
authored
Feb 06, 2021
by
Adrian Georgescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace json module
parent
261c7b26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
accounts.py
blink/accounts.py
+3
-3
No files found.
blink/accounts.py
View file @
99c35027
import
c
json
import
json
import
os
import
re
import
sys
...
...
@@ -424,7 +424,7 @@ class AddAccountDialog(base_class, ui_class, metaclass=QSingleton):
try
:
settings
=
SIPSimpleSettings
()
response
=
urllib
.
request
.
urlopen
(
settings
.
server
.
enrollment_url
,
urllib
.
parse
.
urlencode
(
dict
(
enrollment_data
)))
response_data
=
cjson
.
decode
(
response
.
read
()
.
replace
(
r'\/'
,
'/'
))
response_data
=
json
.
loads
(
response
.
read
()
.
replace
(
r'\/'
,
'/'
))
response_data
=
defaultdict
(
lambda
:
None
,
response_data
)
if
response_data
[
'success'
]:
try
:
...
...
@@ -456,7 +456,7 @@ class AddAccountDialog(base_class, ui_class, metaclass=QSingleton):
call_in_gui_thread
(
self
.
username_editor
.
addException
,
username
)
else
:
call_in_gui_thread
(
setattr
,
self
.
create_status_label
,
'value'
,
Status
(
response_data
[
'error_message'
],
color
=
red
))
except
(
cjson
.
DecodeError
,
KeyError
):
except
(
json
.
decoder
.
JSON
DecodeError
,
KeyError
):
call_in_gui_thread
(
setattr
,
self
.
create_status_label
,
'value'
,
Status
(
'Illegal server response'
,
color
=
red
))
except
urllib
.
error
.
URLError
as
e
:
call_in_gui_thread
(
setattr
,
self
.
create_status_label
,
'value'
,
Status
(
'Failed to contact server:
%
s'
%
e
.
reason
,
color
=
red
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment