Skip to content

Commit

Permalink
Revert "@" sign in post identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
mirrorrim committed Apr 27, 2018
1 parent c8f5580 commit 985238e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion golos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
from golos.steem import Steem

__version__ = '0.1.1.1'
__version__ = '0.1.1.2'
6 changes: 3 additions & 3 deletions golos/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ def finalizeOp(self, ops, account, permission):
return tx.broadcast()

def sign(self, unsigned_trx, wifs=[]):
""" Sign a provided transaction witht he provided key(s)
""" Sign a provided transaction with the provided key(s)
:param dict unsigned_trx: The transaction to be signed and returned
:param string wifs: One or many wif keys to use for signing
a transaction. If not present, the keys will be loaded
from the wallet as defined in "missing_signatures" key
of the transactizions.
of the transactions.
"""
tx = TransactionBuilder(
unsigned_trx,
Expand Down Expand Up @@ -177,7 +177,7 @@ def post(self,
If this post is intended as a reply/comment, `reply_identifier` needs
to be set with the identifier of the parent post/comment (eg.
`author/permlink`).
`@author/permlink`).
Optionally you can also set json_metadata, comment_options and upvote
the newly created post as an author.
Expand Down
4 changes: 2 additions & 2 deletions golos/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, post, steemd_instance=None):
@staticmethod
def parse_identifier(uri):
""" Extract canonical post id/url (i.e. strip any leading `@`). """
return uri.split('@')[-1]
return '@%s' % uri.split('@')[-1]

def refresh(self):
post_author, post_permlink = resolve_identifier(self.identifier)
Expand Down Expand Up @@ -157,7 +157,7 @@ def get_replies(self):
def get_all_replies(root_post=None):
""" Recursively fetch all the child comments, and return them as a list.
Usage: all_comments = Post.get_all_replies(Post('foo/bar'))
Usage: all_comments = Post.get_all_replies(Post('@foo/bar'))
"""
queue = Queue()
replies = []
Expand Down
4 changes: 2 additions & 2 deletions golos/steemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_posts(self, limit=10, sort="hot", category=None, start=None):
:param str sort: Sort the list by "recent" or "payout"
:param str category: Only show posts in this category
:param str start: Show posts after this post. Takes an
identifier of the form ``author/permlink``
identifier of the form ``@author/permlink``
"""
from golos.post import Post

Expand Down Expand Up @@ -677,7 +677,7 @@ def get_account_votes(self, account):
Returned votes are in the following format:
::
{'authorperm': 'alwaysfelicia/time-line-of-best-times-to-post-on-steemit-mystery-explained',
{'authorperm': '@alwaysfelicia/time-line-of-best-times-to-post-on-steemit-mystery-explained',
'percent': 100,
'rshares': 709227399,
'time': '2016-08-07T16:06:24',
Expand Down
17 changes: 1 addition & 16 deletions golos/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def construct_identifier(*args):
# remove the @ sign in case it was passed in by the user.
author = author.replace('@', '')
fields = dict(author=author, permlink=permlink)
return "{author}/{permlink}".format(**fields)
return '@{author}/{permlink}'.format(**fields)


def json_expand(json_op, key_name='json'):
Expand Down Expand Up @@ -408,18 +408,3 @@ def calculate_hot(score: int, created_tm: datetime):

def calculate_trending(score: int, created_tm: datetime):
return calculate_score(10000000, 480000, score, created_tm)


def compat_compose_dictionary(dictionary, **kwargs):
"""
This method allows us the one line dictionary composition that is offered by the ** dictionary unpacking
available in 3.6.
:param dictionary: the dictionary to add the kwargs elements to.
:param kwargs: a set of key/value pairs to add to `dictionary`.
:return: the composed dictionary.
"""
composed_dict = dictionary.copy()
composed_dict.update(kwargs)

return composed_dict
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Package meta-data.
NAME = 'golodranets'
VERSION = '0.1.1.1'
VERSION = '0.1.1.2'
DESCRIPTION = 'Fork of official python STEEM library for Golos blockchain'
URL = 'https://github.com/steepshot/golodranets'
EMAIL = '[email protected]'
Expand Down

0 comments on commit 985238e

Please sign in to comment.