Permalink
Browse files

web: remove unused code

  • Loading branch information...
1 parent 1b3d2bb commit 6a22292ea7dcfa0bd9cfadc30ebf02676ee3945b @billiob billiob committed Jun 27, 2010
Showing with 8 additions and 74 deletions.
  1. +3 −72 amsn2/ui/front_ends/web/bend.py
  2. +5 −1 amsn2/ui/front_ends/web/login.py
  3. +0 −1 amsn2/ui/front_ends/web/main.py
View
75 amsn2/ui/front_ends/web/bend.py
@@ -166,6 +166,7 @@ def __init__(self, core):
self._socket.setblocking(0)
self._socket.bind(("127.0.0.1", 8080))
self._socket.listen(1)
+ self._workers = []
self._rules = (
(re.compile('/$'), self.get_index, None),
(re.compile('/static/(.*)'), self.get_static_file, None)
@@ -176,78 +177,8 @@ def __init__(self, core):
def on_accept(self, s, c):
w = s.accept()
print w
- TinyHTTPServer(self, *w, rules = self._rules)
- return True
-
-
- """
- self.listeners = {}
- self._outq = Queue.Queue(0)
- self._inq = Queue.Queue(0)
-
-
- def worker(inq, outq):
- class Root(object):
- def __init__(self, inq, outq):
- self._inq = inq
- self._outq = outq
-
- @cherrypy.expose
- def index(self):
- raise cherrypy.HTTPRedirect("static/amsn2.html")
-
- @cherrypy.expose
- def signin(self, u=None, p=None):
- self._inq.put_nowait(["signin", u, p])
-
- @cherrypy.expose
- def out(self):
- l = []
- while True:
- try:
- l.append(self._outq.get_nowait())
- except Queue.Empty:
- break;
- logging.error("OOOOOO")
- return l
-
- current_dir = os.path.dirname(os.path.abspath(__file__))
- cherrypy.config.update({'log.error_file': 'amsn2-web-error.log',
- 'log.access_file': 'amsn2-web-access.log',
- 'log.screen': False})
-
- conf = {'/static': {'tools.staticdir.on': True,
- 'tools.staticdir.dir': os.path.join(current_dir, 'static')},
- }
- cherrypy.quickstart(Root(inq, outq), '/', config=conf)
- t = threading.Thread(target=worker, args=[self._inq, self._outq])
- t.daemon = True
- t.start()
- """
-
- def add_listener(self, event, listener):
- return
- """
- if not self.listeners.has_key(event):
- self.listeners[event] = []
- self.listeners[event].append(listener)
- """
-
- def del_listener(self, event, listener):
- #TODO
- pass
-
- def check_event(self):
- """
- # This function is called to check for events
- while True:
- try:
- e = self._inq.get_nowait()
- self.emit_event(e[0], e[1:])
- except Queue.Empty:
- break;
- # Return true to continue checking events
- """
+ t = TinyHTTPServer(self, *w, rules = self._rules)
+ self._workers.append(t)
return True
def emit_event(self, event, *args, **kwargs):
View
6 amsn2/ui/front_ends/web/login.py
@@ -4,12 +4,15 @@ def __init__(self, amsn_core, main):
self._amsn_core = amsn_core
def __del__(self):
+ return
self._main.del_listener("signin", self.signin)
def show(self):
+ return
self._main.add_listener("signin", self.signin)
def hide(self):
+ return
self._main.send("hideLogin");
self._main.del_listener("signin", self.signin)
@@ -20,7 +23,7 @@ def setPassword(self, listP):
self._password = listP.pop()
def set_accounts(self, accountviews):
- pass
+ return
def signin(self, u, p, *args, **kwargs):
accv = self._amsn_core._ui_manager.get_accountview_from_email(u)
@@ -37,4 +40,5 @@ def signin(self, u, p, *args, **kwargs):
self._amsn_core.signin_to_account(self, accv)
def on_connecting(self, progress, msg):
+ return
self._main.send("onConnecting", msg)
View
1 amsn2/ui/front_ends/web/main.py
@@ -7,7 +7,6 @@ class aMSNMainWindow(base.aMSNMainWindow, Backend):
def __init__(self, amsn_core):
Backend.__init__(self, amsn_core)
self._amsn_core = amsn_core
- self._amsn_core.timer_add(750, self.check_event)
def show(self):
self.send("showMainWindow", [])

0 comments on commit 6a22292

Please sign in to comment.