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
4ed6262d
Commit
4ed6262d
authored
11 years ago
by
Caner Candan
Browse files
Options
Downloads
Patches
Plain Diff
+ added simple contacts section which list public keys of gpg ring
parent
5c9bd1bf
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
templates/wallets/base.html
+2
-0
2 additions, 0 deletions
templates/wallets/base.html
templates/wallets/contacts.html
+15
-0
15 additions, 0 deletions
templates/wallets/contacts.html
webclient.py
+6
-22
6 additions, 22 deletions
webclient.py
with
23 additions
and
22 deletions
templates/wallets/base.html
+
2
−
0
View file @
4ed6262d
...
...
@@ -13,6 +13,7 @@
<div
class=
"list-group"
style=
"background-color: #f7f5fa;"
>
<a
id=
"new"
href=
"{{ url_for('new_wallet') }}"
class=
"list-group-item"
><i
class=
"glyphicon glyphicon-plus-sign"
></i>
New
</a>
<a
id=
"list"
href=
"{{ url_for('wallets') }}"
class=
"list-group-item"
><i
class=
"glyphicon glyphicon-credit-card"
></i>
Wallets
</a>
<a
id=
"contacts"
href=
"{{ url_for('wallet_contacts') }}"
class=
"list-group-item"
><i
class=
"glyphicon glyphicon-user"
></i>
Contacts
</a>
</div>
{% if key -%}
...
...
@@ -40,6 +41,7 @@
'
/
'
:
'
list
'
,
'
{{ url_for(
'
new_wallet
'
) }}
'
:
'
new
'
,
'
{{ url_for(
'
wallets
'
) }}
'
:
'
list
'
,
'
{{ url_for(
'
wallet_contacts
'
) }}
'
:
'
contacts
'
,
{
%
if
key
-%
}
'
{{ url_for(
'
wallet_history
'
, pgp_fingerprint=key.fingerprint) }}
'
:
'
history
'
,
...
...
This diff is collapsed.
Click to expand it.
templates/wallets/contacts.html
0 → 100644
+
15
−
0
View file @
4ed6262d
{% extends "wallets/base.html" %}
{% block sub_content %}
<h1><span
class=
"label label-default"
>
Contacts
</span></h1>
<div
class=
"list-group"
>
{% for fp,k in settings.public_keys.items() %}
<a
href=
"#"
class=
"list-group-item {% if k.keyid == settings.keyid %}active{% endif %}"
>
<h4
class=
"list-group-item-heading"
>
{{k.uids.0}}
</h4>
<p
class=
"list-group-item-text"
>
{{fp}}
</p>
</a>
{% endfor %}
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
webclient.py
+
6
−
22
View file @
4ed6262d
...
...
@@ -30,7 +30,6 @@ from flask import\
flash
from
io
import
StringIO
from
werkzeug.contrib.cache
import
SimpleCache
from
itertools
import
combinations
,
chain
logger
=
logging
.
getLogger
(
"
cli
"
)
app
=
Flask
(
__name__
)
...
...
@@ -233,27 +232,6 @@ Comment:
return
False
def
powerset
(
iterable
):
xs
=
list
(
iterable
)
return
chain
.
from_iterable
(
combinations
(
xs
,
n
)
for
n
in
range
(
len
(
xs
)
+
1
)
)
def
powerset_bis
(
iterable
,
low
=
0
,
step
=
1
):
xs
=
list
(
iterable
)
combins
=
[]
sums
=
[]
for
n
in
range
(
low
,
len
(
xs
)
+
1
,
step
):
for
c
in
combinations
(
xs
,
n
):
__sum
=
sum
(
c
)
if
__sum
not
in
sums
:
combins
.
append
(
c
)
sums
.
append
(
__sum
)
res
=
list
(
zip
(
sums
,
combins
))
res
.
sort
()
return
res
# return sums, combins
@app.route
(
'
/wallets/<pgp_fingerprint>/transfer
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
wallet_transfer
(
pgp_fingerprint
):
balance
,
__clist
=
clist
(
pgp_fingerprint
)
...
...
@@ -310,6 +288,11 @@ def wallet_public_keys():
v
[
'
name
'
]
=
v
[
'
uids
'
][
0
]
return
json
.
dumps
(
list
(
keys
.
values
()))
@app.route
(
'
/wallets/contacts
'
)
def
wallet_contacts
():
return
render_template
(
'
wallets/contacts.html
'
,
settings
=
ucoin
.
settings
)
def
issue
(
pgp_fingerprint
,
amendment
,
coins
,
message
=
''
):
try
:
last_tx
=
ucoin
.
hdc
.
transactions
.
sender
.
Last
(
pgp_fingerprint
).
get
()
...
...
@@ -379,6 +362,7 @@ Comment:
def
compute_dividend_remainders
(
pgp_fingerprint
):
remainders
=
{}
for
am
in
ucoin
.
hdc
.
amendments
.
List
().
get
():
if
not
am
[
'
dividend
'
]:
continue
if
not
am
[
'
dividend
'
]:
continue
dividend_sum
=
0
for
x
in
ucoin
.
hdc
.
transactions
.
sender
.
issuance
.
Dividend
(
pgp_fingerprint
,
am
[
'
number
'
]).
get
():
...
...
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