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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
clients
python
sakia
Commits
d7f78e1a
Commit
d7f78e1a
authored
Jan 31, 2015
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a bug in history table + versionned cache
parent
ddb2361d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cutecoin/core/app.py
+11
-5
11 additions, 5 deletions
src/cutecoin/core/app.py
src/cutecoin/core/wallet.py
+4
-2
4 additions, 2 deletions
src/cutecoin/core/wallet.py
src/cutecoin/gui/currency_tab.py
+1
-1
1 addition, 1 deletion
src/cutecoin/gui/currency_tab.py
with
16 additions
and
8 deletions
src/cutecoin/core/app.py
+
11
−
5
View file @
d7f78e1a
...
@@ -9,9 +9,10 @@ import logging
...
@@ -9,9 +9,10 @@ import logging
import
json
import
json
import
tarfile
import
tarfile
from
cutecoin.core
import
config
from
.
import
config
from
cutecoin.tools.exceptions
import
NameAlreadyExists
,
BadAccountFile
from
..tools.exceptions
import
NameAlreadyExists
,
BadAccountFile
from
cutecoin.core.account
import
Account
from
.account
import
Account
from
..
import
__version__
class
Application
(
object
):
class
Application
(
object
):
...
@@ -90,7 +91,10 @@ class Application(object):
...
@@ -90,7 +91,10 @@ class Application(object):
if
os
.
path
.
exists
(
wallet_path
):
if
os
.
path
.
exists
(
wallet_path
):
with
open
(
wallet_path
,
'
r
'
)
as
json_data
:
with
open
(
wallet_path
,
'
r
'
)
as
json_data
:
data
=
json
.
load
(
json_data
)
data
=
json
.
load
(
json_data
)
if
'
version
'
in
data
and
data
[
'
version
'
]
==
__version__
:
wallet
.
load_caches
(
data
)
wallet
.
load_caches
(
data
)
else
:
os
.
remove
(
wallet_path
)
for
community
in
account
.
communities
:
for
community
in
account
.
communities
:
wallet
.
refresh_cache
(
community
)
wallet
.
refresh_cache
(
community
)
...
@@ -112,7 +116,9 @@ class Application(object):
...
@@ -112,7 +116,9 @@ class Application(object):
wallet_path
=
os
.
path
.
join
(
config
.
parameters
[
'
home
'
],
wallet_path
=
os
.
path
.
join
(
config
.
parameters
[
'
home
'
],
account
.
name
,
'
__cache__
'
,
wallet
.
pubkey
)
account
.
name
,
'
__cache__
'
,
wallet
.
pubkey
)
with
open
(
wallet_path
,
'
w
'
)
as
outfile
:
with
open
(
wallet_path
,
'
w
'
)
as
outfile
:
json
.
dump
(
wallet
.
jsonify_caches
(),
outfile
,
indent
=
4
,
sort_keys
=
True
)
data
=
wallet
.
jsonify_caches
()
data
[
'
version
'
]
=
__version__
json
.
dump
(
data
,
outfile
,
indent
=
4
,
sort_keys
=
True
)
def
import_account
(
self
,
file
,
name
):
def
import_account
(
self
,
file
,
name
):
with
tarfile
.
open
(
file
,
"
r
"
)
as
tar
:
with
tarfile
.
open
(
file
,
"
r
"
)
as
tar
:
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/core/wallet.py
+
4
−
2
View file @
d7f78e1a
...
@@ -27,6 +27,7 @@ class Cache():
...
@@ -27,6 +27,7 @@ class Cache():
self
.
tx_received
=
[]
self
.
tx_received
=
[]
self
.
tx_sent
=
[]
self
.
tx_sent
=
[]
self
.
awaiting_tx
=
[]
self
.
awaiting_tx
=
[]
logging
.
debug
(
data
)
data_received
=
data
[
'
received
'
]
data_received
=
data
[
'
received
'
]
for
r
in
data_received
:
for
r
in
data_received
:
...
@@ -164,6 +165,7 @@ class Wallet(object):
...
@@ -164,6 +165,7 @@ class Wallet(object):
def
load_caches
(
self
,
json_data
):
def
load_caches
(
self
,
json_data
):
for
currency
in
json_data
:
for
currency
in
json_data
:
if
currency
!=
'
version
'
:
self
.
caches
[
currency
]
=
Cache
(
self
)
self
.
caches
[
currency
]
=
Cache
(
self
)
self
.
caches
[
currency
].
load_from_json
(
json_data
[
currency
])
self
.
caches
[
currency
].
load_from_json
(
json_data
[
currency
])
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/currency_tab.py
+
1
−
1
View file @
d7f78e1a
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
sign in
to comment