Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
39dcefc1
Commit
39dcefc1
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Use qt connection manager instead of request
parent
fbcfae3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
setup.py
+8
-5
8 additions, 5 deletions
setup.py
src/cutecoin/core/app.py
+21
-8
21 additions, 8 deletions
src/cutecoin/core/app.py
src/cutecoin/gui/homescreen.py
+5
-1
5 additions, 1 deletion
src/cutecoin/gui/homescreen.py
src/cutecoin/main.py
+1
-3
1 addition, 3 deletions
src/cutecoin/main.py
with
35 additions
and
17 deletions
setup.py
+
8
−
5
View file @
39dcefc1
...
@@ -11,11 +11,14 @@ from PyQt5 import QtCore
...
@@ -11,11 +11,14 @@ from PyQt5 import QtCore
# preparation des options
# preparation des options
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
lib
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
lib
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
,
'
certs
'
)))
print
(
sys
.
path
)
print
(
sys
.
path
)
includes
=
[
"
sip
"
,
"
re
"
,
"
json
"
,
"
logging
"
,
"
hashlib
"
,
"
os
"
,
"
urllib
"
,
"
ucoinpy
"
,
"
pylibscrypt
"
,
"
requests
"
]
includes
=
[
"
sip
"
,
"
re
"
,
"
json
"
,
"
logging
"
,
"
hashlib
"
,
"
os
"
,
"
urllib
"
,
"
ucoinpy
"
,
"
pylibscrypt
"
,
"
requests
"
]
excludes
=
[]
excludes
=
[]
packages
=
[
"
libnacl
"
]
packages
=
[
"
libnacl
"
,
"
encodings
"
]
includefiles
=
[]
includefiles
=
[]
if
sys
.
platform
==
"
win32
"
:
if
sys
.
platform
==
"
win32
"
:
...
@@ -27,13 +30,13 @@ if sys.platform == "win32":
...
@@ -27,13 +30,13 @@ if sys.platform == "win32":
includefiles
.
append
(
libEGL_path
)
includefiles
.
append
(
libEGL_path
)
includefiles
.
append
(
qt5svg_path
)
includefiles
.
append
(
qt5svg_path
)
includefiles
.
append
(
"
platforms/win32/libsodium.dll
"
)
includefiles
.
append
(
"
platforms/win32/libsodium.dll
"
)
elif
sys
.
platform
==
"
darwin
"
:
elif
sys
.
platform
==
"
darwin
"
:
pass
pass
else
:
else
:
pass
pass
includefiles
.
append
(
os
.
path
.
join
(
"
res
"
,
"
certs
"
,
"
DigiCertHighAssuranceEVRootCA.crt
"
))
includefiles
.
append
(
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
res
'
,
'
certs
'
,
"
DigiCertHighAssuranceEVRootCA.crt
"
)
,
"
DigiCertHighAssuranceEVRootCA.crt
"
))
options
=
{
"
path
"
:
sys
.
path
,
options
=
{
"
path
"
:
sys
.
path
,
"
includes
"
:
includes
,
"
includes
"
:
includes
,
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/core/app.py
+
21
−
8
View file @
39dcefc1
...
@@ -9,10 +9,11 @@ import logging
...
@@ -9,10 +9,11 @@ import logging
import
json
import
json
import
tarfile
import
tarfile
import
shutil
import
shutil
import
requests
import
json
import
datetime
import
datetime
from
PyQt5.QtCore
import
QObject
,
pyqtSignal
from
PyQt5.QtCore
import
QObject
,
pyqtSignal
,
pyqtSlot
,
QUrl
from
PyQt5.QtNetwork
import
QNetworkAccessManager
,
QNetworkReply
,
QNetworkRequest
from
.
import
config
from
.
import
config
from
.account
import
Account
from
.account
import
Account
...
@@ -31,6 +32,7 @@ class Application(QObject):
...
@@ -31,6 +32,7 @@ class Application(QObject):
'''
'''
loading_progressed
=
pyqtSignal
(
int
,
int
)
loading_progressed
=
pyqtSignal
(
int
,
int
)
version_requested
=
pyqtSignal
()
def
__init__
(
self
,
argv
):
def
__init__
(
self
,
argv
):
'''
'''
...
@@ -43,7 +45,11 @@ class Application(QObject):
...
@@ -43,7 +45,11 @@ class Application(QObject):
self
.
default_account
=
""
self
.
default_account
=
""
self
.
current_account
=
None
self
.
current_account
=
None
self
.
monitor
=
None
self
.
monitor
=
None
self
.
available_version
=
__version__
config
.
parse_arguments
(
argv
)
config
.
parse_arguments
(
argv
)
self
.
_network_manager
=
QNetworkAccessManager
()
self
.
_network_manager
.
finished
.
connect
(
self
.
read_available_version
)
self
.
get_last_version
()
self
.
load
()
self
.
load
()
def
get_account
(
self
,
name
):
def
get_account
(
self
,
name
):
...
@@ -328,12 +334,17 @@ class Application(QObject):
...
@@ -328,12 +334,17 @@ class Application(QObject):
'
local_accounts
'
:
self
.
jsonify_accounts
()}
'
local_accounts
'
:
self
.
jsonify_accounts
()}
return
data
return
data
def
latest_version
(
self
):
def
get_last_version
(
self
):
version
=
(
True
,
__version__
)
url
=
QUrl
(
"
https://api.github.com/repos/ucoin-io/cutecoin/releases
"
)
logging
.
debug
(
os
.
environ
[
"
REQUESTS_CA_BUNDLE
"
])
request
=
QNetworkRequest
(
url
)
releases
=
requests
.
get
(
"
https://api.github.com/repos/ucoin-io/cutecoin/releases
"
)
self
.
_network_manager
.
get
(
request
)
@pyqtSlot
(
QNetworkReply
)
def
read_available_version
(
self
,
reply
):
latest
=
None
latest
=
None
for
r
in
releases
.
json
():
releases
=
reply
.
readAll
().
data
().
decode
(
'
utf-8
'
)
logging
.
debug
(
releases
)
for
r
in
json
.
loads
(
releases
):
if
not
latest
:
if
not
latest
:
latest
=
r
latest
=
r
else
:
else
:
...
@@ -346,4 +357,6 @@ class Application(QObject):
...
@@ -346,4 +357,6 @@ class Application(QObject):
latest_version
,
latest_version
,
latest
[
"
html_url
"
])
latest
[
"
html_url
"
])
logging
.
debug
(
"
Found version : {0}
"
.
format
(
latest_version
))
logging
.
debug
(
"
Found version : {0}
"
.
format
(
latest_version
))
return
version
if
version
!=
self
.
available_version
:
self
.
available_version
=
version
self
.
version_requested
.
emit
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/homescreen.py
+
5
−
1
View file @
39dcefc1
...
@@ -20,8 +20,12 @@ class HomeScreenWidget(QWidget, Ui_HomeScreenWidget):
...
@@ -20,8 +20,12 @@ class HomeScreenWidget(QWidget, Ui_HomeScreenWidget):
"""
"""
super
().
__init__
()
super
().
__init__
()
self
.
setupUi
(
self
)
self
.
setupUi
(
self
)
self
.
app
=
app
self
.
refresh_text
()
self
.
app
.
version_requested
.
connect
(
self
.
refresh_text
)
latest
=
app
.
latest_version
()
def
refresh_text
(
self
):
latest
=
self
.
app
.
available_version
version_info
=
""
version_info
=
""
version_url
=
""
version_url
=
""
if
not
latest
[
0
]:
if
not
latest
[
0
]:
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/main.py
+
1
−
3
View file @
39dcefc1
...
@@ -12,7 +12,6 @@ from PyQt5.QtCore import QLocale
...
@@ -12,7 +12,6 @@ from PyQt5.QtCore import QLocale
from
cutecoin.gui.mainwindow
import
MainWindow
from
cutecoin.gui.mainwindow
import
MainWindow
from
cutecoin.core.app
import
Application
from
cutecoin.core.app
import
Application
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
# activate ctrl-c interrupt
# activate ctrl-c interrupt
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
...
@@ -25,9 +24,8 @@ if __name__ == '__main__':
...
@@ -25,9 +24,8 @@ if __name__ == '__main__':
# Change this bit to match where you store your data files:
# Change this bit to match where you store your data files:
datadir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
datadir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
os
.
environ
[
"
REQUESTS_CA_BUNDLE
"
]
=
os
.
path
.
join
(
datadir
,
os
.
environ
[
"
REQUESTS_CA_BUNDLE
"
]
=
os
.
path
.
join
(
datadir
,
"
res
"
,
"
certs
"
,
"
res
"
,
"
certs
"
,
"
DigiCertHighAssuranceEVRootCA.crt
"
)
"
DigiCertHighAssuranceEVRootCA.crt
"
)
cutecoin
=
QApplication
(
sys
.
argv
)
cutecoin
=
QApplication
(
sys
.
argv
)
app
=
Application
(
sys
.
argv
)
app
=
Application
(
sys
.
argv
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment