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
cd680063
Commit
cd680063
authored
7 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Run sakia in parallel for multi currency
parent
386b8f62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sakia/app.py
+0
-2
0 additions, 2 deletions
src/sakia/app.py
src/sakia/helpers.py
+6
-2
6 additions, 2 deletions
src/sakia/helpers.py
src/sakia/main.py
+10
-9
10 additions, 9 deletions
src/sakia/main.py
with
16 additions
and
13 deletions
src/sakia/app.py
+
0
−
2
View file @
cd680063
...
@@ -88,9 +88,7 @@ class Application(QObject):
...
@@ -88,9 +88,7 @@ class Application(QObject):
app_data
=
AppDataFile
.
in_config_path
(
options
.
config_path
).
load_or_init
()
app_data
=
AppDataFile
.
in_config_path
(
options
.
config_path
).
load_or_init
()
app
=
cls
(
qapp
,
loop
,
options
,
app_data
,
None
,
None
,
options
.
currency
,
None
)
app
=
cls
(
qapp
,
loop
,
options
,
app_data
,
None
,
None
,
options
.
currency
,
None
)
#app.set_proxy()
#app.set_proxy()
app
.
get_last_version
()
app
.
load_profile
(
options
.
profile
)
app
.
load_profile
(
options
.
profile
)
app
.
start_coroutines
()
app
.
documents_service
=
DocumentsService
.
instanciate
(
app
)
app
.
documents_service
=
DocumentsService
.
instanciate
(
app
)
app
.
switch_language
()
app
.
switch_language
()
return
app
return
app
...
...
This diff is collapsed.
Click to expand it.
src/sakia/helpers.py
+
6
−
2
View file @
cd680063
import
re
import
re
import
hashlib
from
PyQt5.QtCore
import
QSharedMemory
from
PyQt5.QtCore
import
QSharedMemory
from
PyQt5.QtWidgets
import
QApplication
from
PyQt5.QtWidgets
import
QApplication
...
@@ -17,8 +18,11 @@ def detect_non_printable(data):
...
@@ -17,8 +18,11 @@ def detect_non_printable(data):
return
True
return
True
def
single_instance_lock
():
def
single_instance_lock
(
currency
):
sharedMemory
=
QSharedMemory
(
"
77rWEV37vupNhQs6ktDREthqSciyV77OYrqPBSwV755JFIhl9iOywB7G5DkAKU8Y
"
)
key
=
hashlib
.
sha256
(
currency
.
encode
(
'
utf-8
'
)
+
"
77rWEV37vupNhQs6ktDREthqSciyV77OYrqPBSwV755JFIhl9iOywB7G5DkAKU8Y
"
.
encode
(
'
utf-8
'
))
\
.
hexdigest
()
sharedMemory
=
QSharedMemory
(
key
)
if
sharedMemory
.
attach
(
QSharedMemory
.
ReadOnly
):
if
sharedMemory
.
attach
(
QSharedMemory
.
ReadOnly
):
sharedMemory
.
detach
()
sharedMemory
.
detach
()
return
None
return
None
...
...
This diff is collapsed.
Click to expand it.
src/sakia/main.py
+
10
−
9
View file @
cd680063
...
@@ -82,15 +82,6 @@ if __name__ == '__main__':
...
@@ -82,15 +82,6 @@ if __name__ == '__main__':
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
sakia
=
QApplication
(
sys
.
argv
)
sakia
=
QApplication
(
sys
.
argv
)
lock
=
single_instance_lock
()
if
not
lock
:
lock
=
single_instance_lock
()
if
not
lock
:
QMessageBox
.
critical
(
None
,
"
Sakia
"
,
"
Sakia is already running.
"
)
sys
.
exit
(
1
)
sys
.
excepthook
=
exception_handler
sys
.
excepthook
=
exception_handler
sakia
.
setStyle
(
'
Fusion
'
)
sakia
.
setStyle
(
'
Fusion
'
)
...
@@ -100,7 +91,17 @@ if __name__ == '__main__':
...
@@ -100,7 +91,17 @@ if __name__ == '__main__':
with
loop
:
with
loop
:
app
=
Application
.
startup
(
sys
.
argv
,
sakia
,
loop
)
app
=
Application
.
startup
(
sys
.
argv
,
sakia
,
loop
)
lock
=
single_instance_lock
(
app
.
currency
)
if
not
lock
:
lock
=
single_instance_lock
(
app
.
currency
)
if
not
lock
:
QMessageBox
.
critical
(
None
,
"
Sakia
"
,
"
Sakia is already running.
"
)
sys
.
exit
(
1
)
app
.
start_coroutines
()
app
.
start_coroutines
()
app
.
get_last_version
()
keep_trying
=
True
keep_trying
=
True
while
not
app
.
blockchain_service
.
initialized
():
while
not
app
.
blockchain_service
.
initialized
():
try
:
try
:
...
...
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