Commits

osimons  committed c41ee9c

Final changes to protocols api via new patch, and closing all the protocol patches via a 'Committed' section in 'series' file, following commit to main svn repos.

  • Participants
  • Parent commits 7970aa6

Comments (0)

Files changed (2)

 # TODO: Add timeline links next to attachments
 # t1055/t1055-list_links-r7194.diff
 
+#############
+# Committed #
+#############
+
 # Make protocols pluggable (including default supported ones)
 # Also fixes: #5848 (permission error response code)
 # Also fixes: #5436 (rename plugin to TracRPC - note need to completely remove old code)
 # TODO: Check (XML | JSON) RPC error codes
-t5437/t5437-protocol_api-r7194.diff
-
+#t5437/t5437-protocol_api-r7194.diff
 # Protocol API version 2
-t5437/t5437-protocol_api_v2-r7194.diff
-t5437/t5437-accepts_mimetype-r7194.diff
-
+#t5437/t5437-protocol_api_v2-r7194.diff
+# Mime_type + tests
+#t5437/t5437-accepts_mimetype-r7194.diff
+# Final review and tuning before merge
+#t5437/t5437-final_review-r7194.diff
+==>> http://trac-hacks.org/changeset/7916

File t5437/t5437-final_review-r7194.diff

+# HG changeset patch
+# Parent 940c07799bf878f30761c25d65dc145f62277a00
+
+diff --git a/trunk/MANIFEST.in b/trunk/MANIFEST.in
+--- a/trunk/MANIFEST.in
++++ b/trunk/MANIFEST.in
+@@ -1,4 +1,5 @@
+ include README.wiki
+-include tracrpc/htdocs/css/*.css
+-include tracrpc/htdocs/js/*.js
++include setup.cfg
++include tracrpc/htdocs/*.css
++include tracrpc/htdocs/*.js
+ include tracrpc/templates/*.html
+diff --git a/trunk/setup.py b/trunk/setup.py
+--- a/trunk/setup.py
++++ b/trunk/setup.py
+@@ -32,8 +32,7 @@
+     tests_require = test_deps,
+     packages=find_packages(exclude=['*.tests']),
+     package_data={
+-        'tracrpc': ['templates/*.html', 'htdocs/js/*.js', \
+-                    'htdocs/css/*.css']
++        'tracrpc': ['templates/*.html', 'htdocs/*.js', 'htdocs/*.css']
+         },
+     entry_points={
+         'trac.plugins': 'TracXMLRPC = tracrpc'
+diff --git a/trunk/tracrpc/api.py b/trunk/tracrpc/api.py
+--- a/trunk/tracrpc/api.py
++++ b/trunk/tracrpc/api.py
+@@ -336,4 +336,4 @@
+         indicate API breaking changes, while minor version changes are simple
+         additions, bug fixes, etc. """
+         import tracrpc
+-        return map(int, tracrpc.__version__.split('.'))
++        return map(int, tracrpc.__version__.split('-')[0].split('.'))
+diff --git a/trunk/tracrpc/htdocs/css/rpc.css b/trunk/tracrpc/htdocs/rpc.css
+rename from trunk/tracrpc/htdocs/css/rpc.css
+rename to trunk/tracrpc/htdocs/rpc.css
+diff --git a/trunk/tracrpc/htdocs/js/rpc.js b/trunk/tracrpc/htdocs/rpc.js
+rename from trunk/tracrpc/htdocs/js/rpc.js
+rename to trunk/tracrpc/htdocs/rpc.js
+diff --git a/trunk/tracrpc/json_rpc.py b/trunk/tracrpc/json_rpc.py
+--- a/trunk/tracrpc/json_rpc.py
++++ b/trunk/tracrpc/json_rpc.py
+@@ -138,7 +138,6 @@
+         """ Parse JSON-RPC requests"""
+         if not json:
+             self.log.debug("RPC(json) call ignored (not available).")
+-            # TODO: Specify correponding error code
+             raise JsonProtocolException("Error: JSON-RPC not available.\n")
+         try:
+             data = json.load(req, cls=TracRpcJSONDecoder)
+@@ -189,7 +188,6 @@
+ 
+     def send_rpc_error(self, req, e):
+         """Send a JSON-RPC fault message back to the caller. """
+-        # TODO : Check error codes and RPC exceptions
+         rpcreq = req.rpc
+         r_id = rpcreq.get('id')
+         response = json.dumps(self._json_error(e, r_id=r_id), \
+diff --git a/trunk/tracrpc/web_ui.py b/trunk/tracrpc/web_ui.py
+--- a/trunk/tracrpc/web_ui.py
++++ b/trunk/tracrpc/web_ui.py
+@@ -7,7 +7,6 @@
+ """
+ 
+ import sys
+-from traceback import format_exc
+ from types import GeneratorType
+ 
+ from pkg_resources import resource_filename
+@@ -110,8 +109,8 @@
+                 raise Exception('%s: %s\n%s' % (method.name,
+                                                 str(e), out.getvalue()))
+         add_stylesheet(req, 'common/css/wiki.css')
+-        add_stylesheet(req, 'tracrpc/css/rpc.css')
+-        add_script(req, 'tracrpc/js/rpc.js')
++        add_stylesheet(req, 'tracrpc/rpc.css')
++        add_script(req, 'tracrpc/rpc.js')
+         return ('rpc.html', 
+                 {'rpc': {'functions': namespaces,
+                          'protocols': [p.rpc_info() + (list(p.rpc_match()),) \
+@@ -182,15 +181,9 @@
+ 
+     def _send_unknown_error(self, req, e):
+         """Last recourse if protocol cannot handle the RPC request | error"""
+-
+-        # TODO: This is the previous implementation. Please review.
+-#        self.log.error("Unhandled protocol error: %s" % to_unicode(e))
+-#        req.send_error(None, template='', content_type='text/plain',
+-#                status=500, env=None, data=to_unicode(e))
+-
+-        stackTrace = format_exc()
+         method_name = req.rpc and req.rpc.get('method') or '(undefined)'
+-        body = "Unhandled protocol error calling '%s'\n\n%s" % (method_name, stackTrace)
++        body = "Unhandled protocol error calling '%s': %s" % (
++                                        method_name, to_unicode(e))
+         req.send_error(None, template='', content_type='text/plain',
+                             env=None, data=body, status=HTTPInternalError.code)
+