<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,9 +1,13 @@
+# -*- coding: utf-8 -*-
 from __future__ import with_statement
 
 import os
 import logging
 from threading import Semaphore
+import threading
 from subprocess import *
+import Jobs
+import time
 
 #Creating a backup repo:
 # mkdir /tmp/hs-test/
@@ -21,6 +25,16 @@ from subprocess import *
 # cd /tmp/hs-test
 # git --git-dir=/tmp/hs-test/.home-sync/git --work-tree=/tmp/hs-test pull localhost:/home/trever/.home-sync/git
 
+class GitCallback:
+  def FilesAdded(self,files):
+    pass
+  
+  def FilesCommitted(self,files):
+    pass
+
+class GitProcessException(Jobs.JobException):
+  pass
+
 class GitInterface:
   FILES_MODIFIED = 1
   FILES_CACHED = 2
@@ -29,25 +43,62 @@ class GitInterface:
   FILES_IGNORED = 16
   FILES_STAGE = 32
 
-  def __init__(self,gitDir,workTree='',bare=False):
+  def __init__(self,gitDir,workTree='', bare=False, callback=GitCallback()):
     self.dir = gitDir
     self.work = workTree
     self.lock = Semaphore()
     self.bare = bare
     self.log = logging.getLogger('GitInterface')
-    
+    self.callback = callback
+  
   def exists(self):
     return os.path.exists(self.dir)
   
-  def open(self,*args):
+  def writeHead(self):
+    with self.lock:
+      git = self.open(&quot;update-ref&quot;,&quot;HEAD&quot;, self.head)
+      ret = git.wait()
+  
+  def readHead(self):
+    with self.lock:
+      git = self.open(&quot;rev-parse&quot;, &quot;HEAD&quot;,stdout=PIPE)
+      try:
+        git.wait()
+      except GitProcessException:
+        pass
+      self.head = git.stdout.readline().strip()
+      git.stdout.close()
+      if self.head == &quot;HEAD&quot;: #Returns the revision name for a bad name
+         self.head = &quot;&quot;
+  
+  def open(self, *args, **kwargs):
+    if (&quot;stdout&quot; in kwargs):
+      stdout = kwargs[&quot;stdout&quot;]
+    else:
+      stdout = None
+    if (&quot;stdin&quot; in kwargs):
+      stdin = kwargs[&quot;stdin&quot;]
+    else:
+      stdin = None
     args = map(str,args)
     if self.bare:
       args = [&quot;git&quot;,&quot;--git-dir=%s&quot;%(self.dir),&quot;--bare&quot;]+args
     else:
       args = [&quot;git&quot;,&quot;--git-dir=%s&quot;%(self.dir),&quot;--work-tree=%s&quot;%(self.work)] + args
-    self.log.debug(&quot;Running %s&quot;%(args))
-    #return Popen(args, stdout=PIPE)
-    return Popen(args)
+    self.log.debug(&quot;Running %s in %s&quot;%(args, repr(threading.currentThread())))
+    time.sleep(0.0001)
+    proc = Popen(args, stdout=stdout, stdin=stdin)
+    time.sleep(0.0001)
+    def waitForGit(message=&quot;&quot;, fatal=True):
+      ret = proc.popen_wait()
+      if (ret != 0 and fatal):
+        raise GitProcessException(ret, message)
+      return ret
+    
+    proc.popen_wait = proc.wait
+    proc.wait = waitForGit
+    self.log.debug(&quot;Process started as PID %i&quot;, proc.pid)
+    return proc
   
   def init(self):
     with self.lock:
@@ -65,10 +116,11 @@ class GitInterface:
       git.wait()
   
   def setConfig(self,name,value):
-    git = self.open(&quot;config&quot;,name,str(value))
+    with self.lock:
+      git = self.open(&quot;config&quot;,name,str(value))
+      git.wait()
   
   def files(self,listType=FILES_MODIFIED):
-    self.log.debug(&quot;Listing...&quot;)
     flags = &quot;&quot;
     if (listType &amp; GitInterface.FILES_MODIFIED):
       flags+=&quot;m&quot;
@@ -84,7 +136,7 @@ class GitInterface:
       flags+=&quot;s&quot;
     if (flags==&quot;&quot;):
       flags=&quot;m&quot;
