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
cf9514bb
Commit
cf9514bb
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fasten up models list refresh with asyncio.gather
parent
9ea7c38d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/models/identities.py
+6
-2
6 additions, 2 deletions
src/sakia/models/identities.py
src/sakia/models/txhistory.py
+11
-6
11 additions, 6 deletions
src/sakia/models/txhistory.py
with
17 additions
and
8 deletions
src/sakia/models/identities.py
+
6
−
2
View file @
cf9514bb
...
...
@@ -149,9 +149,13 @@ class IdentitiesTableModel(QAbstractTableModel):
self
.
endResetModel
()
self
.
beginResetModel
()
identities_data
=
[]
requests_coro
=
[]
for
identity
in
identities
:
data
=
await
self
.
identity_data
(
identity
)
identities_data
.
append
(
data
)
coro
=
asyncio
.
ensure_future
(
self
.
identity_data
(
identity
))
requests_coro
.
append
(
coro
)
identities_data
=
await
asyncio
.
gather
(
*
requests_coro
)
if
len
(
identities
)
>
0
:
try
:
parameters
=
await
self
.
community
.
parameters
()
...
...
This diff is collapsed.
Click to expand it.
src/sakia/models/txhistory.py
+
11
−
6
View file @
cf9514bb
...
...
@@ -300,16 +300,21 @@ class HistoryTableModel(QAbstractTableModel):
self
.
beginResetModel
()
transfers_data
=
[]
if
self
.
community
:
requests_coro
=
[]
for
transfer
in
self
.
transfers
():
data
=
None
coro
=
None
if
type
(
transfer
)
is
Transfer
:
if
transfer
.
metadata
[
'
issuer
'
]
==
self
.
account
.
pubkey
:
data
=
await
self
.
data_sent
(
transfer
)
coro
=
asyncio
.
ensure_future
(
self
.
data_sent
(
transfer
)
)
else
:
data
=
await
self
.
data_received
(
transfer
)
coro
=
asyncio
.
ensure_future
(
self
.
data_received
(
transfer
)
)
elif
type
(
transfer
)
is
dict
:
data
=
await
self
.
data_dividend
(
transfer
)
if
data
:
coro
=
asyncio
.
ensure_future
(
self
.
data_dividend
(
transfer
))
if
coro
:
requests_coro
.
append
(
coro
)
data_list
=
await
asyncio
.
gather
(
*
requests_coro
)
for
data
in
data_list
:
transfers_data
.
append
(
data
)
self
.
transfers_data
=
transfers_data
self
.
endResetModel
()
...
...
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