[REF] Removed support for __terp__.py files and `terp` root elements in XML files.

bzr revid: vmt@openerp.com-20130212152328-flpn1tbz75lhi2m2
This commit is contained in:
Vo Minh Thu 2013-02-12 16:23:28 +01:00
parent 96c8a54d22
commit 9f9c9585a1
5 changed files with 27 additions and 23 deletions

10
doc/changelog.rst Normal file
View File

@ -0,0 +1,10 @@
.. _changelog:
Changelog
=========
`trunk`
-------
- Removed support for `__terp__.py` descriptor files.
- Removed support for `<terp>` root element in XML files.

View File

@ -37,6 +37,14 @@ OpenERP Server API
api_models.rst
Changelog
'''''''''
.. toctree::
:maxdepth: 1
changelog.rst
Concepts
''''''''

View File

@ -246,17 +246,10 @@
</rng:define>
<rng:start>
<rng:choice>
<rng:element name="openerp">
<rng:oneOrMore>
<rng:ref name="data" />
</rng:oneOrMore>
</rng:element>
<rng:element name="terp">
<rng:oneOrMore>
<rng:ref name="data" />
</rng:oneOrMore>
</rng:element>
</rng:choice>
<rng:element name="openerp">
<rng:oneOrMore>
<rng:ref name="data" />
</rng:oneOrMore>
</rng:element>
</rng:start>
</rng:grammar>

View File

@ -226,7 +226,7 @@ def zip_directory(directory, b64enc=True, src=True):
base = os.path.basename(path)
for f in osutil.listdir(path, True):
bf = os.path.basename(f)
if not RE_exclude.search(bf) and (src or bf in ('__openerp__.py', '__terp__.py') or not bf.endswith('.py')):
if not RE_exclude.search(bf) and (src or bf == '__openerp__.py' or not bf.endswith('.py')):
archive.write(os.path.join(path, f), os.path.join(base, f))
archname = StringIO()
@ -310,8 +310,6 @@ def load_information_from_description_file(module):
"""
terp_file = get_module_resource(module, '__openerp__.py')
if not terp_file:
terp_file = get_module_resource(module, '__terp__.py')
mod_path = get_module_path(module)
if terp_file:
info = {}
@ -354,8 +352,7 @@ def load_information_from_description_file(module):
#TODO: refactor the logger in this file to follow the logging guidelines
# for 6.0
_logger.debug('module %s: no descriptor file'
' found: __openerp__.py or __terp__.py (deprecated)', module)
_logger.debug('module %s: no __openerp__.py file found.', module)
return {}

View File

@ -833,12 +833,8 @@ form: module.record_id""" % (xml_id,)
return model_data_obj.get_object_reference(cr, self.uid, mod, id_str)
def parse(self, de):
if not de.tag in ['terp', 'openerp']:
_logger.error("Mismatch xml format")
raise Exception( "Mismatch xml format: only terp or openerp as root tag" )
if de.tag == 'terp':
_logger.warning("The tag <terp/> is deprecated, use <openerp/>")
if de.tag != 'openerp':
raise Exception("Mismatch xml format: root tag must be `openerp`.")
for n in de.findall('./data'):
for rec in n: