#11894 closed defect (fixed)
_parse_db_str should not be a protected member of module
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.3 |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: |
Renamed |
||
Internal Changes: |
Description
_parse_db_str in trac.db.api
is used throughout Trac. We should rename the function to parse_db_str
, aliasing it to _parse_db_str
for backward compatibility.
$ grep -R "import.*_parse_db_str" --exclude-dir=.svn --exclude-dir=htmlcov trac/db/tests/api.py:from trac.db.api import DatabaseManager, _parse_db_str, get_column_names, \ trac/db/postgres_backend.py:from trac.db.api import ConnectionBase, IDatabaseConnector, _parse_db_str trac/test.py:from trac.db.api import DatabaseManager, _parse_db_str
Attachments (0)
Change History (6)
comment:1 by , 10 years ago
Status: | new → assigned |
---|
comment:2 by , 10 years ago
Fine by me. The method is used by few plugins.
$ git grep -w _parse_db_str | sed -e 's#/.*$##' | sort | uniq -c 12 tracfrenchtranslation 2 tracmigrateplugin 12 traditionalchinesetranslation 62 zoomquiettranslation
follow-up: 4 comment:3 by , 10 years ago
Looks good.
Would parse_db_connection_string
be too long? I think connection string is less ambiguous.
The description could maybe mention the [trac]
database TracIni option.
comment:4 by , 10 years ago
Replying to psuter:
Would
parse_db_connection_string
be too long? I think connection string is less ambiguous.
A more descriptive name sounds good. To shorten it we could use cnx
rather than connection
, but I think parse_db_connection_string
is good.
comment:5 by , 10 years ago
parse_connection_uri
(or parse_db_connection_uri
) would be a bit shorter as well.
comment:6 by , 10 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [13583].
Proposed changes in log:rjollos.git:t11894.