<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>pysmell/pysmell_client.py</filename>
    </added>
    <added>
      <filename>pysmell/pysmell_server.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -57,7 +57,7 @@ def findPYSMELLDICT(filename):
         pathParts.pop()
     else:
         return None
-    return PYSMELLDICT
+    return PYSMELLDICT, os.path.join(*pathParts)
             
 
 def _getPathParts(path):</diff>
      <filename>pysmell/idehelper.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,9 @@ import sys
 from pysmell import idehelper
 from pysmell import tags as tags_module
 from pysmell import tm_dialog
-
+from pysmell import pysmell_client
+import asyncore
+from datetime import datetime
 
 #tm_support_path = os.environ['TM_SUPPORT_PATH'] + '/lib'
 #if tm_support_path not in sys.path:
@@ -27,26 +29,26 @@ def main():
     line_no = int(os.environ.get(&quot;TM_LINE_NUMBER&quot;))
     cur_col = int(os.environ.get(&quot;TM_LINE_INDEX&quot;))
     result = _main(cur_file, line_no, cur_col)
+    end = datetime.now()
     if result is not None:
         sys.exit(result)
 
 def _main(cur_file, line_no, cur_col):
+    start = datetime.now()
     if not cur_file:
         write('No filename - is the file saved?')
         return TOOLTIP
     source = sys.stdin.read()
 
-    PYSMELLDICT = idehelper.findPYSMELLDICT(cur_file)
-    if PYSMELLDICT is None:
-        write('No PYSMELLTAGS found - you have to generate one.')
-        return TOOLTIP
     line = source.splitlines()[line_no - 1]
     index = idehelper.findBase(line, cur_col)
     base = line[index:cur_col]
 
-    options = idehelper.detectCompletionType(cur_file, source, line_no, cur_col, base, PYSMELLDICT)
-    completions = idehelper.findCompletions(base, PYSMELLDICT, options)
+    pysmellClient = pysmell_client.client(cur_file, source, line_no, cur_col, base)
+    asyncore.loop()
+    completions = pysmellClient.completions
 
+    end = datetime.now()
     if not completions:
         write('No completions found')
         return TOOLTIP
@@ -68,4 +70,5 @@ def _main(cur_file, line_no, cur_col):
             return TOOLTIP
         if compIndex is not None:
             write(completions[compIndex]['word'][len(base):])
+    print '#Took', (end-start).microseconds / 1000.0
 </diff>
      <filename>pysmell/textmate.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>839be4133051112681e80a2787f1e333996ec896</id>
    </parent>
  </parents>
  <author>
    <name>Orestis Markou</name>
    <email>orestis@orestis.gr</email>
  </author>
  <url>http://github.com/orestis/pysmell/commit/a2408858966d2e133398384e36829b940c5540e9</url>
  <id>a2408858966d2e133398384e36829b940c5540e9</id>
  <committed-date>2008-11-06T16:44:56-08:00</committed-date>
  <authored-date>2008-11-06T16:44:56-08:00</authored-date>
  <message>Hacked together a background server for pysmell - need to profile to see if it's worthwhile</message>
  <tree>7e05983b89ce120a0b6b71127b4fa7c3e1d125a0</tree>
  <committer>
    <name>Orestis Markou</name>
    <email>orestis@orestis.gr</email>
  </committer>
</commit>