-    git = self.open(&quot;ls-files&quot;,&quot;-&quot;+flags)
+    git = self.open(&quot;ls-files&quot;,&quot;-&quot;+flags, stdout=PIPE)
     list = []
     while (True):
       file = git.stdout.readline().strip() #FIXME: Just trim the one newline
@@ -95,63 +147,57 @@ class GitInterface:
     git.wait()
     return list
 
-  def add(self,*files):
+  def addToIndex(self,*files):
     with self.lock:
-      git = self.open(&quot;add&quot;,&quot;-v&quot;,&quot;--&quot;,*files)
-      #while(True):
-        #file = git.stdout.readline().strip().split()[1:]
-        #if (file == []):
-          #break
-        #callback(''.join(file).strip(&quot;'&quot;))
+      git = self.open(&quot;update-index&quot;,&quot;--add&quot;,&quot;-z&quot;,&quot;--stdin&quot;, stdin=PIPE, stdout=PIPE)
+      #i = 0
+      for f in files:
+          #i+=1
+          git.stdin.write(f+&quot;\0&quot;)
+          #self.log.debug(&quot;Wrote %i/%i files: %s&quot;, i, len(files), f)
+      git.stdin.close()
+      self.callback.FilesAdded(files)
       git.wait()
+      git.stdout.close()
+      self.log.debug(&quot;Done&quot;)
   
-  def update(self,path):
+  def commitIndex(self, message):
+    self.log.debug(&quot;Commiting %s...&quot;,message)
+    self.readHead()
     with self.lock:
-      git = self.open(&quot;add&quot;,&quot;-u&quot;,&quot;--&quot;,path)
+      git = self.open(&quot;write-tree&quot;, stdout=PIPE)
+      tree = git.stdout.readline().strip()
       git.wait()
-  
-  def commitAll(self, message):
-    self.log.debug(&quot;Committing all changes: %s&quot;,message)
-    with self.lock:
-      git = self.open(&quot;commit&quot;,&quot;-a&quot;,&quot;-m&quot;,message)
-      #while (True):
-        #line=git.stdout.readline().strip().split()[5:]
-        #if line == []:
-          #break
-        #callback(''.join(line))
+      git.stdout.close()
+      if self.head == &quot;&quot;:
+        git = self.open(&quot;commit-tree&quot;, tree, stdin=PIPE, stdout=PIPE)
+      else:
+        git = self.open(&quot;commit-tree&quot;,tree,&quot;-p&quot;,self.head, stdin=PIPE, stdout=PIPE)
+      git.stdin.write(message)
+      git.stdin.close()
       git.wait()
-      self.log.debug(&quot;Commited.&quot;)
-  
-  def commit(self, message, *files):
-    self.log.debug(&quot;Commiting %s...&quot;,message)
-    with self.lock:
-      git = self.open(&quot;commit&quot;,&quot;-m&quot;,message,&quot;--&quot;,*files)
-      #while (True):
-        #line=git.stdout.readline().strip().split()[5:]
-        #if line == []:
-          #break
-        #callback(''.join(line.split()[5:]))
-      self.log.debug(&quot;Commited.&quot;)
+      self.head = git.stdout.read().strip()
+      git.stdout.close()
+    self.writeHead()
+    self.log.debug(&quot;Commited.&quot;)
 
-  def compact(self):
-    self.lock.acquire()
-    self.log.debug(&quot;Compressing git repo&quot;)
-    git = self.open(&quot;gc&quot;,&quot;--aggressive&quot;)
-    git.wait()
-    self.lock.release()
+  #def compact(self):
+  #  self.lock.acquire()
+  #  self.log.debug(&quot;Compressing git repo&quot;)
+  #  git = self.open(&quot;gc&quot;,&quot;--aggressive&quot;)
+  #  git.wait()
+  #  self.lock.release()
   
   def revisionList(self, path):
-    self.lock.acquire()
-    self.log.debug(&quot;Requesting revision history of %s&quot;,path)
-    git = self.open(&quot;rev-list&quot;,&quot;--timestamp&quot;,&quot;HEAD&quot;,path)
-    ret = []
-    while(True):
-      commit = git.stdout.readline().strip().split()
-      if (commit == []):
-        break
-      commit[0] = int(commit[0])
-      #ret.append(commit)
-      ret.append([commit[1],commit[0]])
-    git.wait()
-    self.lock.release()
-    return ret
\ No newline at end of file
+    with self.lock:
+      self.log.debug(&quot;Requesting revision history of %s&quot;,path)
+      git = self.open(&quot;rev-list&quot;,&quot;--timestamp&quot;,&quot;HEAD&quot;,path, stdout=PIPE)
+      ret = []
+      while(True):
+        commit = git.stdout.readline().strip().split()
+        if (commit == []):
+          break
+        commit[0] = int(commit[0])
+        ret.append([commit[1],commit[0]])
+      git.wait()
+      return ret
\ No newline at end of file</diff>
      <filename>HomeSync/GitInterface.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,23 @@
+# -*- coding: utf-8 -*-
 import threading
 import logging
+import time
+
+class JobException(Exception):
+  def __init__(self, status=-1, message=&quot;&quot;):
+    self.status = status
+    self.message = message
+    self.job = None
+  
+  def __str__(self):
+    return &quot;%s exited with non-zero status of %s (%s)&quot; % (self.job, self.status, self.message)
 
 class JobQueue(threading.Thread):
   def __init__(self):
     threading.Thread.__init__(self)
     self.log = logging.getLogger('JobQueue')
     self.queue = []
-    self.queueReady = threading.Condition()
+    self.queueReady = threading.Condition(threading.Lock())
     self.running = threading.Event()
     self.running.set()
     self.active = None
@@ -16,8 +27,8 @@ class JobQueue(threading.Thread):
 
     self.queue.insert(0,job)
     self.queue = sorted(self.queue)
-    self.log.debug(&quot;Queued job %s&quot;%(job))
-    self.log.debug(&quot;Arguments: %s %s&quot;,job.args, job.kwargs)
+    #self.log.debug(&quot;Queued job %s&quot;, repr(job))
+    #self.log.debug(&quot;Arguments: %s %s&quot;, job.args, job.kwargs)
     self.queueReady.notify()
     self.queueReady.release()
     self.NewJob(job.id)
@@ -31,15 +42,18 @@ class JobQueue(threading.Thread):
     self.running.wait()
     self.queueReady.acquire()
     while self.haveJobs() == False:
+      self.log.debug(&quot;Waiting for a new job&quot;)
       self.queueReady.wait()
     self.queue = sorted(self.queue)
-    self.active= self.queue.pop()
+    self.active = self.queue.pop()
     self.queueReady.release()
-    self.log.info(&quot;Starting job %s&quot;,self.active)
-    self.log.debug(&quot;Arguments: %s %s&quot;,self.active.args, self.active.kwargs)
+    self.log.info(&quot;Starting job %s&quot;,repr(self.active))
     self.active.start()
     self.active.join()
-    self.log.info(&quot;Job complete: %s&quot;, self.active)
+    self.log.info(&quot;Job complete: %s&quot;, repr(self.active))
+    if (self.active.exception):
+      self.log.error(&quot;Exception thrown in job. Passing up.&quot;)
+      raise self.active.exception
     self.JobComplete(self.active.id)
     del self.active
     self.active = None
@@ -65,10 +79,11 @@ class JobQueue(threading.Thread):
 
 class Job(threading.Thread):
   id = 0
-  def __init__(self,call, args=[], kwargs={}):
+  def __init__(self, call, args=[], kwargs={}):
     Job.id += 1
     self.prio = 0
     self.id = Job.id
+    self.exception = None
     
     threading.Thread.__init__(self)
     self.call=call
@@ -94,19 +109,31 @@ class Job(threading.Thread):
     Job.id-=1
   
   def __str__(self):
-    return &quot;#%i (%i) %s&quot;%(self.id, self.prio, self.name)
+    return self.name
+  
+  def __repr__(self):
+    if (self.exception == None):
+      status = &quot;OK&quot;
+    else:
+      status = &quot;EXCEPTION&quot;
+    return &quot;&lt;ID:%i Priority:%i Status:%s Name:%s&gt;&quot;%(self.id, self.prio, status, self.name)
     
   def run(self):
-    self.call(*self.args,**self.kwargs)
+    try:
+      self.call(*self.args,**self.kwargs)
+    except JobException, e:
+      e.job = self
+      self.exception = e
+      raise e
     
 class JobGroup(Job, JobQueue):
   def __init__(self):
     Job.__init__(self, self.runJobs)
     JobQueue.__init__(self)
-    self.name=''
+    self.name=&quot;JobGroup&quot;
 
