Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
Alias glance2=glance, added flance()
Browse files Browse the repository at this point in the history
  • Loading branch information
nickoala committed Feb 6, 2016
1 parent 0f7b98b commit c31e769
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions telepot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,7 @@ def _infer_content_type(msg):
return content_type[0]


# Do not use. To be deprecated in future.
def glance(msg, long=False):
content_type = _infer_content_type(msg)

if long:
return content_type, msg['from']['id'], msg['chat']['id'], msg['date'], msg['message_id']
else:
return content_type, msg['from']['id'], msg['chat']['id']


def glance2(msg, flavor='normal', long=False):
def glance(msg, flavor='normal', long=False):
def gl_message():
content_type = _infer_content_type(msg)

Expand Down Expand Up @@ -94,6 +84,15 @@ def gl_chosen_inline_result():
raise BadFlavor(flavor)


glance2 = glance # alias for backward compatibility


def flance(msg, long=False):
f = flavor(msg)
g = glance(msg, flavor=f, long=long)
return f,g


class BadHTTPResponse(TelepotException):
def __init__(self, status, text):
super(BadHTTPResponse, self).__init__(status, text)
Expand Down

0 comments on commit c31e769

Please sign in to comment.