blank classes as interfaces

This commit is contained in:
chidea 2015-03-18 03:13:36 +09:00
parent 262f0f5f2b
commit 83853d0df3
5 changed files with 44 additions and 3 deletions

11
classes/__init__.py Normal file
View File

@ -0,0 +1,11 @@
from . import chat, user, message, contact
from .chat import Chat
from .user import User
from .message import Message
from .contact import Contact
__all__ = ['Chat', 'User', 'Message', 'Contact']

3
classes/contact.py Normal file
View File

@ -0,0 +1,3 @@
class Contact():
pass

3
classes/file.py Normal file
View File

@ -0,0 +1,3 @@
class File():
pass

4
classes/message.py Normal file
View File

@ -0,0 +1,4 @@
import crypt
class Message():
pass

View File

@ -11,11 +11,31 @@ parser.add_argument('args', nargs='*')
#parser.add_argument
args = parser.parse_args()
print(args)
class telepyShell(cmd.Cmd):
intro='Welcome to telepy interactive shell. Type help or ? for help.\n'
prompt='>'
def preloop(self):
try: # this only works in py2.7
import configparser
except ImportError:
import ConfigParser as configparser
# import io, struct, mtproto, prime, crypt
#
# from Crypto.Hash import SHA
# from Crypto.PublicKey import RSA
# config = configparser.ConfigParser()
# Check if credentials is correctly loaded (when it doesn't read anything it returns [])
# if not config.read('credentials'):
# print("File 'credentials' seems to not exist.")
# exit(-1)
# ip = config.get('App data', 'ip_address')
# port = config.getint('App data', 'port')
# self._session = mtproto.Session(ip, port)
# client_nonce = os.urandom(16)
# x = self._session.method_call('req_pq', nonce=client_nonce)
def precmd(self, line):
# convert first word(command name) to lower and return it as line
line = line.lstrip()
@ -25,7 +45,7 @@ class telepyShell(cmd.Cmd):
def completedefault(self, *ignored):
print(ignored)
def complete(self, text, state):
super().complete(text, state)
self.super().complete(text, state)
print('completing')
def do_shell(self, line):