]> git.notmuchmail.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <bremner@debian.org>
Thu, 24 May 2012 01:48:16 +0000 (22:48 -0300)
committerDavid Bremner <bremner@debian.org>
Thu, 24 May 2012 01:48:16 +0000 (22:48 -0300)
merge 0.13.1 bugfix patches back to master, fixes for emacs reply and
spurious directory document creation.

1  2 
bindings/python/notmuch/database.py

index ee0366cd0c846ce848be42c1a349e38be68d7b81,e5c74cfb164557e53914559f758712b491a3d78d..5931f41bc26c28d17ca1b5b306beb9abef313674
@@@ -20,8 -20,7 +20,8 @@@ Copyright 2010 Sebastian Spaeth <Sebast
  import os
  import codecs
  from ctypes import c_char_p, c_void_p, c_uint, byref, POINTER
 -from notmuch.globals import (
 +from .compat import SafeConfigParser
 +from .globals import (
      nmlib,
      Enum,
      _str,
@@@ -38,8 -37,8 +38,8 @@@ from .errors import 
      NotInitializedError,
      ReadOnlyDatabaseError,
  )
 -from notmuch.message import Message
 -from notmuch.tag import Tags
 +from .message import Message
 +from .tag import Tags
  from .query import Query
  from .directory import Directory
  
@@@ -347,7 -346,6 +347,6 @@@ class Database(object)
  
      def get_directory(self, path):
          """Returns a :class:`Directory` of path,
-         (creating it if it does not exist(?))
  
          :param path: An unicode string containing the path relative to the path
                of database (see :meth:`get_path`), or else should be an absolute
          :returns: :class:`Directory` or raises an exception.
          :raises: :exc:`FileError` if path is not relative database or absolute
                   with initial components same as database.
-         :raises: :exc:`ReadOnlyDatabaseError` if the database has not been
-                  opened in read-write mode
          """
          self._assert_db_is_initialized()
  
                   retry.
          :raises: :exc:`NotInitializedError` if the database was not
                   intitialized.
-         :raises: :exc:`ReadOnlyDatabaseError` if the database has not been
-                  opened in read-write mode
  
          *Added in notmuch 0.9*"""
          self._assert_db_is_initialized()
  
-         # work around libnotmuch calling exit(3), see
-         # id:20120221002921.8534.57091@thinkbox.jade-hamburg.de
-         # TODO: remove once this issue is resolved
-         if self.mode != Database.MODE.READ_WRITE:
-             raise ReadOnlyDatabaseError('The database has to be opened in '
-                                         'read-write mode for get_directory')
          msg_p = NotmuchMessageP()
          status = Database._find_message_by_filename(self._db, _str(filename),
                                                      byref(msg_p))
          """
          self._assert_db_is_initialized()
          tags_p = Database._get_all_tags(self._db)
 -        if tags_p == None:
 +        if not tags_p:
              raise NullPointerError()
          return Tags(tags_p, self)
  
          """ Reads a user's notmuch config and returns his db location
  
          Throws a NotmuchError if it cannot find it"""
 -        try:
 -            # python3.x
 -            from configparser import SafeConfigParser
 -        except ImportError:
 -            # python2.x
 -            from ConfigParser import SafeConfigParser
 -
          config = SafeConfigParser()
          conf_f = os.getenv('NOTMUCH_CONFIG',
                             os.path.expanduser('~/.notmuch-config'))
      def db_p(self):
          """Property returning a pointer to `notmuch_database_t` or `None`
  
 -        This should normally not be needed by a user (and is not yet
 -        guaranteed to remain stable in future versions).
 +        .. deprecated:: 0.14
 +                        If you really need a pointer to the notmuch
 +                        database object use the `_pointer` field. This
 +                        alias will be removed in notmuch 0.15.
          """
          return self._db