~jaap.karssenberg/zim/pyzim-gtk3

« back to all changes in this revision

Viewing changes to zim/config/dicts.py

  • Committer: Jaap Karssenberg
  • Date: 2014-01-31 11:06:27 UTC
  • mto: (668.1.49 pyzim-refactor)
  • mto: This revision was merged to the branch mainline in revision 676.
  • Revision ID: jaap.karssenberg@gmail.com-20140131110627-t7wyjr801qk6lkqa
Fixed issue with autosaving pages and autosaving versions
Removed zim.async and make it more explicit depent on threading

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
 
35
35
from zim.signals import SignalEmitter, ConnectorMixin
36
 
from zim.utils import OrderedDict
 
36
from zim.utils import OrderedDict, FunctionThread
37
37
from zim.fs import File, FileNotFoundError
38
38
from zim.errors import Error
39
39
 
769
769
 
770
770
        def write_async(self):
771
771
                '''Write data asynchronously and set C{modified} to C{False}
772
 
                @returns: an L{AsyncOperation} object
 
772
                @returns: an L{FunctionThread} object
773
773
                '''
774
 
                operation = self.file.writelines_async(self.dump())
775
 
                # TODO do we need async error handling here ?
 
774
                func = FunctionThread(
 
775
                        self.file,
 
776
                        self.file.writelines,
 
777
                        self.dump())
 
778
                func.start()
776
779
                self.set_modified(False)
777
 
                return operation
 
780
                return func
778
781
 
779
782
        def dump(self):
780
783
                '''Serialize the config to a "ini-style" config file.