#11824 closed enhancement (fixed)
Remove //Since// version information from TracIni documentation
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.3 |
Component: | general | Version: | |
Severity: | normal | Keywords: | trac.ini documentation |
Cc: | Branch: | ||
Release Notes: |
Removed from documentation the version in which a configuration option was added for versions of Trac < 0.12. |
||
API Changes: |
Leading and trailing whitespace is stripped from translatable string (plugin developers should use |
||
Internal Changes: |
Description
Discussed on the mailing list in gmessage:trac-dev:c136Ptgl_WU/FeZNjNkR06YJ, the Since x.y version information will be removed for Trac < 0.12.
Attachments (0)
Change History (14)
comment:1 by , 10 years ago
Release Notes: | modified (diff) |
---|
follow-up: 3 comment:2 by , 10 years ago
Did you miss the ("enabled" added in 0.11)
, or was it intentional to keep just that one in trac/config.py
? Other changes look right. Thanks for taking care to clean this up.
follow-up: 14 comment:3 by , 10 years ago
Replying to shoffmann:
Did you miss the
("enabled" added in 0.11)
, or was it intentional to keep just that one intrac/config.py
? Other changes look right. Thanks for taking care to clean this up.
Yeah, I wasn't consistent in changing the API documentation. I was wondering whether the same approach should be taken, removing mentions of Trac < 0.12, or if the Trac 0.11 documentation might still be useful for plugin developers.
We should probably just remove mention of Trac < 0.12 from the API documentation too, but I'll just save all changes to the API documentation for another ticket and take a consistent approach when making the changes.
follow-up: 5 comment:4 by , 10 years ago
Committed to trunk in [13304].
I was using the PEP-0008 docstring conventions, putting the trailing """
on a separate line for multiline strings.
However, cleandoc
doesn't strip the trailing whitespace for cases like this: trunk/trac/search/web_ui.py@:50#L39
#: trac/search/web_ui.py:48 msgid "" "Minimum length of query string allowed when performing a search.\n" " " msgstr ""
I propose a fix for this in log:rjollos.git:t11824.1.
follow-up: 6 comment:5 by , 10 years ago
Replying to rjollos:
I propose a fix for this in log:rjollos.git:t11824.1.
Be careful, cleandoc_
is a keyword for message extraction (see setup.cfg), so using it for things like cleandoc_(m)
is wrong (not sure if it triggers an error, but it doesn't feel right).
comment:6 by , 10 years ago
Replying to cboos:
Be careful,
cleandoc_
is a keyword for message extraction (see setup.cfg), so using it for things likecleandoc_(m)
is wrong (not sure if it triggers an error, but it doesn't feel right).
Thanks, I guess I was unlucky enough that it didn't blow up! I've reworked the changes in log:rjollos.git:t11824.2.
follow-up: 8 comment:7 by , 10 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
follow-up: 9 comment:8 by , 10 years ago
Replying to rjollos:
Changes from comment:6 committed in [13311]. New extraction in [13312]. I did some testing by modifying po files, however I'm sure I don't have as good of an eye towards potential problems as translators do. Please let me know if you spot any issues.
Why is cleandoc
added to trac/util/__init__.py
at [13311#file2], for backward compatibility?
-
trac/config.py
diff --git a/trac/config.py b/trac/config.py index 862b0ca..b6fd874 100644
a b import re 20 20 from genshi.builder import tag 21 21 from trac.admin import AdminCommandError, IAdminCommandProvider 22 22 from trac.core import * 23 from trac.util import AtomicFile, as_bool , cleandoc23 from trac.util import AtomicFile, as_bool 24 24 from trac.util.compat import wait_for_file_mtime_change 25 25 from trac.util.text import printout, to_unicode, CRLF 26 from trac.util.translation import _, N_, tag_26 from trac.util.translation import _, N_, cleandoc, tag_ 27 27 28 28 __all__ = ['Configuration', 'ConfigSection', 'Option', 'BoolOption', 29 29 'IntOption', 'FloatOption', 'ListOption', 'ChoiceOption', -
trac/dist.py
diff --git a/trac/dist.py b/trac/dist.py index e65f5de..c3d8c8b 100644
a b try: 71 71 `cleandoc_keywords` option: a list of keywords to clean up the 72 72 extracted messages with `cleandoc`. 73 73 """ 74 from trac.util import cleandoc74 from trac.util.translation import cleandoc 75 75 76 76 funcname = lineno = message_lineno = None 77 77 kwargs_maps = func_kwargs_map = None -
trac/util/__init__.py
diff --git a/trac/util/__init__.py b/trac/util/__init__.py index 43eca24..c2f4c46 100644
a b from trac.util.datefmt import pretty_timedelta, format_datetime, \ 1213 1213 get_date_format_hint, \ 1214 1214 get_datetime_format_hint, http_date, \ 1215 1215 parse_date 1216 from trac.util.translation import cleandoc1217 1216 1218 1217 __no_apidoc__ = 'compat presentation translation'
comment:9 by , 10 years ago
Replying to jomae:
Why is
cleandoc
added totrac/util/__init__.py
at [13311#file2], for backward compatibility?
Reconsidering,
trac.util.text
is better location forcleandoc
, rather thantrac.util
- Or, put implementation of
cleandoc
ontrac.util
andtrac.util.translation
usefrom trac.util import cleandoc
.
follow-up: 11 comment:10 by , 10 years ago
I encountered what look like circular import effects when trying to put the cleandoc
definition of cleandoc
in trac.util
or trac.util.text
.
When locating in trac.util.text
, the following error results:
Python: /home/user/Workspace/t11944/py2.7/bin/python Traceback (most recent call last): File "contrib/make_status.py", line 7, in <module> from trac.util.text import print_table, printout File "/home/user/Workspace/t11944/teo-rjollos.git/trac/util/__init__.py", line 36, in <module> from trac.util.compat import any, md5, sha1, sorted File "/home/user/Workspace/t11944/teo-rjollos.git/trac/util/compat.py", line 24, in <module> from trac.util.text import cleandoc File "/home/user/Workspace/t11944/teo-rjollos.git/trac/util/text.py", line 30, in <module> from trac.util.translation import _ File "/home/user/Workspace/t11944/teo-rjollos.git/trac/util/translation.py", line 22, in <module> from trac.util.text import cleandoc ImportError: cannot import name cleandoc make: *** [status] Error 1
We can work around that by moving the import of _
in trac.util.text
. See log:rjollos.git:t11824.3.
comment:11 by , 10 years ago
Replying to rjollos:
I encountered what look like circular import effects when trying to put the
cleandoc
definition ofcleandoc
intrac.util
ortrac.util.text
. […] We can work around that by moving the import of_
intrac.util.text
. See log:rjollos.git:t11824.3.
Oh, I missed circular references. Your changes look to me. Thanks!
comment:13 by , 10 years ago
API Changes: | modified (diff) |
---|
comment:14 by , 10 years ago
Replying to rjollos:
Replying to shoffmann:
Did you miss the
("enabled" added in 0.11)
, or was it intentional to keep just that one intrac/config.py
? Other changes look right. Thanks for taking care to clean this up.Yeah, I wasn't consistent in changing the API documentation. I was wondering whether the same approach should be taken, removing mentions of Trac < 0.12, or if the Trac 0.11 documentation might still be useful for plugin developers.
We should probably just remove mention of Trac < 0.12 from the API documentation too, but I'll just save all changes to the API documentation for another ticket and take a consistent approach when making the changes.
TODO for cleaning up API documentation added to TracDev/ApiChanges/1.1.3@12.
Proposed changes in log:rjollos.git:t11824.