diff options
author | Simon McVittie <smcv@collabora.com> | 2018-05-02 12:32:50 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-05-02 12:43:10 +0100 |
commit | 9dbabdb569c949bd319a294c822d945dfe18bfa4 (patch) | |
tree | a9603c7ddaeaf77151c8998c4accda37bd65e294 | |
parent | b81df570c8e7a450cfcbd09663f2f15725906b7a (diff) |
Add redirection from the old epydoc documentation to the new versions
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | doc/redirects | 138 | ||||
-rw-r--r-- | doc/redirects.py | 43 |
3 files changed, 190 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index ae5f9de..8d4eb6d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -437,6 +437,8 @@ sphinx_sources = \ doc/index.rst \ doc/news.rst \ doc/PY3PORT.txt \ + doc/redirects \ + doc/redirects.py \ doc/tutorial.txt \ NEWS \ README \ @@ -444,12 +446,13 @@ sphinx_sources = \ EXTRA_DIST += $(sphinx_sources) if ENABLE_API_DOCS -all: doc/_build/index.html +all: doc/_build/stamp -doc/_build/index.html: $(nobase_python_PYTHON) \ +doc/_build/stamp: $(nobase_python_PYTHON) \ _dbus_bindings.la \ _dbus_glib_bindings.la \ $(sphinx_sources) \ + Makefile \ $(NULL) rm -rf doc/_build mkdir doc/_build @@ -458,8 +461,11 @@ doc/_build/index.html: $(nobase_python_PYTHON) \ abs_top_builddir='$(abs_top_builddir)' \ DBUS_PYTHON_NO_DEPRECATED=1 \ $(PYTHON) -m sphinx -b html $(abs_top_srcdir)/doc doc/_build + DBUS_TOP_SRCDIR="$(abs_top_srcdir)" \ + $(PYTHON) doc/redirects.py + touch $@ -_maintainer-update-apidocs: doc/_build/index.html +_maintainer-update-apidocs: doc/_build/stamp rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX doc/_build/ \ dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/ else diff --git a/doc/redirects b/doc/redirects new file mode 100644 index 0000000..659373d --- /dev/null +++ b/doc/redirects @@ -0,0 +1,138 @@ +doc/API_CHANGES.html ../API_CHANGES.html +doc/API_CHANGES.txt "See ../API_CHANGES.html" +doc/HACKING.html ../HACKING.html +doc/HACKING.txt "See ../HACKING.html" +doc/PY3PORT.html ../PY3PORT.html +doc/PY3PORT.txt "See ../PY3PORT.html" +doc/tutorial.html ../tutorial.html +doc/tutorial.txt "See ../tutorial.html" +api/change-index.html ../news.html +api/class-tree.html ../index.html +api/dbus.Array-class.html ../dbus.html +api/dbus.Boolean-class.html ../dbus.html +api/dbus.bus.BusConnection-class.html ../dbus.bus.html +api/dbus.bus-module.html ../dbus.bus.html +api/dbus.bus.NameOwnerWatch-class.html ../dbus.bus.html +api/dbus.bus-pysrc.html ../dbus.bus.html +api/dbus.ByteArray-class.html ../dbus.html +api/dbus.Byte-class.html ../dbus.html +api/dbus._compat-module.html ../dbus.html +api/dbus._compat-pysrc.html ../dbus.html +api/dbus.connection.Connection-class.html ../dbus.connection.html +api/dbus.connection-module.html ../dbus.connection.html +api/dbus.connection-pysrc.html ../dbus.connection.html +api/dbus.connection.SignalMatch-class.html ../dbus.connection.html +api/dbus.dbus_bindings.ConnectionError-class.html ../dbus.html +api/dbus.dbus_bindings-module.html ../dbus.html +api/dbus.dbus_bindings-pysrc.html ../dbus.html +api/dbus._dbus.Bus-class.html ../dbus.html +api/dbus._dbus._DBusBindingsEmulation-class.html ../dbus.html +api/dbus._dbus-module.html ../dbus.html +api/dbus._dbus-pysrc.html ../dbus.html +api/dbus._dbus.SessionBus-class.html ../dbus.html +api/dbus._dbus.StarterBus-class.html ../dbus.html +api/dbus._dbus.SystemBus-class.html ../dbus.html +api/dbus.decorators-module.html ../dbus.decorators.html +api/dbus.decorators-pysrc.html ../dbus.decorators.html +api/dbus.Dictionary-class.html ../dbus.html +api/dbus.Double-class.html ../dbus.html +api/dbus.exceptions.DBusException-class.html ../dbus.html +api/dbus.exceptions.IntrospectionParserException-class.html ../dbus.html +api/dbus.exceptions.MissingErrorHandlerException-class.html ../dbus.html +api/dbus.exceptions.MissingReplyHandlerException-class.html ../dbus.html +api/dbus.exceptions-module.html ../dbus.html +api/dbus.exceptions.NameExistsException-class.html ../dbus.html +api/dbus.exceptions-pysrc.html ../dbus.html +api/dbus.exceptions.UnknownMethodException-class.html ../dbus.html +api/dbus.exceptions.ValidationException-class.html ../dbus.html +api/dbus._expat_introspect_parser-module.html ../dbus.html +api/dbus._expat_introspect_parser._Parser-class.html ../dbus.html +api/dbus._expat_introspect_parser-pysrc.html ../dbus.html +api/dbus.gi_service.ExportedGObject-class.html ../dbus.gi_service.html +api/dbus.gi_service.ExportedGObjectType-class.html ../dbus.gi_service.html +api/dbus.gi_service-module.html ../dbus.gi_service.html +api/dbus.gi_service-pysrc.html ../dbus.gi_service.html +api/dbus.glib-module.html ../dbus.glib.html +api/dbus.glib-pysrc.html ../dbus.glib.html +api/dbus.gobject_service.ExportedGObject-class.html ../dbus.gobject_service.html +api/dbus.gobject_service.ExportedGObjectType-class.html ../dbus.gobject_service.html +api/dbus.gobject_service-module.html ../dbus.gobject_service.html +api/dbus.gobject_service-pysrc.html ../dbus.gobject_service.html +api/dbus.Int16-class.html ../dbus.html +api/dbus.Int32-class.html ../dbus.html +api/dbus.Int64-class.html ../dbus.html +api/dbus.lowlevel.ErrorMessage-class.html ../dbus.lowlevel.html +api/dbus.lowlevel.Message-class.html ../dbus.lowlevel.html +api/dbus.lowlevel.MethodCallMessage-class.html ../dbus.lowlevel.html +api/dbus.lowlevel.MethodReturnMessage-class.html ../dbus.lowlevel.html +api/dbus.lowlevel-module.html ../dbus.lowlevel.html +api/dbus.lowlevel.PendingCall-class.html ../dbus.lowlevel.html +api/dbus.lowlevel-pysrc.html ../dbus.lowlevel.html +api/dbus.lowlevel.SignalMessage-class.html ../dbus.lowlevel.html +api/dbus.mainloop.glib-module.html ../dbus.mainloop.html +api/dbus.mainloop.glib-pysrc.html ../dbus.mainloop.html +api/dbus.mainloop-module.html ../dbus.mainloop.html +api/dbus.mainloop.NativeMainLoop-class.html ../dbus.mainloop.html +api/dbus.mainloop-pysrc.html ../dbus.mainloop.html +api/dbus-module.html ../dbus.html +api/dbus.ObjectPath-class.html ../dbus.html +api/dbus.proxies._DeferredMethod-class.html ../dbus.proxies.html +api/dbus.proxies.Interface-class.html ../dbus.proxies.html +api/dbus.proxies-module.html ../dbus.proxies.html +api/dbus.proxies._ProxyMethod-class.html ../dbus.proxies.html +api/dbus.proxies.ProxyObject-class.html ../dbus.proxies.html +api/dbus.proxies-pysrc.html ../dbus.proxies.html +api/dbus-pysrc.html ../dbus.html +api/dbus.server-module.html ../dbus.server.html +api/dbus.server-pysrc.html ../dbus.server.html +api/dbus.server.Server-class.html ../dbus.server.html +api/dbus.service.BusName-class.html ../dbus.service.html +api/dbus.service.FallbackObject-class.html ../dbus.service.html +api/dbus.service.Interface-class.html ../dbus.service.html +api/dbus.service.InterfaceType-class.html ../dbus.service.html +api/dbus.service-module.html ../dbus.service.html +api/dbus.service.Object-class.html ../dbus.service.html +api/dbus.service-pysrc.html ../dbus.service.html +api/dbus.service._VariantSignature-class.html ../dbus.service.html +api/dbus.Signature-class.html ../dbus.html +api/dbus.String-class.html ../dbus.html +api/dbus.Struct-class.html ../dbus.html +api/dbus.types-module.html ../dbus.html +api/dbus.types-pysrc.html ../dbus.html +api/dbus.types.UnixFd-class.html ../dbus.html +api/dbus.UInt16-class.html ../dbus.html +api/dbus.UInt32-class.html ../dbus.html +api/dbus.UInt64-class.html ../dbus.html +api/dbus.UTF8String-class.html ../dbus.html +api/dbus._version-module.html ../dbus.html +api/dbus._version-pysrc.html ../dbus.html +api/deprecated-index.html ../dbus.html +api/frames.html ../dbus.html +api/help.html ../dbus.html +api/identifier-dbus.html ../dbus.html +api/index.html ../dbus.html +api/module-tree.html ../dbus.html +api/redirect.html ../dbus.html +api/since-index.html ../news.html +api/toc-dbus.bus-module.html ../dbus.bus.html +api/toc-dbus._compat-module.html ../dbus.html +api/toc-dbus.connection-module.html ../dbus.connection.html +api/toc-dbus.dbus_bindings-module.html ../dbus.html +api/toc-dbus._dbus-module.html ../dbus.html +api/toc-dbus.decorators-module.html ../dbus.decorators.html +api/toc-dbus.exceptions-module.html ../dbus.exceptions.html +api/toc-dbus._expat_introspect_parser-module.html ../dbus.html +api/toc-dbus.gi_service-module.html ../dbus.gi_service.html +api/toc-dbus.glib-module.html ../dbus.glib.html +api/toc-dbus.gobject_service-module.html ../dbus.gobject_service.html +api/toc-dbus.lowlevel-module.html ../dbus.lowlevel.html +api/toc-dbus.mainloop.glib-module.html ../dbus.mainloop.html +api/toc-dbus.mainloop-module.html ../dbus.mainloop.html +api/toc-dbus-module.html ../dbus.html +api/toc-dbus.proxies-module.html ../dbus.proxies.html +api/toc-dbus.server-module.html ../dbus.server.html +api/toc-dbus.service-module.html ../dbus.service.html +api/toc-dbus.types-module.html ../dbus.types.html +api/toc-dbus._version-module.html ../dbus.html +api/toc-everything.html ../dbus.html +api/toc.html ../dbus.html diff --git a/doc/redirects.py b/doc/redirects.py new file mode 100644 index 0000000..5cee516 --- /dev/null +++ b/doc/redirects.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + +import os + +SRCDIR = os.environ.get('DBUS_TOP_SRCDIR', '.') + +if __name__ == '__main__': + with open(os.path.join(SRCDIR, 'doc', 'redirects'), 'r') as reader: + for line in reader: + line = line.strip() + + if not line: + continue + + if line.startswith('#'): + continue + + page, dest = line.split(None, 1) + + try: + os.makedirs(os.path.join('doc', '_build', os.path.dirname(page))) + except OSError: + pass + + assert not os.path.exists(os.path.join('doc', '_build', page)) + + if dest.startswith('"'): + assert page.endswith('.txt') + text = dest.strip('"') + + with open(os.path.join('doc', '_build', page), 'w') as writer: + writer.write(text) + writer.write('\n') + else: + assert page.endswith('.html') + + with open(os.path.join('doc', '_build', page), 'w') as writer: + writer.write( + '<meta http-equiv="refresh" content="0; url={}" />\n'.format( + dest)) + writer.write( + 'See <a href="{}">{}</a>\n'.format( + dest, dest)) |