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
8b483d00
Commit
8b483d00
authored
7 years ago
by
Holger Nahrstaedt
Browse files
Options
Downloads
Patches
Plain Diff
fix python 2.7 and remove not needed types
parent
225f39dc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beem/steem.py
+1
-1
1 addition, 1 deletion
beem/steem.py
beemgraphenebase/types.py
+0
-72
0 additions, 72 deletions
beemgraphenebase/types.py
with
1 addition
and
73 deletions
beem/steem.py
+
1
−
1
View file @
8b483d00
...
...
@@ -181,7 +181,7 @@ class Steem(object):
def
is_connected
(
self
):
"""
Returns if rpc is connected
"""
return
bool
(
self
.
rpc
)
return
self
.
rpc
is
not
None
def
refresh_data
(
self
,
force_refresh
=
False
,
data_refresh_time_seconds
=
None
):
"""
...
...
This diff is collapsed.
Click to expand it.
beemgraphenebase/types.py
+
0
−
72
View file @
8b483d00
...
...
@@ -386,78 +386,6 @@ class Id(object):
return
str
(
self
.
data
)
@python_2_unicode_compatible
class
VoteId
(
object
):
def
__init__
(
self
,
vote
):
parts
=
vote
.
split
(
"
:
"
)
if
not
len
(
parts
)
==
2
:
raise
AssertionError
()
self
.
type
=
int
(
parts
[
0
])
self
.
instance
=
int
(
parts
[
1
])
def
__bytes__
(
self
):
"""
Returns bytes representation.
"""
binary
=
(
self
.
type
&
0xff
)
|
(
self
.
instance
<<
8
)
return
struct
.
pack
(
"
<I
"
,
binary
)
def
__str__
(
self
):
"""
Returns data as string.
"""
return
"
%d:%d
"
%
(
self
.
type
,
self
.
instance
)
@python_2_unicode_compatible
class
ObjectId
(
object
):
"""
Encodes protocol ids - serializes to the *instance* only!
"""
def
__init__
(
self
,
object_str
,
type_verify
=
None
):
if
len
(
object_str
.
split
(
"
.
"
))
==
3
:
space
,
type
,
id
=
object_str
.
split
(
"
.
"
)
self
.
space
=
int
(
space
)
self
.
type
=
int
(
type
)
self
.
instance
=
Id
(
int
(
id
))
self
.
Id
=
object_str
if
type_verify
:
if
not
object_type
[
type_verify
]
==
int
(
type
):
raise
AssertionError
(
"
Object id does not match object type!
"
+
"
Excpected %d, got %d
"
%
(
object_type
[
type_verify
],
int
(
type
)))
else
:
raise
Exception
(
"
Object id is invalid
"
)
def
__bytes__
(
self
):
"""
Returns bytes representation.
"""
return
py23_bytes
(
self
.
instance
)
# only yield instance
def
__str__
(
self
):
"""
Returns data as string.
"""
return
self
.
Id
@python_2_unicode_compatible
class
FullObjectId
(
object
):
"""
Encodes object ids - serializes to a full object id
"""
def
__init__
(
self
,
object_str
):
if
len
(
object_str
.
split
(
"
.
"
))
==
3
:
space
,
type
,
id
=
object_str
.
split
(
"
.
"
)
self
.
space
=
int
(
space
)
self
.
type
=
int
(
type
)
self
.
id
=
int
(
id
)
self
.
instance
=
Id
(
int
(
id
))
self
.
Id
=
object_str
else
:
raise
Exception
(
"
Object id is invalid
"
)
def
__bytes__
(
self
):
"""
Returns bytes representation.
"""
return
(
self
.
space
<<
56
|
self
.
type
<<
48
|
self
.
id
).
to_bytes
(
8
,
byteorder
=
"
little
"
,
signed
=
False
)
def
__str__
(
self
):
"""
Returns data as string.
"""
return
self
.
Id
@python_2_unicode_compatible
class
Enum8
(
Uint8
):
def
__init__
(
self
,
selection
):
...
...
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