#11494 closed enhancement (fixed)
Remove deprecated functions and methods from 0.10 and earlier
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Removed old-style macro examples in |
||
API Changes: |
Removed functions and methods that have been deprecated since Trac 0.11 or earlier.
Removed functions and methods that were deprecated and scheduled for removal in Trac 1.0 or earlier:
|
||
Internal Changes: |
Description
It was suggested in comment:1:ticket:11490 that some deprecated code in trac.web.chrome
and trac.mimeview.api
might be removed. It seems best to remove all deprecated code at the same time, so the scope of this ticket may extend beyond those two module. The code to be removed will have been deprecated in Trac 0.10.x or earlier, and the trac-hacks repository will be searched for any plugins that might still be utilizing the code.
Attachments (0)
Change History (21)
comment:1 by , 11 years ago
Reporter: | changed from | to
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Milestone: | 1.1.3 → 1.1.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:4 by , 11 years ago
The proposed changes remove a few more functions that have been deprecated since 0.11:
$ grep -ri "deprecated" . --exclude=*.pyc --exclude-dir=.svn --exclude-dir=locale --exclude-dir=default-pages --exclude-dir=tests ./ChangeLog: * Deprecated SQLite 2.x support (#8625). ./trac/ticket/model.py: :since 1.0: the `cnum` parameter is deprecated, and threading should ./trac/ticket/model.py: :since 1.0.2: the `retarget_to` parameter is deprecated and tickets ./trac/ticket/roadmap.py: deprecated `countsToProg` argument was removed, use ./trac/ticket/query.py: ''deprecated in favor of the `rows` parameter'' ./trac/ticket/query.py: but is deprecated. ./trac/db/api.py: :deprecated: This decorator is in turn deprecated in favor of ./trac/mimeview/api.py: """:deprecated: since 1.0, use `web_context` instead.""" ./trac/mimeview/api.py: :deprecated: since 1.0, use `RenderingContext` instead. `Context` is ./trac/env.py: :deprecated: Use :meth:`db_transaction` or :meth:`db_query` instead ./trac/env.py: """Decorator for transaction functions :deprecated:""" ./trac/env.py: """Return a database connection for read purposes :deprecated: ./trac/perm.py: """Deprecated (but still used by the HDF compatibility layer)""" ./trac/perm.py: self.env.log.warning("perm.permissions() is deprecated and " ./trac/util/__init__.py: .. deprecated :: 0.11 ./trac/wiki/formatter.py: """deprecated in favor of format_to_html (will be removed in 1.0)""" ./trac/wiki/formatter.py: """:deprecated: in favor of format_to_oneliner (will be removed in 1.0)""" ./trac/wiki/formatter.py: """:deprecated: will be removed in 1.0 and replaced by something else""" ./trac/wiki/api.py: """Return the HTML output of the macro :deprecated:""" ./trac/wiki/macros.py: * `nolink` means without link to image source (deprecated, use `link=`) ./trac/wiki/web_ui.py: :deprecated: Not used anymore since 0.11 ./trac/htdocs/css/jquery-ui/jquery-ui.css:/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ ./trac/htdocs/js/suggest.js:/* Warning: this module is deprecated and will be removed in Trac 1.1.x ./trac/versioncontrol/api.py: This option is deprecated, and repositories should be defined in the
One of the changes has been deferred to #11539. The other proposed changes can be found in log:rjollos.git:t11494.
comment:5 by , 11 years ago
API Changes: | modified (diff) |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [12605:12606].
comment:6 by , 11 years ago
I was seeing some errors when building the API docs.
$ make apidoc Running Sphinx v1.1.3 loading pickled environment... done building [html]: targets for 1 source files that are out of date updating environment: 0 added, 2 changed, 0 removed Traceback (most recent call last):_versioncontrol_diff File "/usr/lib/python2.7/dist-packages/sphinx/ext/autodoc.py", line 326, in import_object obj = self.get_attr(obj, part) File "/usr/lib/python2.7/dist-packages/sphinx/ext/autodoc.py", line 232, in get_attr return safe_getattr(obj, name, *defargs) File "/usr/lib/python2.7/dist-packages/sphinx/util/inspect.py", line 70, in safe_getattr raise AttributeError(name) AttributeError: hdf_diff Traceback (most recent call last):_web_chrome File "/usr/lib/python2.7/dist-packages/sphinx/ext/autodoc.py", line 326, in import_object obj = self.get_attr(obj, part) File "/usr/lib/python2.7/dist-packages/sphinx/ext/autodoc.py", line 232, in get_attr return safe_getattr(obj, name, *defargs) File "/usr/lib/python2.7/dist-packages/sphinx/util/inspect.py", line 70, in safe_getattr raise AttributeError(name) AttributeError: add_javascript /home/user/Workspace/tracdev/teo-rjollos.git/doc/api/trac_versioncontrol_diff.rst:36: WARNING: autodoc can't import/find function 'trac.versioncontrol.diff.hdf_diff', it reported error: "hdf_diff", please check your spelling and sys.path /home/user/Workspace/tracdev/teo-rjollos.git/trac/web/chrome.py:docstring of trac.web.chrome.Chrome.wiki_toolbars:1: WARNING: Inline interpreted text or phrase reference start-string without end-string. /home/user/Workspace/tracdev/teo-rjollos.git/doc/api/trac_web_chrome.rst:42: WARNING: autodoc can't import/find function 'trac.web.chrome.add_javascript', it reported error: "add_javascript", please check your spelling and sys.path looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] index writing additional files... genindex py-modindex search copying downloadable files... [ 50%] /home/user/Workspace/tracdev/teo-rjollos.gicopying downloadable files... [100%] /home/user/Workspace/tracdev/teo-rjollos.git/doc/api/../../trac/templates/attach_file_form.html copying static files... done dumping search index... done dumping object inventory... done build succeeded, 3 warnings.
Fixed in [12631].
comment:7 by , 11 years ago
Here is one more deprecated function: tags/trac-1.0.1/trac/ticket/report.py@:662-670#L661. There are no instances of it being used in plugins on trac-hacks.org that are supported in 0.11 or later.
$ grep -r "\.execute_report" trachacks.git/ trachacks.git/autotracplugin/0.9/autotrac/autotrac/autotrac.py: # This method was adapted from ReportModule.execute_report() trachacks.git/tracspanishtranslation/0.10/patchs/trac-spanish-python_utf-8.diff: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/relationalrolesupportpatch/0.9/myhack.diff: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/traditionalchinesetranslation/0.10/trunk/0.10.x/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/zoomquiettranslation/trunk/0.10.x/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/zoomquiettranslation/branches/Trac0.10.4zh3/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/zoomquiettranslation/branches/Trac0.10.4zh2/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/zoomquiettranslation/branches/Trac0.10.4zh1/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/zoomquiettranslation/branches/Trac0.10.4zh0/build/lib/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/zoomquiettranslation/branches/Trac0.10.4zh0/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args) trachacks.git/tracfrenchtranslation/0.10/trac/ticket/report.py: cols, rows = self.execute_report(req, db, id, sql, args)
Shall I remove it?
comment:10 by , 11 years ago
API Changes: | modified (diff) |
---|
follow-up: 13 comment:11 by , 10 years ago
#11539 was opened to address some more complex issues in trac.wiki.formatter
, but it looks like trunk/trac/wiki/formatter.py@12820:419-422#L410 could be removed immediately.
Since env.abs_href.base
is set here, can the following change be made now?
-
trac/wiki/formatter.py
diff --git a/trac/wiki/formatter.py b/trac/wiki/formatter.py index fe7de40..dc031d7 100644
a b class Formatter(object): 422 422 LINK_SCHEME = WikiParser.LINK_SCHEME 423 423 424 424 def __init__(self, env, context): 425 """Note: `req` is still temporarily used."""426 425 self.env = env 427 426 self.context = context.child() 428 427 self.context.set_hints(disable_warnings=True) 429 self.req = context.req 428 self.req = context.req # Deprecated and will be removed in 1.3.1 430 429 self.href = context.href 431 430 self.resource = context.resource 432 431 self.perm = context.perm … … class Formatter(object): 740 739 return self._make_ext_link(url, label, title) 741 740 742 741 def _make_ext_link(self, url, text, title=''): 743 local_url = self.env.project_url or \ 744 (self.req or self.env).abs_href.base 742 local_url = self.env.project_url or self.env.abs_href.base 745 743 if not url.startswith(local_url): 746 744 return tag.a(tag.span(u'\u200b', class_="icon"), text, 747 745 class_="ext-link", href=url, title=title or None)
I haven't looked closely at the consequences of the change, but I plan to do so.
comment:12 by , 10 years ago
In [12855], removed an attribute that was schedule for removal, and also scheduled two attributes for removal.
comment:13 by , 10 years ago
Replying to rjollos:
#11539 was opened to address some more complex issues in
trac.wiki.formatter
, but it looks like trunk/trac/wiki/formatter.py@12785:419-422#L410 could be removed immediately.
Removed in [12861].
Since
env.abs_href.base
is set here, can the following change be made now?
I made the change in a separate changeset in case it needs to be rolled back, but it appears to be okay per the testing I've done: [12862]. For reference, the code was implemented in [4734/trunk/trac/wiki/formatter.py].
It looks like the following JavaScript code can be removed (see [4003]): browser:/trunk/trac/htdocs/js/trac.js@12459:170-183#L167, so I went ahead and removed it in [12863].
comment:14 by , 10 years ago
API Changes: | modified (diff) |
---|
comment:15 by , 10 years ago
comment:10:ticket:6374 suggests that trunk/trac/templates/macros.html@12661 and trunk/trac/templates/macros.rss@12661 were intended to be removed in Trac 1.0. They were deprecated in Trac 0.12. I propose to remove them on the trunk for Trac 1.2.
comment:16 by , 10 years ago
API Changes: | modified (diff) |
---|
Removed macros.html
and macros.rss
in [12889].
comment:17 by , 10 years ago
trunk/trac/ticket/web_ui.py@12826:116-128#L113 was scheduled for removal in Trac 1.0, so I propose to remove it in this ticket.
follow-up: 21 comment:18 by , 10 years ago
API Changes: | modified (diff) |
---|
Change from comment:17 committed in [12962].
comment:19 by , 10 years ago
API Changes: | modified (diff) |
---|
Okay to me for deleting deprecated
trac.web.chrome:add_javascript
,trac.mimeview.api:Mimeview.get_max_preview_size
andtrac.mimeview.api:Mimeview.to_utf8
methods from trunk.