-  def __str__(self):
-    return Job.__str__(self)+str(map(str,self.queue))
+  def __repr__(self):
+    return Job.__repr__(self)+str(map(str,self.queue))
   
   def runJobs(self):
     while self.haveJobs():</diff>
      <filename>HomeSync/Jobs.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,10 @@
-from GitInterface import GitInterface
+# -*- coding: utf-8 -*-
+from GitInterface import GitInterface, GitCallback
 from Jobs import JobQueue, Job, JobGroup
 import logging
 import os
 from fnmatch import fnmatch
+#from git import *
 
 DEFAULT_IGNORES=[
   &quot;/.home-sync&quot;,
@@ -21,9 +23,12 @@ DEFAULT_IGNORES=[
 ]
 
 class SyncArchive:
-  def __init__(self, path, backup=False):
+  def __init__(self, path, backup=False, gitHandler=None):
     self.backup = backup
     self.path = path
+    if gitHandler == None:
+      gitHandler=GitCallback()
+    self.handler = gitHandler
     
     if backup:
       bare = True
@@ -49,7 +54,8 @@ class SyncArchive:
     file = file.lstrip(self.path)
     for pattern in self.ignoreList():
       if fnmatch(file, &quot;*/&quot;+pattern):
-        return true
+        return True
+    return False
   
   def create(self):
     if self.backup:
@@ -81,10 +87,10 @@ class SyncArchive:
   def addFiles(self, *files):
     self.commits+=1
     j = JobGroup()
-    j.enqueue( Job(self.git.add, args=files) )
-    j.enqueue( Job(self.git.commit, args=(&quot;%s added&quot;%(files),)+files) )
+    j.enqueue( Job(self.git.addToIndex, args=files) )
+    j.enqueue( Job(self.git.commitIndex, args=(&quot;%i files added&quot;%(len(files)),)) )
     if self.commits&gt;100:
-      j.enqueue( Job(self.git.compact) ) #Make sure we compact after we commit and add
+      #j.enqueue( Job(self.git.compact) ) #Make sure we compact after we commit and add
       self.commits=0
     self.jobs.enqueue(j)
     return j</diff>
      <filename>HomeSync/SyncArchive.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import os, sys
 import logging
 import threading
@@ -7,7 +8,9 @@ from AvahiBrowser import AvahiBrowser
 from DeviceWatcher import DeviceWatcher
 from SyncArchive import SyncArchive
 from Jobs import Job
+from GitInterface import GitInterface, GitCallback
 import dbus.service
+import pyinotify
 
 class Crawler:
   def __init__(self,archive):
@@ -16,125 +19,148 @@ class Crawler:
   
   def start(self):
     self.dive(self.archive.path)
+    self.archive.jobs.join()
+  
+  def dive(self,*paths):
+    for path in paths:
+      files = os.listdir(path)
+      fileList = []
+      dirList = []
+      for f in files:
+        f = os.path.join(path,f)
+        if os.path.isfile(f) and not self.archive.isIgnored(f):
+          fileList.append(f)
+        if os.path.isdir(f):
+          dirList.append(f)
+      if fileList != []:
+        self.archive.addFiles(*fileList).setPriority(-1)
+      if dirList != []:
+        j = Job(self.dive,args=dirList )
+        j.setPriority(-2)
+        self.archive.jobs.enqueue(j)
+
+class Watcher(pyinotify.ProcessEvent):
+  def __init__(self, archive):
+    pyinotify.ProcessEvent.__init__(self)
+    self.archive = archive
+    self.wm = pyinotify.WatchManager()
+    self.notifier = pyinotify.ThreadedNotifier(self.wm, self)
+  
+  def start(self):
+    self.notifier.start()
+    self.wm.add_watch(self.archive.path, pyinotify.EventCodes.IN_CREATE | pyinotify.EventCodes.IN_MODIFY, rec=True)
   
-  def dive(self,path):
-    files = os.listdir(path)
-    list = []
+  def process_IN_CREATE(self, event):
+    print &quot;Created:&quot;, os.path.join(event.path, event.name)
+    self.archive.addFiles(os.path.join(event.path, event.name))
+  
+  def process_IN_MODIFY(self, event):
+    print &quot;Modified:&quot;, os.path.join(event.path, event.name)
+    self.archive.addFiles(os.path.join(event.path, event.name))
+
+class DaemonCallback(GitCallback):
+  def __init__(self, daemon):
+    self.d = daemon
+    
+  def FilesAdded(self,files):
     for f in files:
-      if os.path.isfile(os.path.join(path,f)) and not self.archive.isIgnored(os.path.join(path,f)):
-        list.append(os.path.join(path,f))
-      if os.path.isdir(os.path.join(path,f)):
-        self.archive.jobs.enqueue( Job(self.dive,args=(os.path.join(path, f),)) ).setPriority(-2)
-    if list != []:
-      self.archive.addFiles(*list).setPriority(-1)
+      self.d.FileAdded(f)
+  
+  def FilesCommitted(self,files):
+    for f in files:
+      self.d.FileCommited(f)
 
-class SyncDaemon(dbus.service.Object):
+class SyncDaemon:#(dbus.service.Object):
   def __init__(self):
     self.log = logging.getLogger('SyncDaemon')
     self.log.debug(&quot;Created SyncDaemon&quot;)
     self.log.debug(&quot;Attaching to D-BUS&quot;)
     self.name = dbus.service.BusName(&quot;net.wm161.HomeSync&quot;,bus=dbus.SessionBus())
-    dbus.service.Object.__init__(self, object_path=&quot;/Server&quot;, conn=dbus.SessionBus(), bus_name=self.name)
+    #dbus.service.Object.__init__(self, object_path=&quot;/Server&quot;, conn=dbus.SessionBus(), bus_name=self.name)
 
     home = os.environ[&quot;HOME&quot;]
     os.chdir(home)
-    self.archive = SyncArchive(home, backup=False)
+    self.archiveHandler = DaemonCallback(self)
+    self.archive = SyncArchive(home, backup=False, gitHandler = self.archiveHandler)
     self.archive.create()
 
-    os.nice(5)
-    #if (self.git.exists() == False):
-      #self.log.info(&quot;Missing Git repo. Running git-init.&quot;)
-      #self.jobs.enqueue(self.git.init)
-      #self.jobs.enqueue(self.git.setConfig,&quot;core.excludesfile&quot;,home+&quot;/.home-sync/ignore&quot;)
-      #self.jobs.enqueue(self.git.setConfig,&quot;core.compression&quot;,-1)
-
-    #self.log.debug(&quot;Watching %s&quot;%(home))
-    #self.watcher = SyncWatcher()
-    #self.watcher.add(home)
-    #QtCore.QObject.connect(self.watcher,QtCore.SIGNAL(&quot;directoryChanged(QString)&quot;),self.dirUpdate)
+    #os.nice(5)
+    
     self.Ready()
     
-    self.log.info(&quot;Starting index crawler&quot;)
+    self.log.info(&quot;Starting indexing crawler&quot;)
     self.crawler = Crawler(self.archive)
     self.crawler.start()
+    self.watcher = Watcher(self.archive)
+    self.watcher.start()
     
-    self.avahi = AvahiBrowser()
-    self.deviceWatcher = DeviceWatcher()
+    #self.avahi = AvahiBrowser()
+    #self.deviceWatcher = DeviceWatcher()
+    self.log.info(&quot;Ready for action.&quot;)
   
   def dirUpdate(self,path):
     path = unicode(path).replace(os.environ[&quot;HOME&quot;]+&quot;/&quot;,'./',1)
     self.DirectoryChanged(path)
     
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
   def PushToServer(self, remote):
     pass
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', out_signature='as')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', out_signature='as')
   def DiscoveredHosts(self):
     pass
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', out_signature='as', in_signature='i')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', out_signature='as', in_signature='i')
   def ListFiles(self,type):
     self.log.debug(&quot;Listing files of type %i&quot;%(type))
     return self.git.files(type)
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
   def AddFile(self,file):
     self.log.debug(&quot;Adding %s to repository&quot;,file)
     self.jobs.enqueue(self.git.add,file,self.FileAdded)
     self.jobs.enqueue(self.git.commit, &quot;%s added&quot;%(file), callback=self.FileCommitted)
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server')
   def ArchiveNow(self):
     self.log.info(&quot;Requested an immediate archive.&quot;)
     self.jobs.enqueue(self.git.commitAll,&quot;On Demand Archive&quot;, callback=self.FileCommitted)
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
   def CommitFile(self, file):
     self.log.info(&quot;Committing %s&quot;,file)
     self.jobs.enqueue(self.git.commit,&quot;Requested commit for %s&quot;%(file), path=file, callback=self.FileCommitted)
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
   def CreateBackup(self, path):
     self.log.info(&quot;Creating backup on %s&quot;,path)
     backup = GitInterface(path,bare=True)
     backup.init()
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s')
   def Backup(self, path):
     self.log.info(&quot;Pushing backup to %s&quot;,path)
     #backup = GitInterface(path,bare=True)
     self.jobs.enqueue(self.git.push,path)
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server')
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server')
   def ExitDaemon(self):
     self.log.info(&quot;Exiting&quot;)
     sys.exit()
   
