summaryrefslogtreecommitdiff
path: root/addons/document
diff options
context:
space:
mode:
authorSanjay Gohel (Open ERP) <sgo@tinyerp.com>2012-08-09 10:52:45 +0530
committerSanjay Gohel (Open ERP) <sgo@tinyerp.com>2012-08-09 10:52:45 +0530
commit374b834d9a689a1a9a19bc5fd1cc1e2ed7e04bca (patch)
tree830fddd3d30195eb8e9e31c7b4ff420ce545d7db /addons/document
parent0e77a7cbda6ea1e7500c42b84f741c5ecbd48a4e (diff)
parente970ecd62cb627a33832a561a082d211ab9923c7 (diff)
[MERGE]merge with trunk
bzr revid: sgo@tinyerp.com-20120809052245-638xhf0oyjtnhcak
Diffstat (limited to 'addons/document')
-rw-r--r--addons/document/content_index.py22
-rw-r--r--addons/document/document.py12
-rw-r--r--addons/document/document_directory.py16
-rw-r--r--addons/document/document_storage.py160
-rw-r--r--addons/document/i18n/ar.po6
-rw-r--r--addons/document/i18n/bg.po4
-rw-r--r--addons/document/i18n/bs.po4
-rw-r--r--addons/document/i18n/ca.po4
-rw-r--r--addons/document/i18n/cs.po4
-rw-r--r--addons/document/i18n/da.po4
-rw-r--r--addons/document/i18n/de.po4
-rw-r--r--addons/document/i18n/el.po4
-rw-r--r--addons/document/i18n/es.po4
-rw-r--r--addons/document/i18n/es_AR.po4
-rw-r--r--addons/document/i18n/es_CR.po4
-rw-r--r--addons/document/i18n/es_EC.po4
-rw-r--r--addons/document/i18n/es_PY.po4
-rw-r--r--addons/document/i18n/et.po4
-rw-r--r--addons/document/i18n/fi.po4
-rw-r--r--addons/document/i18n/fr.po4
-rw-r--r--addons/document/i18n/gl.po4
-rw-r--r--addons/document/i18n/gu.po4
-rw-r--r--addons/document/i18n/hi.po4
-rw-r--r--addons/document/i18n/hr.po4
-rw-r--r--addons/document/i18n/hu.po4
-rw-r--r--addons/document/i18n/id.po4
-rw-r--r--addons/document/i18n/it.po4
-rw-r--r--addons/document/i18n/ja.po4
-rw-r--r--addons/document/i18n/ko.po4
-rw-r--r--addons/document/i18n/lt.po4
-rw-r--r--addons/document/i18n/lv.po4
-rw-r--r--addons/document/i18n/mn.po4
-rw-r--r--addons/document/i18n/nl.po4
-rw-r--r--addons/document/i18n/nl_BE.po4
-rw-r--r--addons/document/i18n/pl.po4
-rw-r--r--addons/document/i18n/pt.po4
-rw-r--r--addons/document/i18n/pt_BR.po4
-rw-r--r--addons/document/i18n/ro.po4
-rw-r--r--addons/document/i18n/ru.po4
-rw-r--r--addons/document/i18n/sk.po4
-rw-r--r--addons/document/i18n/sl.po4
-rw-r--r--addons/document/i18n/sq.po4
-rw-r--r--addons/document/i18n/sr.po4
-rw-r--r--addons/document/i18n/sr@latin.po4
-rw-r--r--addons/document/i18n/sv.po4
-rw-r--r--addons/document/i18n/tlh.po4
-rw-r--r--addons/document/i18n/tr.po4
-rw-r--r--addons/document/i18n/uk.po4
-rw-r--r--addons/document/i18n/vi.po4
-rw-r--r--addons/document/i18n/zh_CN.po4
-rw-r--r--addons/document/i18n/zh_HK.po4
-rw-r--r--addons/document/i18n/zh_TW.po4
-rw-r--r--addons/document/nodes.py164
-rw-r--r--addons/document/std_index.py2
54 files changed, 285 insertions, 285 deletions
diff --git a/addons/document/content_index.py b/addons/document/content_index.py
index f24c033a7ec..4cf3c8dfed2 100644
--- a/addons/document/content_index.py
+++ b/addons/document/content_index.py
@@ -93,13 +93,13 @@ class indexer(object):
except NhException:
pass
- raise NhException('No appropriate method to index file')
+ raise NhException('No appropriate method to index file.')
def _doIndexContent(self,content):
- raise NhException("Content not handled here")
+ raise NhException("Content cannot be handled here.")
def _doIndexFile(self,fpath):
- raise NhException("Content not handled here")
+ raise NhException("Content cannot be handled here.")
def __repr__(self):
return "<indexer %s.%s>" %(self.__module__, self.__class__.__name__)
@@ -116,7 +116,7 @@ def mime_match(mime, mdict):
return (None, None)
class contentIndex(object):
-
+
def __init__(self):
self.mimes = {}
self.exts = {}
@@ -132,9 +132,9 @@ class contentIndex(object):
f = True
if f:
- _logger.debug('Register content indexer: %r', obj)
+ _logger.debug('Register content indexer: %r.', obj)
if not f:
- raise Exception("Your indexer should at least suport a mimetype or extension")
+ raise Exception("Your indexer should at least support a mimetype or extension.")
def doIndex(self, content, filename=None, content_type=None, realfname = None, debug=False):
fobj = None
@@ -169,22 +169,22 @@ class contentIndex(object):
(result, _) = pop.communicate()
mime2 = result.split(';')[0]
- _logger.debug('File gave us: %s', mime2)
+ _logger.debug('File gives us: %s', mime2)
# Note that the temporary file still exists now.
mime,fobj = mime_match(mime2, self.mimes)
if not mime:
mime = mime2
except Exception:
- _logger.exception('Cannot determine mime type')
+ _logger.exception('Cannot determine mime type.')
try:
if fobj:
res = (mime, fobj.indexContent(content,filename,fname or realfname) )
else:
- _logger.debug("Have no object, return (%s, None)", mime)
+ _logger.debug("Have no object, return (%s, None).", mime)
res = (mime, None )
except Exception:
- _logger.exception("Could not index file %s (%s)",
+ _logger.exception("Cannot index file %s (%s).",
filename, fname or realfname)
res = None
@@ -193,7 +193,7 @@ class contentIndex(object):
try:
os.unlink(fname)
except Exception:
- _logger.exception("Could not unlink %s", fname)
+ _logger.exception("Cannot unlink %s.", fname)
return res
cntIndex = contentIndex()
diff --git a/addons/document/document.py b/addons/document/document.py
index fa65f8d9966..3ee52f8e4fb 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -23,7 +23,7 @@ import base64
from osv import osv, fields
import os
-# from psycopg2 import Binary
+#from psycopg2 import Binary
#from tools import config
import tools
from tools.translate import _
@@ -37,8 +37,8 @@ DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['roo
class document_file(osv.osv):
_inherit = 'ir.attachment'
_rec_name = 'datas_fname'
-
-
+
+
def _attach_parent_id(self, cr, uid, ids=None, context=None):
"""Migrate ir.attachments to the document module.
@@ -61,7 +61,7 @@ class document_file(osv.osv):
return False
if ids is not None:
- raise NotImplementedError("Ids is just there by convention! Don't use it yet, please.")
+ raise NotImplementedError("Ids are just there by convention, please do not use it.")
cr.execute("UPDATE ir_attachment " \
"SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \
@@ -294,7 +294,7 @@ class document_file(osv.osv):
('datas_fname', '=', vals['datas_fname']),
]
attach_ids = self.search(cr, uid, domain, context=context)
- super(document_file, self).write(cr, uid, attach_ids,
+ super(document_file, self).write(cr, uid, attach_ids,
{'datas' : vals['datas']},
context=context)
result = attach_ids[0]
@@ -339,7 +339,7 @@ class document_file(osv.osv):
if r:
unres.append(r)
else:
- self.loggerdoc.warning("Unlinking attachment #%s %s that has no storage",
+ self.loggerdoc.warning("Unlinking attachment #%s %s that has no storage.",
f.id, f.name)
res = super(document_file, self).unlink(cr, uid, ids, context)
stor.do_unlink(cr, uid, unres)
diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py
index 03b2dcc47bf..0f18673a007 100644
--- a/addons/document/document_directory.py
+++ b/addons/document/document_directory.py
@@ -78,7 +78,7 @@ class document_directory(osv.osv):
root_id = objid.read(cr, uid, mid, ['res_id'])['res_id']
return root_id
except Exception, e:
-
+
_logger.warning('Cannot set directory root:'+ str(e))
return False
return objid.browse(cr, uid, mid, context=context).res_id
@@ -108,7 +108,7 @@ class document_directory(osv.osv):
_sql_constraints = [
('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !'),
('no_selfparent', 'check(parent_id <> id)', 'Directory cannot be parent of itself!'),
- ('dir_parented', 'check(parent_id IS NOT NULL OR storage_id IS NOT NULL)', 'Directory must have a parent or a storage')
+ ('dir_parented', 'check(parent_id IS NOT NULL OR storage_id IS NOT NULL)', 'Directory must have a parent or a storage.')
]
def name_get(self, cr, uid, ids, context=None):
res = []
@@ -153,7 +153,7 @@ class document_directory(osv.osv):
return True
_constraints = [
- (_check_recursion, 'Error! You can not create recursive Directories.', ['parent_id'])
+ (_check_recursion, 'Error! You cannot create recursive directories.', ['parent_id'])
]
def __init__(self, *args, **kwargs):
@@ -179,7 +179,7 @@ class document_directory(osv.osv):
def get_node_class(self, cr, uid, ids, dbro=None, dynamic=False, context=None):
"""Retrieve the class of nodes for this directory
-
+
This function can be overriden by inherited classes ;)
@param dbro The browse object, if caller already has it
"""
@@ -193,17 +193,17 @@ class document_directory(osv.osv):
elif dbro.type == 'ressource':
return nodes.node_res_dir
else:
- raise ValueError("dir node for %s type", dbro.type)
+ raise ValueError("dir node for %s type.", dbro.type)
def _prepare_context(self, cr, uid, nctx, context=None):
""" Fill nctx with properties for this database
@param nctx instance of nodes.node_context, to be filled
@param context ORM context (dict) for us
-
- Note that this function is called *without* a list of ids,
+
+ Note that this function is called *without* a list of ids,
it should behave the same for the whole database (based on the
ORM instance of document.directory).
-
+
Some databases may override this and attach properties to the
node_context. See WebDAV, CalDAV.
"""
diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py
index 339b320e9a7..21cb4f9dcf4 100644
--- a/addons/document/document_storage.py
+++ b/addons/document/document_storage.py
@@ -52,7 +52,7 @@ For data /storage/ we have the cases:
Have (ir.attachment, context), we modify the file (save, update, rename etc).
Have (directory, context), we create a file.
Have (path, context), we create or modify a file.
-
+
Note that in all above cases, we don't explicitly choose the storage media,
but always require a context to be present.
@@ -61,7 +61,7 @@ nodes, for once, won't. Their metadata will be computed by the parent storage
media + directory.
The algorithm says that in any of the above cases, our first goal is to locate
-the node for any combination of search criteria. It would be wise NOT to
+the node for any combination of search criteria. It would be wise NOT to
represent each node in the path (like node[/] + node[/dir1] + node[/dir1/dir2])
but directly jump to the end node (like node[/dir1/dir2]) whenever possible.
@@ -99,13 +99,13 @@ class nodefd_file(nodes.node_descriptor):
mode = mode[:-1]
self.mode = mode
self._size = os.stat(path).st_size
-
+
for attr in ('closed', 'read', 'write', 'seek', 'tell', 'next'):
setattr(self,attr, getattr(self.__file, attr))
def size(self):
return self._size
-
+
def __iter__(self):
return self
@@ -122,7 +122,7 @@ class nodefd_file(nodes.node_descriptor):
filename = par.path
if isinstance(filename, (tuple, list)):
filename = '/'.join(filename)
-
+
try:
mime, icont = cntIndex.doIndex(None, filename=filename,
content_type=None, realfname=fname)
@@ -173,7 +173,7 @@ class nodefd_db(StringIO, nodes.node_descriptor):
self._size = 0L
if mode.endswith('b'):
mode = mode[:-1]
-
+
if mode in ('r', 'r+'):
cr = ira_browse._cr # reuse the cursor of the browse object, just now
cr.execute('SELECT db_datas FROM ir_attachment WHERE id = %s',(ira_browse.id,))
@@ -188,8 +188,8 @@ class nodefd_db(StringIO, nodes.node_descriptor):
elif mode == 'a':
StringIO.__init__(self, None)
else:
- _logger.error("Incorrect mode %s specified", mode)
- raise IOError(errno.EINVAL, "Invalid file mode")
+ _logger.error("Incorrect mode %s is specified.", mode)
+ raise IOError(errno.EINVAL, "Invalid file mode.")
self.mode = mode
def size(self):
@@ -209,7 +209,7 @@ class nodefd_db(StringIO, nodes.node_descriptor):
filename = par.path
if isinstance(filename, (tuple, list)):
filename = '/'.join(filename)
-
+
try:
mime, icont = cntIndex.doIndex(data, filename=filename,
content_type=None, realfname=None)
@@ -238,7 +238,7 @@ class nodefd_db(StringIO, nodes.node_descriptor):
(out, len(data), par.file_id))
cr.commit()
except Exception:
- _logger.exception('Cannot update db file #%d for close:', par.file_id)
+ _logger.exception('Cannot update db file #%d for close.', par.file_id)
raise
finally:
cr.close()
@@ -246,7 +246,7 @@ class nodefd_db(StringIO, nodes.node_descriptor):
class nodefd_db64(StringIO, nodes.node_descriptor):
""" A descriptor to db data, base64 (the old way)
-
+
It stores the data in base64 encoding at the db. Not optimal, but
the transparent compression of Postgres will save the day.
"""
@@ -255,7 +255,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor):
self._size = 0L
if mode.endswith('b'):
mode = mode[:-1]
-
+
if mode in ('r', 'r+'):
data = base64.decodestring(ira_browse.db_datas)
if data:
@@ -268,8 +268,8 @@ class nodefd_db64(StringIO, nodes.node_descriptor):
elif mode == 'a':
StringIO.__init__(self, None)
else:
- _logger.error("Incorrect mode %s specified", mode)
- raise IOError(errno.EINVAL, "Invalid file mode")
+ _logger.error("Incorrect mode %s is specified.", mode)
+ raise IOError(errno.EINVAL, "Invalid file mode.")
self.mode = mode
def size(self):
@@ -289,7 +289,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor):
filename = par.path
if isinstance(filename, (tuple, list)):
filename = '/'.join(filename)
-
+
try:
mime, icont = cntIndex.doIndex(data, filename=filename,
content_type=None, realfname=None)
@@ -317,7 +317,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor):
(base64.encodestring(data), len(data), par.file_id))
cr.commit()
except Exception:
- _logger.exception('Cannot update db file #%d for close:', par.file_id)
+ _logger.exception('Cannot update db file #%d for close.', par.file_id)
raise
finally:
cr.close()
@@ -330,7 +330,7 @@ class document_storage(osv.osv):
media.
The referring document.directory-ies will control the placement of data
into the storage.
-
+
It is a bad idea to have multiple document.storage objects pointing to
the same tree of filesystem storage.
"""
@@ -384,12 +384,12 @@ class document_storage(osv.osv):
def __prepare_realpath(self, cr, file_node, ira, store_path, do_create=True):
""" Cleanup path for realstore, create dirs if needed
-
+
@param file_node the node
@param ira ir.attachment browse of the file_node
@param store_path the path of the parent storage object, list
@param do_create create the directories, if needed
-
+
@return tuple(path "/var/filestore/real/dir/", npath ['dir','fname.ext'] )
"""
file_node.fix_ppath(cr, ira)
@@ -401,10 +401,10 @@ class document_storage(osv.osv):
# self._logger.debug('Npath: %s', npath)
for n in npath:
if n == '..':
- raise ValueError("Invalid '..' element in path")
+ raise ValueError("Invalid '..' element in path.")
for ch in ('*', '|', "\\", '/', ':', '"', '<', '>', '?',):
if ch in n:
- raise ValueError("Invalid char %s in path %s" %(ch, n))
+ raise ValueError("Invalid char %s in path %s." %(ch, n))
dpath = [store_path,]
dpath += npath[:-1]
path = os.path.join(*dpath)
@@ -420,8 +420,8 @@ class document_storage(osv.osv):
"""
boo = self.browse(cr, uid, id, context=context)
if not boo.online:
- raise IOError(errno.EREMOTE, 'medium offline')
-
+ raise IOError(errno.EREMOTE, 'Medium offline.')
+
if fil_obj:
ira = fil_obj
else:
@@ -435,11 +435,11 @@ class document_storage(osv.osv):
context = {}
boo = self.browse(cr, uid, id, context=context)
if not boo.online:
- raise IOError(errno.EREMOTE, 'medium offline')
-
+ raise IOError(errno.EREMOTE, 'Medium offline.')
+
if boo.readonly and mode not in ('r', 'rb'):
- raise IOError(errno.EPERM, "Readonly medium")
-
+ raise IOError(errno.EPERM, "Readonly medium.")
+
ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context)
if boo.type == 'filestore':
if not ira.store_fname:
@@ -447,8 +447,8 @@ class document_storage(osv.osv):
# try to fix their directory.
if mode in ('r','r+'):
if ira.file_size:
- _logger.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id)
- raise IOError(errno.ENOENT, 'No file can be located')
+ _logger.warning( "ir.attachment #%d does not have a filename, but is at filestore. This should get fixed." % ira.id)
+ raise IOError(errno.ENOENT, 'No file can be located.')
else:
store_fname = self.__get_random_fname(boo.path)
cr.execute('UPDATE ir_attachment SET store_fname = %s WHERE id = %s',
@@ -470,7 +470,7 @@ class document_storage(osv.osv):
do_create = (mode[0] in ('w','a')) )
fpath = os.path.join(path, npath[-1])
if (not os.path.exists(fpath)) and mode[0] == 'r':
- raise IOError("File not found: %s" % fpath)
+ raise IOError("File not found: %s." % fpath)
elif mode[0] in ('w', 'a') and not ira.store_fname:
store_fname = os.path.join(*npath)
cr.execute('UPDATE ir_attachment SET store_fname = %s WHERE id = %s',
@@ -478,10 +478,10 @@ class document_storage(osv.osv):
return nodefd_file(file_node, path=fpath, mode=mode)
elif boo.type == 'virtual':
- raise ValueError('Virtual storage does not support static files')
-
+ raise ValueError('Virtual storage does not support static file(s).')
+
else:
- raise TypeError("No %s storage" % boo.type)
+ raise TypeError("No %s storage." % boo.type)
def __get_data_3(self, cr, uid, boo, ira, context):
if boo.type == 'filestore':
@@ -489,7 +489,7 @@ class document_storage(osv.osv):
# On a migrated db, some files may have the wrong storage type
# try to fix their directory.
if ira.file_size:
- _logger.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id)
+ _logger.warning( "ir.attachment #%d does not have a filename, but is at filestore. This should get fixed." % ira.id)
return None
fpath = os.path.join(boo.path, ira.store_fname)
return file(fpath, 'rb').read()
@@ -521,13 +521,13 @@ class document_storage(osv.osv):
elif not ira.store_fname:
return None
else:
- raise IOError(errno.ENOENT, "File not found: %s" % fpath)
+ raise IOError(errno.ENOENT, "File not found: %s." % fpath)
elif boo.type == 'virtual':
- raise ValueError('Virtual storage does not support static files')
+ raise ValueError('Virtual storage does not support static file(s).')
else:
- raise TypeError("No %s storage" % boo.type)
+ raise TypeError("No %s storage!" % boo.type)
def set_data(self, cr, uid, id, file_node, data, context=None, fil_obj=None):
""" store the data.
@@ -541,12 +541,12 @@ class document_storage(osv.osv):
ira = self.pool.get('ir.attachment').browse(cr, uid, file_node.file_id, context=context)
if not boo.online:
- raise IOError(errno.EREMOTE, 'medium offline')
-
+ raise IOError(errno.EREMOTE, 'Medium offline.')
+
if boo.readonly:
- raise IOError(errno.EPERM, "Readonly medium")
+ raise IOError(errno.EPERM, "Readonly medium.")
- _logger.debug( "Store data for ir.attachment #%d" % ira.id)
+ _logger.debug( "Store data for ir.attachment #%d." % ira.id)
store_fname = None
fname = None
if boo.type == 'filestore':
@@ -557,15 +557,15 @@ class document_storage(osv.osv):
fp = open(fname, 'wb')
try:
fp.write(data)
- finally:
+ finally:
fp.close()
- _logger.debug( "Saved data to %s" % fname)
+ _logger.debug( "Saved data to %s." % fname)
filesize = len(data) # os.stat(fname).st_size
-
+
# TODO Here, an old file would be left hanging.
except Exception, e:
- _logger.warning( "Couldn't save data to %s", path, exc_info=True)
+ _logger.warning( "Cannot save data to %s.", path, exc_info=True)
raise except_orm(_('Error!'), str(e))
elif boo.type == 'db':
filesize = len(data)
@@ -586,21 +586,21 @@ class document_storage(osv.osv):
fp = open(fname,'wb')
try:
fp.write(data)
- finally:
+ finally:
fp.close()
- _logger.debug("Saved data to %s", fname)
+ _logger.debug("Saved data to %s.", fname)
filesize = len(data) # os.stat(fname).st_size
store_fname = os.path.join(*npath)
# TODO Here, an old file would be left hanging.
except Exception,e :
- _logger.warning("Couldn't save data:", exc_info=True)
+ _logger.warning("Cannot save data.", exc_info=True)
raise except_orm(_('Error!'), str(e))
elif boo.type == 'virtual':
- raise ValueError('Virtual storage does not support static files')
+ raise ValueError('Virtual storage does not support static file(s).')
else:
- raise TypeError("No %s storage" % boo.type)
+ raise TypeError("No %s storage!" % boo.type)
# 2nd phase: store the metadata
try:
@@ -612,7 +612,7 @@ class document_storage(osv.osv):
mime, icont = cntIndex.doIndex(data, ira.datas_fname,
ira.file_type or None, fname)
except Exception:
- _logger.debug('Cannot index file:', exc_info=True)
+ _logger.debug('Cannot index file.', exc_info=True)
pass
try:
@@ -629,7 +629,7 @@ class document_storage(osv.osv):
file_node.content_type = mime
return True
except Exception, e :
- self._logger.warning("Couldn't save data:", exc_info=True)
+ self._logger.warning("Cannot save data.", exc_info=True)
# should we really rollback once we have written the actual data?
# at the db case (only), that rollback would be safe
raise except_orm(_('Error at doc write!'), str(e))
@@ -639,10 +639,10 @@ class document_storage(osv.osv):
files that have to be removed, too. """
if not storage_bo.online:
- raise IOError(errno.EREMOTE, 'medium offline')
-
+ raise IOError(errno.EREMOTE, 'Medium offline.')
+
if storage_bo.readonly:
- raise IOError(errno.EPERM, "Readonly medium")
+ raise IOError(errno.EPERM, "Readonly medium.")
if storage_bo.type == 'filestore':
fname = fil_bo.store_fname
@@ -659,7 +659,7 @@ class document_storage(osv.osv):
path = storage_bo.path
return ( storage_bo.id, 'file', os.path.join(path, fname))
else:
- raise TypeError("No %s storage" % storage_bo.type)
+ raise TypeError("No %s storage!" % storage_bo.type)
def do_unlink(self, cr, uid, unres):
for id, ktype, fname in unres:
@@ -667,9 +667,9 @@ class document_storage(osv.osv):
try:
os.unlink(fname)
except Exception:
- _logger.warning("Could not remove file %s, please remove manually.", fname, exc_info=True)
+ _logger.warning("Cannot remove file %s, please remove it manually.", fname, exc_info=True)
else:
- _logger.warning("Unknown unlink key %s" % ktype)
+ _logger.warning("Unlink unknown key %s." % ktype)
return True
@@ -677,17 +677,17 @@ class document_storage(osv.osv):
""" A preparation for a file rename.
It will not affect the database, but merely check and perhaps
rename the realstore file.
-
+
@return the dict of values that can safely be be stored in the db.
"""
sbro = self.browse(cr, uid, file_node.storage_id, context=context)
assert sbro, "The file #%d didn't provide storage" % file_node.file_id
if not sbro.online:
- raise IOError(errno.EREMOTE, 'medium offline')
-
+ raise IOError(errno.EREMOTE, 'Medium offline.')
+
if sbro.readonly:
- raise IOError(errno.EPERM, "Readonly medium")
+ raise IOError(errno.EPERM, "Readonly medium.")
if sbro.type in ('filestore', 'db', 'db64'):
# nothing to do for a rename, allow to change the db field
@@ -699,9 +699,9 @@ class document_storage(osv.osv):
fname = ira.store_fname
if not fname:
- _logger.warning("Trying to rename a non-stored file")
+ _logger.warning("Trying to rename a non-stored file.")
if fname != os.path.join(*npath):
- _logger.warning("inconsistency in realstore: %s != %s" , fname, repr(npath))
+ _logger.warning("Inconsistency to realstore: %s != %s." , fname, repr(npath))
oldpath = os.path.join(path, npath[-1])
newpath = os.path.join(path, new_name)
@@ -711,13 +711,13 @@ class document_storage(osv.osv):
store_fname = os.path.join(*store_path)
return { 'name': new_name, 'datas_fname': new_name, 'store_fname': store_fname }
else:
- raise TypeError("No %s storage" % sbro.type)
+ raise TypeError("No %s storage!" % sbro.type)
def simple_move(self, cr, uid, file_node, ndir_bro, context=None):
""" A preparation for a file move.
It will not affect the database, but merely check and perhaps
move the realstore file.
-
+
@param ndir_bro a browse object of document.directory, where this
file should move to.
@return the dict of values that can safely be be stored in the db.
@@ -726,10 +726,10 @@ class document_storage(osv.osv):
assert sbro, "The file #%d didn't provide storage" % file_node.file_id
if not sbro.online:
- raise IOError(errno.EREMOTE, 'medium offline')
-
+ raise IOError(errno.EREMOTE, 'Medium offline.')
+
if sbro.readonly:
- raise IOError(errno.EPERM, "Readonly medium")
+ raise IOError(errno.EPERM, "Readonly medium.")
par = ndir_bro
psto = None
@@ -739,8 +739,8 @@ class document_storage(osv.osv):
break
par = par.parent_id
if file_node.storage_id != psto:
- _logger.debug('Cannot move file %r from %r to %r', file_node, file_node.parent, ndir_bro.name)
- raise NotImplementedError('Cannot move files between storage media')
+ _logger.debug('Cannot move file %r from %r to %r.', file_node, file_node.parent, ndir_bro.name)
+ raise NotImplementedError('Cannot move file(s) between storage media.')
if sbro.type in ('filestore', 'db', 'db64'):
# nothing to do for a rename, allow to change the db field
@@ -752,30 +752,30 @@ class document_storage(osv.osv):
fname = ira.store_fname
if not fname:
- _logger.warning("Trying to rename a non-stored file")
+ _logger.warning("Trying to rename a non-stored file.")
if fname != os.path.join(*opath):
- _logger.warning("inconsistency in realstore: %s != %s" , fname, repr(opath))
+ _logger.warning("Inconsistency to realstore: %s != %s." , fname, repr(opath))
oldpath = os.path.join(path, opath[-1])
-
+
npath = [sbro.path,] + (ndir_bro.get_full_path() or [])
npath = filter(lambda x: x is not None, npath)
newdir = os.path.join(*npath)
if not os.path.isdir(newdir):
- _logger.debug("Must create dir %s", newdir)
+ _logger.debug("Must create dir %s.", newdir)
os.makedirs(newdir)
npath.append(opath[-1])
newpath = os.path.join(*npath)
-
- _logger.debug("Going to move %s from %s to %s", opath[-1], oldpath, newpath)
+
+ _logger.debug("Going to move %s from %s to %s.", opath[-1], oldpath, newpath)
shutil.move(oldpath, newpath)
-
+
store_path = npath[1:] + [opath[-1],]
store_fname = os.path.join(*store_path)
-
+
return { 'store_fname': store_fname }
else:
- raise TypeError("No %s storage" % sbro.type)
+ raise TypeError("No %s storage." % sbro.type)
document_storage()
diff --git a/addons/document/i18n/ar.po b/addons/document/i18n/ar.po
index 8e1e9026a8a..49a0c9ad646 100644
--- a/addons/document/i18n/ar.po
+++ b/addons/document/i18n/ar.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
@@ -40,7 +40,7 @@ msgstr "لوحة المستندات"
#. module: document
#: model:ir.model,name:document.model_process_node
msgid "Process Node"
-msgstr ""
+msgstr "طرف المعالجات"
#. module: document
#: view:document.directory:0
diff --git a/addons/document/i18n/bg.po b/addons/document/i18n/bg.po
index 9b0f5c9ff42..98952bd2806 100644
--- a/addons/document/i18n/bg.po
+++ b/addons/document/i18n/bg.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/bs.po b/addons/document/i18n/bs.po
index 38bb4b89632..8e9cf19c19f 100644
--- a/addons/document/i18n/bs.po
+++ b/addons/document/i18n/bs.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/ca.po b/addons/document/i18n/ca.po
index 9bedb2496e2..075eee4906a 100644
--- a/addons/document/i18n/ca.po
+++ b/addons/document/i18n/ca.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/cs.po b/addons/document/i18n/cs.po
index ff9031a00b4..b64f9d34d34 100644
--- a/addons/document/i18n/cs.po
+++ b/addons/document/i18n/cs.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
"X-Poedit-Language: Czech\n"
#. module: document
diff --git a/addons/document/i18n/da.po b/addons/document/i18n/da.po
index 257d625181a..0478e923135 100644
--- a/addons/document/i18n/da.po
+++ b/addons/document/i18n/da.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/de.po b/addons/document/i18n/de.po
index 27336369766..6a22cbc0e83 100644
--- a/addons/document/i18n/de.po
+++ b/addons/document/i18n/de.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/el.po b/addons/document/i18n/el.po
index 7a13b9cf086..ff70f1473ca 100644
--- a/addons/document/i18n/el.po
+++ b/addons/document/i18n/el.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/es.po b/addons/document/i18n/es.po
index c253a277404..7fac82bee79 100644
--- a/addons/document/i18n/es.po
+++ b/addons/document/i18n/es.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/es_AR.po b/addons/document/i18n/es_AR.po
index 1f6b3f3ef0f..4b270f1a20e 100644
--- a/addons/document/i18n/es_AR.po
+++ b/addons/document/i18n/es_AR.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/es_CR.po b/addons/document/i18n/es_CR.po
index 60964c8a336..acc6bad0d78 100644
--- a/addons/document/i18n/es_CR.po
+++ b/addons/document/i18n/es_CR.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
"Language: \n"
#. module: document
diff --git a/addons/document/i18n/es_EC.po b/addons/document/i18n/es_EC.po
index 5ffcf6cf9e0..69ed68fec0b 100644
--- a/addons/document/i18n/es_EC.po
+++ b/addons/document/i18n/es_EC.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/es_PY.po b/addons/document/i18n/es_PY.po
index 20b358e3140..af09dc6bc79 100644
--- a/addons/document/i18n/es_PY.po
+++ b/addons/document/i18n/es_PY.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/et.po b/addons/document/i18n/et.po
index 62ed51b4b38..60af115355c 100644
--- a/addons/document/i18n/et.po
+++ b/addons/document/i18n/et.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/fi.po b/addons/document/i18n/fi.po
index 37022bb59d0..432079e9431 100644
--- a/addons/document/i18n/fi.po
+++ b/addons/document/i18n/fi.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/fr.po b/addons/document/i18n/fr.po
index 887ed78b3ba..11ba811195a 100644
--- a/addons/document/i18n/fr.po
+++ b/addons/document/i18n/fr.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/gl.po b/addons/document/i18n/gl.po
index 3e5a8c0ccf6..4bdcdcf1364 100644
--- a/addons/document/i18n/gl.po
+++ b/addons/document/i18n/gl.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/gu.po b/addons/document/i18n/gu.po
index 3e187d1e400..81114cbb22c 100644
--- a/addons/document/i18n/gu.po
+++ b/addons/document/i18n/gu.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/hi.po b/addons/document/i18n/hi.po
index 16b752d8ee8..5d8362dd745 100644
--- a/addons/document/i18n/hi.po
+++ b/addons/document/i18n/hi.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/hr.po b/addons/document/i18n/hr.po
index 5b14b397daa..9d0fc7f18f4 100644
--- a/addons/document/i18n/hr.po
+++ b/addons/document/i18n/hr.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
"Language: hr\n"
#. module: document
diff --git a/addons/document/i18n/hu.po b/addons/document/i18n/hu.po
index 82d20d79681..49ac94305d0 100644
--- a/addons/document/i18n/hu.po
+++ b/addons/document/i18n/hu.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/id.po b/addons/document/i18n/id.po
index 48be3e342a1..a12b7e28ab2 100644
--- a/addons/document/i18n/id.po
+++ b/addons/document/i18n/id.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/it.po b/addons/document/i18n/it.po
index 3fb457c287f..05b30fd5259 100644
--- a/addons/document/i18n/it.po
+++ b/addons/document/i18n/it.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/ja.po b/addons/document/i18n/ja.po
index c1b9a62e53d..e89800eccf1 100644
--- a/addons/document/i18n/ja.po
+++ b/addons/document/i18n/ja.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/ko.po b/addons/document/i18n/ko.po
index b25dad51f2e..3cc699fa6d1 100644
--- a/addons/document/i18n/ko.po
+++ b/addons/document/i18n/ko.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/lt.po b/addons/document/i18n/lt.po
index 6d61e2590f6..7a24ef1b7ed 100644
--- a/addons/document/i18n/lt.po
+++ b/addons/document/i18n/lt.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/lv.po b/addons/document/i18n/lv.po
index e5bf1d2b80e..9c45abbf1d1 100644
--- a/addons/document/i18n/lv.po
+++ b/addons/document/i18n/lv.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/mn.po b/addons/document/i18n/mn.po
index 9127a34fdd7..9696dc1f54a 100644
--- a/addons/document/i18n/mn.po
+++ b/addons/document/i18n/mn.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/nl.po b/addons/document/i18n/nl.po
index 24c5bf99db5..afdb957d360 100644
--- a/addons/document/i18n/nl.po
+++ b/addons/document/i18n/nl.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/nl_BE.po b/addons/document/i18n/nl_BE.po
index c3948a31d90..cc83748032f 100644
--- a/addons/document/i18n/nl_BE.po
+++ b/addons/document/i18n/nl_BE.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/pl.po b/addons/document/i18n/pl.po
index 5724df5528c..0ba8695d695 100644
--- a/addons/document/i18n/pl.po
+++ b/addons/document/i18n/pl.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/pt.po b/addons/document/i18n/pt.po
index 2e04488efee..ce51edffd3f 100644
--- a/addons/document/i18n/pt.po
+++ b/addons/document/i18n/pt.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/pt_BR.po b/addons/document/i18n/pt_BR.po
index 0826a005ba1..d846deb6f9c 100644
--- a/addons/document/i18n/pt_BR.po
+++ b/addons/document/i18n/pt_BR.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/ro.po b/addons/document/i18n/ro.po
index bb496f3d4e6..2d377ccddc2 100644
--- a/addons/document/i18n/ro.po
+++ b/addons/document/i18n/ro.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/ru.po b/addons/document/i18n/ru.po
index 5a1a37369c6..217f3c830e8 100644
--- a/addons/document/i18n/ru.po
+++ b/addons/document/i18n/ru.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/sk.po b/addons/document/i18n/sk.po
index 8bc9034943d..674774572ab 100644
--- a/addons/document/i18n/sk.po
+++ b/addons/document/i18n/sk.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/sl.po b/addons/document/i18n/sl.po
index 8178d69e294..4f43506b6b9 100644
--- a/addons/document/i18n/sl.po
+++ b/addons/document/i18n/sl.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/sq.po b/addons/document/i18n/sq.po
index 640ca68b305..f6c02e85169 100644
--- a/addons/document/i18n/sq.po
+++ b/addons/document/i18n/sq.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/sr.po b/addons/document/i18n/sr.po
index f459d4d048e..9e8ec311227 100644
--- a/addons/document/i18n/sr.po
+++ b/addons/document/i18n/sr.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/sr@latin.po b/addons/document/i18n/sr@latin.po
index be8efcd74fb..49d06f208a4 100644
--- a/addons/document/i18n/sr@latin.po
+++ b/addons/document/i18n/sr@latin.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/sv.po b/addons/document/i18n/sv.po
index 3d1aa60279f..9c3ec2c2f29 100644
--- a/addons/document/i18n/sv.po
+++ b/addons/document/i18n/sv.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/tlh.po b/addons/document/i18n/tlh.po
index 53c6b3c5123..1b7ecdf8204 100644
--- a/addons/document/i18n/tlh.po
+++ b/addons/document/i18n/tlh.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/tr.po b/addons/document/i18n/tr.po
index 380506e9a7d..b828a9c0961 100644
--- a/addons/document/i18n/tr.po
+++ b/addons/document/i18n/tr.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/uk.po b/addons/document/i18n/uk.po
index f7a46b5f666..f1104ea53c7 100644
--- a/addons/document/i18n/uk.po
+++ b/addons/document/i18n/uk.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/vi.po b/addons/document/i18n/vi.po
index 8564c674769..7709b3f5536 100644
--- a/addons/document/i18n/vi.po
+++ b/addons/document/i18n/vi.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/zh_CN.po b/addons/document/i18n/zh_CN.po
index e019f08f1e4..0de55fdab5a 100644
--- a/addons/document/i18n/zh_CN.po
+++ b/addons/document/i18n/zh_CN.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/zh_HK.po b/addons/document/i18n/zh_HK.po
index 0a6eae47900..2c4fc1ddbef 100644
--- a/addons/document/i18n/zh_HK.po
+++ b/addons/document/i18n/zh_HK.po
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/i18n/zh_TW.po b/addons/document/i18n/zh_TW.po
index d2774a22df2..116ad3e0868 100644
--- a/addons/document/i18n/zh_TW.po
+++ b/addons/document/i18n/zh_TW.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-08-07 05:23+0000\n"
-"X-Generator: Launchpad (build 15745)\n"
+"X-Launchpad-Export-Date: 2012-08-09 04:55+0000\n"
+"X-Generator: Launchpad (build 15761)\n"
#. module: document
#: field:document.directory,parent_id:0
diff --git a/addons/document/nodes.py b/addons/document/nodes.py
index b4f423460d7..f1c3c71a8e6 100644
--- a/addons/document/nodes.py
+++ b/addons/document/nodes.py
@@ -45,7 +45,7 @@ _logger = logging.getLogger(__name__)
def _str2time(cre):
""" Convert a string with time representation (from db) into time (float)
-
+
Note: a place to fix if datetime is used in db.
"""
if not cre:
@@ -62,7 +62,7 @@ def get_node_context(cr, uid, context):
class node_context(object):
""" This is the root node, representing access to some particular context
-
+
A context is a set of persistent data, which may influence the structure
of the nodes. All other transient information during a data query should
be passed down with function arguments.
@@ -99,7 +99,7 @@ class node_context(object):
def __ne__(self, other):
return not self.__eq__(other)
-
+
def get(self, name, default=None):
return self.context.get(name, default)
@@ -119,7 +119,7 @@ class node_context(object):
"""Create (or locate) a node for a directory
@param dbro a browse object of document.directory
"""
-
+
fullpath = dbro.get_full_path(context=self.context)
klass = dbro.get_node_class(dbro, context=self.context)
return klass(fullpath, None ,self, dbro)
@@ -183,7 +183,7 @@ class node_descriptor(object):
def __nonzero__(self):
""" Ensure that a node_descriptor will never equal False
-
+
Since we do define __len__ and __iter__ for us, we must avoid
being regarded as non-true objects.
"""
@@ -244,7 +244,7 @@ class node_class(object):
else:
s.append(self.path)
return s #map(lambda x: '/' +x, s)
-
+
def __repr__(self):
return "%s@/%s" % (self.our_type, '/'.join(self.full_path()))
@@ -271,7 +271,7 @@ class node_class(object):
return False
def get_data(self,cr):
- raise TypeError('no data for %s'% self.type)
+ raise TypeError('No data for %s.'% self.type)
def open_data(self, cr, mode):
""" Open a node_descriptor object for this node.
@@ -285,10 +285,10 @@ class node_class(object):
For this class, there is no data, so no implementation. Each
child class that has data should override this.
"""
- raise TypeError('no data for %s' % self.type)
+ raise TypeError('No data for %s.' % self.type)
def _get_storage(self,cr):
- raise RuntimeError("no storage for base class")
+ raise RuntimeError("No storage for base class.")
def get_etag(self,cr):
""" Get a tag, unique per object + modification.
@@ -323,11 +323,11 @@ class node_class(object):
def get_dav_eprop(self, cr, ns, prop):
if not self.DAV_M_NS:
return None
-
+
if self.DAV_M_NS.has_key(ns):
prefix = self.DAV_M_NS[ns]
else:
- _logger.debug('No namespace: %s ("%s")',ns, prop)
+ _logger.debug('No namespace: %s ("%s").',ns, prop)
return None
mname = prefix + "_" + prop.replace('-','_')
@@ -340,12 +340,12 @@ class node_class(object):
r = m(cr)
return r
except AttributeError:
- _logger.debug('Property %s not supported' % prop, exc_info=True)
+ _logger.debug('The property %s is not supported.' % prop, exc_info=True)
return None
def get_dav_resourcetype(self, cr):
""" Get the DAV resource type.
-
+
Is here because some nodes may exhibit special behaviour, like
CalDAV/GroupDAV collections
"""
@@ -384,13 +384,13 @@ class node_class(object):
""" Create a regular file under this node
"""
_logger.warning("Attempted to create a file under %r, not possible.", self)
- raise IOError(errno.EPERM, "Not allowed to create files here")
-
+ raise IOError(errno.EPERM, "Not allowed to create file(s) here.")
+
def create_child_collection(self, cr, objname):
""" Create a child collection (directory) under self
"""
_logger.warning("Attempted to create a collection under %r, not possible.", self)
- raise IOError(errno.EPERM, "Not allowed to create folders here")
+ raise IOError(errno.EPERM, "Not allowed to create folder(s) here.")
def rm(self, cr):
raise NotImplementedError(repr(self))
@@ -404,7 +404,7 @@ class node_class(object):
def check_perms(self, perms):
""" Check the permissions of the current node.
-
+
@param perms either an integers of the bits to check, or
a string with the permission letters
@@ -414,7 +414,7 @@ class node_class(object):
4, r : allow read of file, or listing of dir contents
8, u : allow remove (unlink)
"""
-
+
if isinstance(perms, str):
pe2 = 0
chars = { 'x': 1, 'w': 2, 'r': 4, 'u': 8 }
@@ -423,10 +423,10 @@ class node_class(object):
perms = pe2
elif isinstance(perms, int):
if perms < 0 or perms > 15:
- raise ValueError("Invalid permission bits")
+ raise ValueError("Invalid permission bits.")
else:
- raise ValueError("Invalid permission attribute")
-
+ raise ValueError("Invalid permission attribute.")
+
return ((self.uidperms & perms) == perms)
class node_database(node_class):
@@ -463,9 +463,9 @@ class node_database(node_class):
is_allowed = self.check_perms(1)
else:
is_allowed = self.check_perms(5)
-
+
if not is_allowed:
- raise IOError(errno.EPERM, "Permission into directory denied")
+ raise IOError(errno.EPERM, "Permission into directory denied.")
if domain:
where = where + domain
@@ -493,7 +493,7 @@ def mkdosname(company_name, default='noname'):
for c in company_name[:8]:
n += (c in badchars and '_') or c
return n
-
+
def _uid2unixperms(perms, has_owner):
""" Convert the uidperms and the owner flag to full unix bits
@@ -543,7 +543,7 @@ class node_dir(node_database):
try:
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
except Exception,e:
- print "Cannot eval %s" % dfld.expr
+ print "Cannot eval %s." % dfld.expr
print e
pass
@@ -566,10 +566,10 @@ class node_dir(node_database):
def _file_get(self, cr, nodename=False):
res = super(node_dir,self)._file_get(cr, nodename)
-
+
is_allowed = self.check_perms(nodename and 1 or 5)
if not is_allowed:
- raise IOError(errno.EPERM, "Permission into directory denied")
+ raise IOError(errno.EPERM, "Permission into directory denied.")
cntobj = self.context._dirobj.pool.get('document.directory.content')
uid = self.context.uid
@@ -583,7 +583,7 @@ class node_dir(node_database):
res.extend(res3)
return res
-
+
def _child_get(self, cr, name=None, domain=None):
dirobj = self.context._dirobj
uid = self.context.uid
@@ -595,9 +595,9 @@ class node_dir(node_database):
is_allowed = self.check_perms(1)
else:
is_allowed = self.check_perms(5)
-
+
if not is_allowed:
- raise IOError(errno.EPERM, "Permission into directory denied")
+ raise IOError(errno.EPERM, "Permission into directory denied.")
if not domain:
domain = []
@@ -633,20 +633,20 @@ class node_dir(node_database):
if not directory:
raise OSError(2, 'Not such file or directory.')
if not self.check_perms('u'):
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
if directory._table_name=='document.directory':
if self.children(cr):
raise OSError(39, 'Directory not empty.')
res = self.context._dirobj.unlink(cr, uid, [directory.id])
else:
- raise OSError(1, 'Operation not permited.')
+ raise OSError(1, 'Operation is not permitted.')
return res
def create_child_collection(self, cr, objname):
object2 = False
if not self.check_perms(2):
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
dirobj = self.context._dirobj
uid = self.context.uid
@@ -654,7 +654,7 @@ class node_dir(node_database):
ctx.update(self.dctx)
obj = dirobj.browse(cr, uid, self.dir_id)
if obj and (obj.type == 'ressource') and not object2:
- raise OSError(1, 'Operation not permited.')
+ raise OSError(1, 'Operation is not permitted.')
#objname = uri2[-1]
val = {
@@ -672,7 +672,7 @@ class node_dir(node_database):
Return the node_* created
"""
if not self.check_perms(2):
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
dirobj = self.context._dirobj
uid = self.context.uid
@@ -702,10 +702,10 @@ class node_dir(node_database):
Note /may/ be called with ndir_node = None, to rename the document root.
"""
if ndir_node and (ndir_node.context != self.context):
- raise NotImplementedError("Cannot move directories between contexts")
+ raise NotImplementedError("Cannot move directories between contexts.")
if (not self.check_perms('u')) or (not ndir_node.check_perms('w')):
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
dir_obj = self.context._dirobj
if not fil_obj:
@@ -724,13 +724,13 @@ class node_dir(node_database):
assert self.parent
if self.parent != ndir_node:
- _logger.debug('Cannot move dir %r from %r to %r', self, self.parent, ndir_node)
- raise NotImplementedError('Cannot move dir to another dir')
+ _logger.debug('Cannot move dir %r from %r to %r.', self, self.parent, ndir_node)
+ raise NotImplementedError('Cannot move dir to another dir.')
ret = {}
if new_name and (new_name != dbro.name):
if ndir_node.child(cr, new_name):
- raise IOError(errno.EEXIST, "Destination path already exists")
+ raise IOError(errno.EEXIST, "Destination path already exists.")
ret['name'] = new_name
del dbro
@@ -832,7 +832,7 @@ class node_res_dir(node_class):
elif isinstance(app, tuple):
where.append(app)
else:
- raise RuntimeError("incorrect domain expr: %s" % self.domain)
+ raise RuntimeError("Incorrect domain expr: %s." % self.domain)
if self.resm_id:
where.append(('id','=',self.resm_id))
@@ -845,7 +845,7 @@ class node_res_dir(node_class):
is_allowed = self.check_perms(5)
if not is_allowed:
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
# print "Where clause for %s" % self.res_model, where
if self.ressource_tree:
@@ -864,10 +864,10 @@ class node_res_dir(node_class):
if not res_name:
continue
# Yes! we can't do better but skip nameless records.
-
+
# Escape the name for characters not supported in filenames
res_name = res_name.replace('/','_') # any other weird char?
-
+
if name and (res_name != ustr(name)):
# we have matched _ to any character, but we only meant to match
# the special ones.
@@ -923,7 +923,7 @@ class node_res_obj(node_class):
try:
self.dctx[fld] = safe_eval(expr, dc2)
except Exception,e:
- print "Cannot eval %s for %s" % (expr, fld)
+ print "Cannot eval %s for %s." % (expr, fld)
print e
pass
else:
@@ -962,7 +962,7 @@ class node_res_obj(node_class):
res = []
is_allowed = self.check_perms((nodename and 1) or 5)
if not is_allowed:
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
cntobj = self.context._dirobj.pool.get('document.directory.content')
uid = self.context.uid
@@ -997,7 +997,7 @@ class node_res_obj(node_class):
def get_dav_eprop_DEPR(self, cr, ns, prop):
# Deprecated!
if ns != 'http://groupdav.org/' or prop != 'resourcetype':
- _logger.warning("Who asked for %s:%s?" % (ns, prop))
+ _logger.warning("Who asks for %s:%s?" % (ns, prop))
return None
cntobj = self.context._dirobj.pool.get('document.directory.content')
uid = self.context.uid
@@ -1016,7 +1016,7 @@ class node_res_obj(node_class):
is_allowed = self.check_perms((name and 1) or 5)
if not is_allowed:
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
uid = self.context.uid
ctx = self.context.context.copy()
@@ -1057,7 +1057,7 @@ class node_res_obj(node_class):
where2 = where + [('parent_id','=',self.dir_id) ]
ids = dirobj.search(cr, uid, where2, context=ctx)
bo = obj.browse(cr, uid, self.res_id, context=ctx)
-
+
for dirr in dirobj.browse(cr, uid, ids, context=ctx):
if name and (name != dirr.name):
continue
@@ -1103,7 +1103,7 @@ class node_res_obj(node_class):
dirobj = self.context._dirobj
is_allowed = self.check_perms(2)
if not is_allowed:
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
uid = self.context.uid
ctx = self.context.context.copy()
@@ -1114,7 +1114,7 @@ class node_res_obj(node_class):
obj = dirobj.browse(cr, uid, self.dir_id)
if obj and (obj.type == 'ressource') and not object2:
- raise OSError(1, 'Operation not permited.')
+ raise OSError(1, 'Operation is not permitted.')
val = {
@@ -1135,7 +1135,7 @@ class node_res_obj(node_class):
"""
is_allowed = self.check_perms(2)
if not is_allowed:
- raise IOError(errno.EPERM,"Permission denied")
+ raise IOError(errno.EPERM,"Permission denied.")
dirobj = self.context._dirobj
uid = self.context.uid
@@ -1177,14 +1177,14 @@ class node_file(node_class):
self.write_date = fil.write_date or fil.create_date
self.content_length = fil.file_size
self.displayname = fil.name
-
+
self.uidperms = 14
if parent:
if not parent.check_perms('x'):
self.uidperms = 0
elif not parent.check_perms('w'):
self.uidperms = 4
-
+
try:
self.uuser = (fil.user_id and fil.user_id.login) or 'nobody'
except Exception:
@@ -1213,9 +1213,9 @@ class node_file(node_class):
def open_data(self, cr, mode):
stor = self.storage_id
- assert stor, "No storage for file #%s" % self.file_id
+ assert stor, "No storage for file #%s." % self.file_id
if not self.check_perms(4):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
# If storage is not set properly, we are just screwed here, don't
# try to get it from default.
@@ -1225,7 +1225,7 @@ class node_file(node_class):
def rm(self, cr):
uid = self.context.uid
if not self.check_perms(8):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
document_obj = self.context._dirobj.pool.get('ir.attachment')
if self.type in ('collection','database'):
return False
@@ -1271,7 +1271,7 @@ class node_file(node_class):
stor = self.storage_id
assert stor, "No storage for file #%s" % self.file_id
if not self.check_perms(4):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
# If storage is not set properly, we are just screwed here, don't
# try to get it from default.
@@ -1294,7 +1294,7 @@ class node_file(node_class):
stor = self.storage_id
assert stor, "No storage for file #%s" % self.file_id
if not self.check_perms(2):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
stobj = self.context._dirobj.pool.get('document.storage')
return stobj.set_data(cr, self.context.uid,stor, self, data, self.context.context, fil_obj)
@@ -1304,31 +1304,31 @@ class node_file(node_class):
def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
if ndir_node and ndir_node.context != self.context:
- raise NotImplementedError("Cannot move files between contexts")
+ raise NotImplementedError("Cannot move files between contexts.")
if (not self.check_perms(8)) and ndir_node.check_perms(2):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
doc_obj = self.context._dirobj.pool.get('ir.attachment')
if not fil_obj:
dbro = doc_obj.browse(cr, self.context.uid, self.file_id, context=self.context.context)
else:
dbro = fil_obj
- assert dbro.id == self.file_id, "%s != %s for %r" % (dbro.id, self.file_id, self)
+ assert dbro.id == self.file_id, "%s != %s for %r." % (dbro.id, self.file_id, self)
if not dbro:
- raise IndexError("Cannot locate doc %d", self.file_id)
+ raise IndexError("Cannot locate doc %d.", self.file_id)
if (not self.parent):
# there *must* be a parent node for this one
self.parent = self.context.get_dir_node(cr, dbro.parent_id)
assert self.parent
-
+
ret = {}
if ndir_node and self.parent != ndir_node:
if not (isinstance(self.parent, node_dir) and isinstance(ndir_node, node_dir)):
- _logger.debug('Cannot move file %r from %r to %r', self, self.parent, ndir_node)
- raise NotImplementedError('Cannot move files between dynamic folders')
+ _logger.debug('Cannot move file %r from %r to %r.', self, self.parent, ndir_node)
+ raise NotImplementedError('Cannot move files between dynamic folders.')
if not ndir_obj:
ndir_obj = self.context._dirobj.browse(cr, self.context.uid, \
@@ -1343,7 +1343,7 @@ class node_file(node_class):
if new_name and (new_name != dbro.name):
if len(ret):
- raise NotImplementedError("Cannot rename and move") # TODO
+ raise NotImplementedError("Cannot rename and move.") # TODO
stobj = self.context._dirobj.pool.get('document.storage')
r2 = stobj.simple_rename(cr, self.context.uid, self, new_name, self.context.context)
ret.update(r2)
@@ -1373,7 +1373,7 @@ class node_content(node_class):
self.uidperms = parent.uidperms & 14
self.uuser = parent.uuser
self.ugroup = parent.ugroup
-
+
self.extension = cnt.extension
self.report_id = cnt.report_id and cnt.report_id.id
#self.mimetype = cnt.extension.
@@ -1399,7 +1399,7 @@ class node_content(node_class):
def get_data(self, cr, fil_obj = None):
cntobj = self.context._dirobj.pool.get('document.directory.content')
if not self.check_perms(4):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
ctx = self.context.context.copy()
ctx.update(self.dctx)
@@ -1416,14 +1416,14 @@ class node_content(node_class):
elif mode in ('r+', 'w+'):
cperms = 'rw'
else:
- raise IOError(errno.EINVAL, "Cannot open at mode %s" % mode)
-
+ raise IOError(errno.EINVAL, "Cannot open at mode %s." % mode)
+
if not self.check_perms(cperms):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
ctx = self.context.context.copy()
ctx.update(self.dctx)
-
+
return nodefd_content(self, cr, mode, ctx)
def get_data_len(self, cr, fil_obj = None):
@@ -1438,7 +1438,7 @@ class node_content(node_class):
def set_data(self, cr, data, fil_obj = None):
cntobj = self.context._dirobj.pool.get('document.directory.content')
if not self.check_perms(2):
- raise IOError(errno.EPERM, "Permission denied")
+ raise IOError(errno.EPERM, "Permission denied.")
ctx = self.context.context.copy()
ctx.update(self.dctx)
@@ -1451,7 +1451,7 @@ class node_content(node_class):
return ''
class nodefd_content(StringIO, node_descriptor):
-
+
""" A descriptor to content nodes
"""
def __init__(self, parent, cr, mode, ctx):
@@ -1473,8 +1473,8 @@ class nodefd_content(StringIO, node_descriptor):
elif mode == 'a':
StringIO.__init__(self, None)
else:
- _logger.error("Incorrect mode %s specified", mode)
- raise IOError(errno.EINVAL, "Invalid file mode")
+ _logger.error("Incorrect mode %s is specified.", mode)
+ raise IOError(errno.EINVAL, "Invalid file mode.")
self.mode = mode
def size(self):
@@ -1499,14 +1499,14 @@ class nodefd_content(StringIO, node_descriptor):
raise NotImplementedError
cr.commit()
except Exception:
- _logger.exception('Cannot update db content #%d for close:', par.cnt_id)
+ _logger.exception('Cannot update db content #%d for close.', par.cnt_id)
raise
finally:
cr.close()
StringIO.close(self)
class nodefd_static(StringIO, node_descriptor):
-
+
""" A descriptor to nodes with static data.
"""
def __init__(self, parent, cr, mode, ctx=None):
@@ -1527,8 +1527,8 @@ class nodefd_static(StringIO, node_descriptor):
elif mode == 'a':
StringIO.__init__(self, None)
else:
- _logger.error("Incorrect mode %s specified", mode)
- raise IOError(errno.EINVAL, "Invalid file mode")
+ _logger.error("Incorrect mode %s is specified.", mode)
+ raise IOError(errno.EINVAL, "Invalid file mode.")
self.mode = mode
def size(self):
@@ -1552,7 +1552,7 @@ class nodefd_static(StringIO, node_descriptor):
raise NotImplementedError
cr.commit()
except Exception:
- _logger.exception('Cannot update db content #%d for close:', par.cnt_id)
+ _logger.exception('Cannot update db content #%d for close.', par.cnt_id)
raise
finally:
cr.close()
diff --git a/addons/document/std_index.py b/addons/document/std_index.py
index 49ac9a5c906..422590e127f 100644
--- a/addons/document/std_index.py
+++ b/addons/document/std_index.py
@@ -104,7 +104,7 @@ class DocIndex(indexer):
except OSError:
_logger.warn("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0])
- _logger.debug("Trace of the failed file indexing attempt: ", exc_info=True)
+ _logger.debug("Trace of the failed file indexing attempt.", exc_info=True)
return False
cntIndex.register(DocIndex())