# Path: client.py
# class InteractiveClient(Cmd):
#     def precmd(self, line):
#     def postcmd(self, stop, line):
#     def format_prompt(self, username='', character='', zone=''):
#     def logged_in(self):
#     def do_register(self, args, opts=None):
#     def do_login(self, args, opts=None):
#     def login(self, username, password, charnum=None):
#     def do_create_character(self, args, opts=None):
#     def do_update(self, args=None):
#     def format_messages(self):
#     def do_map(self, args):
#     def clean_dict(self, dirty):
#     def format_object(self, objdata):
#     def get_match(self, objname):
#     def do_detail(self, args):
# 
# Path: settings.py
# CLIENT_UPDATE_FREQ = MSPERSEC/CLIENT_NETWORK_FPS
# 
# Path: helpers.py
# def euclidian(x1, y1, x2, y2):
#     from math import sqrt
#     return sqrt(((x1-x2)**2) + ((y1-y2)**2))


import functools
import datetime
import sys
from PySide.QtCore import Qt, SIGNAL, QSize, QTimer, Slot, Signal
from PySide.QtGui import QDialog, QIcon, QLabel, QLineEdit, QPushButton,\
                         QVBoxLayout, QApplication, QTreeWidget, QTreeWidgetItem,\
                         QWidget, QGraphicsScene, QGraphicsView, QGraphicsWidget,\
                         QGraphicsPixmapItem, QPainter
from client import Client
from settings import CLIENT_UPDATE_FREQ
from helpers import euclidian
        from requests.exceptions import ConnectionError
    def __init__(self, *args, **kwargs):
        super(AdminPanel, self).__init__(*args, **kwargs)

        self.setWindowTitle("Eye of God")
        self.view.setRenderHint(QPainter.Antialiasing, True)
        self.view.setRenderHint(QPainter.SmoothPixmapTransform, True)
        self.view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        self.obj_update_timer = QTimer(self)
        self.connect(self.obj_update_timer, SIGNAL("timeout()"), self.update)
        self.obj_update_timer.start(CLIENT_UPDATE_FREQ)

        # Initialize some buttons to do administrative things:
        #   Turn on noclip
        #   Turn on warping: on mouseclick, move
        #   Insert a new object into the zone.
        #   Show a palette of objects in-world, sorted by last used or number of instances
        #   Yank the current object into the buffer
        #   Spawn the object in the buffer under currentpos

    def update(self):
        self.view.fitInView(self.scene.itemsBoundingRect(), Qt.KeepAspectRatio)


if __name__ == "__main__":
    # Create a Qt application
    app = QApplication(sys.argv)

    # make a client instance:

# Path: client.py
# class InteractiveClient(Cmd):
#     def precmd(self, line):
#     def postcmd(self, stop, line):
#     def format_prompt(self, username='', character='', zone=''):
#     def logged_in(self):
#     def do_register(self, args, opts=None):
#     def do_login(self, args, opts=None):
#     def login(self, username, password, charnum=None):
#     def do_create_character(self, args, opts=None):
#     def do_update(self, args=None):
#     def format_messages(self):
#     def do_map(self, args):
#     def clean_dict(self, dirty):
#     def format_object(self, objdata):
#     def get_match(self, objname):
#     def do_detail(self, args):
# 
# Path: settings.py
# CLIENT_UPDATE_FREQ = MSPERSEC/CLIENT_NETWORK_FPS
# 
# Path: helpers.py
# def euclidian(x1, y1, x2, y2):
#     from math import sqrt
#     return sqrt(((x1-x2)**2) + ((y1-y2)**2))


# Path: qtclient.py
import functools
import datetime
import sys
from PySide.QtCore import Qt, SIGNAL, QSize, QTimer, Slot, Signal
from PySide.QtGui import QDialog, QIcon, QLabel, QLineEdit, QPushButton,\
                         QVBoxLayout, QApplication, QTreeWidget, QTreeWidgetItem,\
                         QWidget, QGraphicsScene, QGraphicsView, QGraphicsWidget,\
                         QGraphicsPixmapItem, QPainter
from client import Client
from settings import CLIENT_UPDATE_FREQ
from helpers import euclidian
        from requests.exceptions import ConnectionError

    def __init__(self, *args, **kwargs):
        super(AdminPanel, self).__init__(*args, **kwargs)

        self.setWindowTitle("Eye of God")
        self.view.setRenderHint(QPainter.Antialiasing, True)
        self.view.setRenderHint(QPainter.SmoothPixmapTransform, True)
        self.view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        self.obj_update_timer = QTimer(self)
        self.connect(self.obj_update_timer, SIGNAL("timeout()"), self.update)
        self.obj_update_timer.start(CLIENT_UPDATE_FREQ)

        # Initialize some buttons to do administrative things:
        #   Turn on noclip
        #   Turn on warping: on mouseclick, move
        #   Insert a new object into the zone.
        #   Show a palette of objects in-world, sorted by last used or number of instances
        #   Yank the current object into the buffer
        #   Spawn the object in the buffer under currentpos

    def update(self):
        self.view.fitInView(self.scene.itemsBoundingRect(), Qt.KeepAspectRatio)


if __name__ == "__main__":
    # Create a Qt application
    app = QApplication(sys.argv)

    # make a client instance:

    client = Client()