Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
3019f4a4
Commit
3019f4a4
authored
8 years ago
by
Raphael Collet
Browse files
Options
Downloads
Patches
Plain Diff
[REM] openerp.pooler: remove
parent
abc7d83e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
openerp/__init__.py
+0
-1
0 additions, 1 deletion
openerp/__init__.py
openerp/conf/deprecation.py
+0
-5
0 additions, 5 deletions
openerp/conf/deprecation.py
openerp/pooler.py
+0
-40
0 additions, 40 deletions
openerp/pooler.py
with
0 additions
and
46 deletions
openerp/__init__.py
+
0
−
1
View file @
3019f4a4
...
...
@@ -58,7 +58,6 @@ import loglevels
import
modules
import
netsvc
import
osv
import
pooler
import
release
import
report
import
service
...
...
This diff is collapsed.
Click to expand it.
openerp/conf/deprecation.py
+
0
−
5
View file @
3019f4a4
...
...
@@ -34,8 +34,3 @@ allow_local_service = True
# See comments for allow_local_service above.
# Introduced around 2013.03.
allow_report_int_registration
=
True
# If True, the functions in openerp.pooler can be used.
# Introduced around 2013.03 (actually they are deprecated since much longer
# but no warning was dispayed in the logs).
openerp_pooler
=
True
This diff is collapsed.
Click to expand it.
openerp/pooler.py
deleted
100644 → 0
+
0
−
40
View file @
abc7d83e
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Functions kept for backward compatibility.
They are simple wrappers around a global RegistryManager methods.
"""
import
logging
import
openerp.conf.deprecation
from
openerp.modules.registry
import
RegistryManager
_logger
=
logging
.
getLogger
(
__name__
)
def
get_db_and_pool
(
db_name
,
force_demo
=
False
,
status
=
None
,
update_module
=
False
):
"""
Create and return a database connection and a newly initialized registry.
"""
assert
openerp
.
conf
.
deprecation
.
openerp_pooler
_logger
.
warning
(
'
openerp.pooler.get_db_and_pool() is deprecated.
'
)
registry
=
RegistryManager
.
get
(
db_name
,
force_demo
,
status
,
update_module
)
return
registry
.
_db
,
registry
def
restart_pool
(
db_name
,
force_demo
=
False
,
status
=
None
,
update_module
=
False
):
"""
Delete an existing registry and return a database connection and a newly initialized registry.
"""
_logger
.
warning
(
'
openerp.pooler.restart_pool() is deprecated.
'
)
assert
openerp
.
conf
.
deprecation
.
openerp_pooler
registry
=
RegistryManager
.
new
(
db_name
,
force_demo
,
status
,
update_module
)
return
registry
.
_db
,
registry
def
get_db
(
db_name
):
"""
Return a database connection. The corresponding registry is initialized.
"""
assert
openerp
.
conf
.
deprecation
.
openerp_pooler
return
get_db_and_pool
(
db_name
)[
0
]
def
get_pool
(
db_name
,
force_demo
=
False
,
status
=
None
,
update_module
=
False
):
"""
Return a model registry.
"""
assert
openerp
.
conf
.
deprecation
.
openerp_pooler
return
get_db_and_pool
(
db_name
,
force_demo
,
status
,
update_module
)[
1
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment