From 985238ee12c34f1a733389517654c06cf0835b82 Mon Sep 17 00:00:00 2001 From: mirrorrim Date: Fri, 27 Apr 2018 10:56:27 +0300 Subject: [PATCH] Revert "@" sign in post identifier --- golos/__init__.py | 2 +- golos/commit.py | 6 +++--- golos/post.py | 4 ++-- golos/steemd.py | 4 ++-- golos/utils.py | 17 +---------------- setup.py | 2 +- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/golos/__init__.py b/golos/__init__.py index 6217b68..ce91286 100644 --- a/golos/__init__.py +++ b/golos/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- from golos.steem import Steem -__version__ = '0.1.1.1' +__version__ = '0.1.1.2' diff --git a/golos/commit.py b/golos/commit.py index a1a6f33..e030e76 100644 --- a/golos/commit.py +++ b/golos/commit.py @@ -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, @@ -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. diff --git a/golos/post.py b/golos/post.py index 658d4de..5eefeb7 100644 --- a/golos/post.py +++ b/golos/post.py @@ -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) @@ -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 = [] diff --git a/golos/steemd.py b/golos/steemd.py index 3f5505f..c2307a0 100644 --- a/golos/steemd.py +++ b/golos/steemd.py @@ -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 @@ -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', diff --git a/golos/utils.py b/golos/utils.py index 86df78c..30801b0 100755 --- a/golos/utils.py +++ b/golos/utils.py @@ -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'): @@ -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 diff --git a/setup.py b/setup.py index 6e7769d..661a58d 100644 --- a/setup.py +++ b/setup.py @@ -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 = 'steepshot.org@gmail.com'