-  @dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s', out_signature=&quot;a(si)&quot;)
+  #@dbus.service.method(dbus_interface='net.wm161.HomeSync.Server', in_signature='s', out_signature=&quot;a(si)&quot;)
   def FileRevisions(self,path):
     self.log.debug(&quot;Requesting revisions of %s&quot;%(path))
     return self.git.revisionList(path)
   
-  @dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server')
+  #@dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server')
   def Ready(self):
     self.log.debug(&quot;Ready.&quot;)
   
-  @dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server', signature='s')
+  #@dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server', signature='s')
   def FileAdded(self,file):
     self.log.debug(&quot;File added: %s&quot;,file)
     
-  @dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server', signature='s')
+  #@dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server', signature='s')
   def FileCommitted(self, file):
     self.log.debug(&quot;File committed: %s&quot;,file)
-  
-  @dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server', signature='s')
-  def FileChanged(self,path):
-    #TODO: Detect batch updates
-    self.log.debug(&quot;Detected change in file %s&quot;%(path))
-    self.jobs.enqueue(self.git.commit,&quot;%s modification&quot;%(path), path=path, callback=self.FileCommitted)
-  
-  @dbus.service.signal(dbus_interface='net.wm161.HomeSync.Server', signature='s')
-  def DirectoryChanged(self,path):
-    self.log.debug(&quot;Detected change in directory %s&quot;%(path))
-    self.jobs.enqueue(self.git.commit,&quot;%s modification&quot;%(file), path=path, callback=self.FileCommitted)</diff>
      <filename>HomeSync/SyncDaemon.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,19 @@
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
 import sys
 import logging
 from HomeSync.SyncDaemon import SyncDaemon
 
