2015-03-15 16:24:54 +01:00
#CLI like interface
2015-03-21 19:40:46 +01:00
import argparse , getopt , os , io , struct , mtproto
2015-03-22 19:08:49 +01:00
from classes . shell import TelepyShell
2015-03-15 16:24:54 +01:00
2015-03-21 19:40:46 +01:00
if __name__ == ' __main__ ' :
parser = argparse . ArgumentParser ( ' telepy ' , description = ' Python implementation of telegram API. ' )
parser . add_argument ( ' command ' , nargs = ' ? ' , choices = [ ' cmd ' , ' dialog_list ' , ' contact_list ' ] + [ ' chat_ ' + sub for sub in [ ' info ' , ' add_user ' , ' add_user_to_chat ' , ' del_user ' , ' set_photo ' , ' rename ' ] ] )
parser . add_argument ( ' args ' , nargs = ' * ' )
2015-03-15 16:24:54 +01:00
2015-03-21 19:40:46 +01:00
#for command, args, help in (('info', 1, 'prints info about chat'), ('add_user', 2, 'add user to chat'), ('del_user', 2, 'remove user from chat'), ('set_photo', 1, 'sets group chat photo. Same limits as for profile photos.')):
# parser.add_argument('chat_' + command, nargs=args, help=help)
#parser.add_argument
args = parser . parse_args ( )
2015-03-15 16:24:54 +01:00
2015-03-21 19:40:46 +01:00
if args . command is None :
2015-03-22 19:08:49 +01:00
TelepyShell ( ) . cmdloop ( )