Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
hive
beem
Commits
58428006
Commit
58428006
authored
7 years ago
by
Holger Nahrstaedt
Browse files
Options
Downloads
Patches
Plain Diff
Fix python 2.7
parent
2a25cb4c
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
beem/steem.py
+9
-9
9 additions, 9 deletions
beem/steem.py
beem/transactionbuilder.py
+2
-1
2 additions, 1 deletion
beem/transactionbuilder.py
beemapi/websocket.py
+5
-0
5 additions, 0 deletions
beemapi/websocket.py
with
16 additions
and
10 deletions
beem/steem.py
+
9
−
9
View file @
58428006
...
@@ -216,7 +216,7 @@ class Steem(object):
...
@@ -216,7 +216,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
dynamic_global_properties
'
]
return
self
.
data
[
'
dynamic_global_properties
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_dynamic_global_properties
(
api
=
"
database
"
)
return
self
.
rpc
.
get_dynamic_global_properties
(
api
=
"
database
"
)
...
@@ -232,7 +232,7 @@ class Steem(object):
...
@@ -232,7 +232,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
reserve_ratio
'
]
return
self
.
data
[
'
reserve_ratio
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_reserve_ratio
(
api
=
"
witness
"
)
return
self
.
rpc
.
get_reserve_ratio
(
api
=
"
witness
"
)
...
@@ -251,7 +251,7 @@ class Steem(object):
...
@@ -251,7 +251,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
feed_history
'
]
return
self
.
data
[
'
feed_history
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_feed_history
(
api
=
"
database
"
)
return
self
.
rpc
.
get_feed_history
(
api
=
"
database
"
)
...
@@ -267,7 +267,7 @@ class Steem(object):
...
@@ -267,7 +267,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
reward_funds
'
]
return
self
.
data
[
'
reward_funds
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
funds
=
self
.
rpc
.
get_reward_funds
(
api
=
"
database
"
)[
'
funds
'
]
funds
=
self
.
rpc
.
get_reward_funds
(
api
=
"
database
"
)[
'
funds
'
]
...
@@ -286,7 +286,7 @@ class Steem(object):
...
@@ -286,7 +286,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
get_feed_history
'
][
'
current_median_history
'
]
return
self
.
data
[
'
get_feed_history
'
][
'
current_median_history
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_feed_history
(
api
=
"
database
"
)[
'
current_median_history
'
]
return
self
.
rpc
.
get_feed_history
(
api
=
"
database
"
)[
'
current_median_history
'
]
...
@@ -302,7 +302,7 @@ class Steem(object):
...
@@ -302,7 +302,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
hardfork_properties
'
]
return
self
.
data
[
'
hardfork_properties
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_hardfork_properties
(
api
=
"
database
"
)
return
self
.
rpc
.
get_hardfork_properties
(
api
=
"
database
"
)
...
@@ -321,7 +321,7 @@ class Steem(object):
...
@@ -321,7 +321,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
network
'
]
return
self
.
data
[
'
network
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
return
self
.
rpc
.
get_network
()
return
self
.
rpc
.
get_network
()
...
@@ -437,7 +437,7 @@ class Steem(object):
...
@@ -437,7 +437,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
witness_schedule
'
]
return
self
.
data
[
'
witness_schedule
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_witness_schedule
(
api
=
"
database
"
)
return
self
.
rpc
.
get_witness_schedule
(
api
=
"
database
"
)
...
@@ -451,7 +451,7 @@ class Steem(object):
...
@@ -451,7 +451,7 @@ class Steem(object):
self
.
refresh_data
()
self
.
refresh_data
()
return
self
.
data
[
'
config
'
]
return
self
.
data
[
'
config
'
]
else
:
else
:
if
not
self
.
rpc
:
if
self
.
rpc
is
None
:
return
None
return
None
if
self
.
rpc
.
get_use_appbase
():
if
self
.
rpc
.
get_use_appbase
():
return
self
.
rpc
.
get_config
(
api
=
"
database
"
)
return
self
.
rpc
.
get_config
(
api
=
"
database
"
)
...
...
This diff is collapsed.
Click to expand it.
beem/transactionbuilder.py
+
2
−
1
View file @
58428006
...
@@ -173,7 +173,8 @@ class TransactionBuilder(dict):
...
@@ -173,7 +173,8 @@ class TransactionBuilder(dict):
else
:
else
:
if
isinstance
(
account
,
string_types
):
if
isinstance
(
account
,
string_types
):
account
=
Account
(
account
,
steem_instance
=
self
.
steem
)
account
=
Account
(
account
,
steem_instance
=
self
.
steem
)
assert
permission
in
account
,
"
Could not access permission
"
if
permission
not
in
account
:
raise
AssertionError
(
"
Could not access permission
"
)
required_treshold
=
account
[
permission
][
"
weight_threshold
"
]
required_treshold
=
account
[
permission
][
"
weight_threshold
"
]
keys
=
fetchkeys
(
account
,
permission
)
keys
=
fetchkeys
(
account
,
permission
)
if
permission
!=
"
owner
"
:
if
permission
!=
"
owner
"
:
...
...
This diff is collapsed.
Click to expand it.
beemapi/websocket.py
+
5
−
0
View file @
58428006
...
@@ -99,6 +99,7 @@ class SteemWebsocket(Events):
...
@@ -99,6 +99,7 @@ class SteemWebsocket(Events):
# self.on_account += on_account
# self.on_account += on_account
def
cancel_subscriptions
(
self
):
def
cancel_subscriptions
(
self
):
"""
cancel_all_subscriptions removed from api
"""
# self.cancel_all_subscriptions()
# self.cancel_all_subscriptions()
# api call removed in 0.19.1
# api call removed in 0.19.1
log
.
exception
(
"
cancel_all_subscriptions removed from api
"
)
log
.
exception
(
"
cancel_all_subscriptions removed from api
"
)
...
@@ -121,10 +122,12 @@ class SteemWebsocket(Events):
...
@@ -121,10 +122,12 @@ class SteemWebsocket(Events):
self
.
keepalive
.
start
()
self
.
keepalive
.
start
()
def
reset_subscriptions
(
self
,
accounts
=
[]):
def
reset_subscriptions
(
self
,
accounts
=
[]):
"""
Reset subscriptions
"""
# self.subscription_accounts = accounts
# self.subscription_accounts = accounts
self
.
__set_subscriptions
()
self
.
__set_subscriptions
()
def
__set_subscriptions
(
self
):
def
__set_subscriptions
(
self
):
"""
set subscriptions ot on_block function
"""
# self.cancel_all_subscriptions()
# self.cancel_all_subscriptions()
# Subscribe to events on the Backend and give them a
# Subscribe to events on the Backend and give them a
# callback number that allows us to identify the event
# callback number that allows us to identify the event
...
@@ -136,6 +139,7 @@ class SteemWebsocket(Events):
...
@@ -136,6 +139,7 @@ class SteemWebsocket(Events):
self
.
__events__
.
index
(
'
on_block
'
))
self
.
__events__
.
index
(
'
on_block
'
))
def
_ping
(
self
):
def
_ping
(
self
):
"""
Send keep_alive request
"""
# We keep the connetion alive by requesting a short object
# We keep the connetion alive by requesting a short object
def
ping
(
self
):
def
ping
(
self
):
while
not
self
.
run_event
.
wait
(
self
.
keep_alive
):
while
not
self
.
run_event
.
wait
(
self
.
keep_alive
):
...
@@ -273,6 +277,7 @@ class SteemWebsocket(Events):
...
@@ -273,6 +277,7 @@ class SteemWebsocket(Events):
log
.
critical
(
"
{}
\n\n
{}
"
.
format
(
str
(
e
),
traceback
.
format_exc
()))
log
.
critical
(
"
{}
\n\n
{}
"
.
format
(
str
(
e
),
traceback
.
format_exc
()))
def
get_request_id
(
self
):
def
get_request_id
(
self
):
"""
Generates next request id
"""
self
.
_request_id
+=
1
self
.
_request_id
+=
1
return
self
.
_request_id
return
self
.
_request_id
...
...
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