-try:
-  from dbus.mainloop.glib import DBusGMainLoop
-  import gobject
-  glibLoop = True
-except:
-  try:
-    from dbus.mainloop.qt import DBusQtMainLoop
-    from PyQt4 import QtCore
-    glibLoop = False
-  except:
-    print &quot;No D-BUS main loops found.&quot;
-    sys.exit()
+from dbus.mainloop.glib import DBusGMainLoop
+import gobject
+
 
 if __name__ == &quot;__main__&quot;:
   logging.basicConfig(level=logging.DEBUG)
-  if glibLoop:
-    DBusGMainLoop(set_as_default=True)
-    server = SyncDaemon()
-    loop = gobject.MainLoop()
-    loop.run()
-  else:
-    DBusQtMainLoop(set_as_default=True)
-    server = SyncDaemon()
-    loop = QtCore.QEventLoop()
-    sys.exit(loop._exec())
+  #DBusGMainLoop(set_as_default=True)
+  server = SyncDaemon()
+  #loop = gobject.MainLoop()
+  #try:
+    #loop.run()
+  #except KeyboardInterrupt:
+    #server.ExitDaemon()
\ No newline at end of file</diff>
      <filename>sync-daemon.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>855eebcdb0ae841a985d1211a01652349932981e</id>
    </parent>
  </parents>
  <author>
    <name>Trever Fischer</name>
    <email>wm161@wm161.net</email>
  </author>
  <url>http://github.com/workman161/homesync/commit/9d2b919e135baad95330a5e529b6032dd2af6c4f</url>
  <id>9d2b919e135baad95330a5e529b6032dd2af6c4f</id>
  <committed-date>2009-04-02T11:51:48-07:00</committed-date>
  <authored-date>2009-04-02T11:51:48-07:00</authored-date>
  <message>Added exception handling to jobs
Implemented more git commands to GitInterface, renamed a few to make more sense
Made the background indexing crawler into its own thread
Added inotify support to track modifications in realtime
Temporarily removed DBus to workaround a global interpreter lock bug with python-dbus</message>
  <tree>74d50710cbb667e5c4f69a2e57bf3a20e71ac827</tree>
  <committer>
    <name>Trever Fischer</name>
    <email>wm161@wm161.net</email>
  </committer>
</commit>
