#11982 closed enhancement (fixed)
Remove dependency on ConfigObj — at Version 6
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.5 |
Component: | general | Version: | |
Severity: | normal | Keywords: | authzpolicy configobj config |
Cc: | Branch: | ||
Release Notes: |
Removed dependency on |
||
API Changes: |
Added |
||
Internal Changes: |
Description
It seems like the dependency on ConfigObj
in tracopt.perm.authz_policy
may be unnecessary. After extracting a class from the trac.config
module that provides a thin wrapper over ConfigParser
, we can use that class instead of ConfigObj
.
Change History (6)
comment:1 by , 9 years ago
Milestone: | next-dev-1.1.x → 1.1.5 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 9 years ago
Revised changes in log:rjollos.git:t11982-remove-configobj.1. Tested so far on Mac OSX with Python 2.6 and Python 2.7.
comment:3 by , 9 years ago
API Changes: | modified (diff) |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Tested also with Python 2.6 and 2.7 on Windows 7. Committed to trunk in [13993:13995]. More work on config
module is forthcoming in #6551, and yet-to-be-created tickets.
I'll update the 1.1 documentation soon to remove ConfigObj
from the optional dependencies.
comment:4 by , 9 years ago
I started to confirm [13393:13995]. At least, I think we should move the following try...except ImportError:...
statements in trac/config.py
to trac/util/compat.py
like cleandoc() in trac-1.0.5.
29 try: 30 from collections import OrderedDict 31 except ImportError: 32 from trac.util.compat import OrderedDict
After moving that, we could simply replace with:
from trac.util.compat import OrderedDict
comment:5 by , 9 years ago
Thanks, I modified the imports and removed some Python 2.7 compatibility code in the OrderedDict
class in [13996].
Documentation edited in:
Proposed changes in log:rjollos.git:t11982-remove-configobj:
ConfigParser
doesn't throw an exception due to duplicate sections or options.ComponentManager
orOption
classes. The class with knowledge ofComponentManager
andOption
would utilize this extracted class to read and write the environment configuration. The extracted class could be utilized by theauthz_policy
module so that we have the capability to write authz files as well as read them.