Michael Grünewald avatar Michael Grünewald committed 48a8d59

rename to xmlrpcdo

Comments (0)

Files changed (3)

 from setuptools import setup, find_packages
 
 setup(
-    name="xrf",
+    name="xmlrpcdo",
     version="0.1",
     # additional information
     author="Michael Gruenewald",
     author_email="mail@michaelgruenewald.eu",
-    description="Monticello repository synchronization tool",
-    long_description="xrf is a simple, self-explaining XML-RPC fiddler",
+    description="XML-RPC request fiddler",
+    long_description="xmlrpcdo is a simple, self-explaining XML-RPC request fiddler",
     license='License :: OSI Approved :: GPL License',
-    url="https://bitbucket.org/michaelgruenewald/mcs",
+    url="https://bitbucket.org/michaelgruenewald/xmlrpcdo",
     # technical stuff
     packages=find_packages(),
     entry_points=dict(
-        console_scripts=['xrf = xrf:main']
+        console_scripts=['xmlrpcdo = xmlrpcdo:main']
     )
 )
+#!/usr/bin/env python
+from __future__ import print_function
+import argparse
+import ast
+import operator
+import pprint
+import sys
+import traceback
+import xmlrpclib
+
+
+def literal_or_string(s):
+    try:
+        return ast.literal_eval(s)
+    except:
+        return s
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description="XML-RPC Fiddler",
+        fromfile_prefix_chars='@',
+        epilog="""Arguments may also be read from a file, specified with
+               @filename."""
+    )
+    parser.add_argument('url', help="base URL of the XML-RPC interface")
+    parser.add_argument('method', help="method name")
+    parser.add_argument(
+        'params', metavar='parameter', nargs='*',
+        help="parameter, will be interpreted as Python literal if possible")
+    parser.add_argument(
+        '-p', '--print', action='store_true',
+        help="just print, don't pretty-print")
+    parser.add_argument(
+        '--traceback', action='store_true',
+        help="print tracebacks for exceptions"
+    )
+    args = parser.parse_args()
+
+    try:
+        proxy = xmlrpclib.ServerProxy(args.url)
+        arguments = [literal_or_string(param) for param in args.params]
+        result = operator.attrgetter(args.method)(proxy)(*arguments)
+    except xmlrpclib.Fault as fault:
+        print("Fault {0.faultCode:d}: {0.faultString:s}".format(fault),
+              file=sys.stderr)
+        return fault.faultCode
+    except KeyboardInterrupt:
+        print("-- interrupted --", file=sys.stderr)
+        return 1
+    except Exception as exc:
+        if args.traceback:
+            traceback.print_exc()
+        else:
+            print(*traceback.format_exception_only(type(exc), exc),
+                  sep="", end="", file=sys.stderr)
+        return 1
+    else:
+        if args.print:
+            print(result)
+        else:
+            pprint.pprint(result)
+        return 0
+
+if __name__ == '__main__':
+    sys.exit(main())

xrf.py

-#!/usr/bin/env python
-from __future__ import print_function
-import argparse
-import ast
-import operator
-import pprint
-import sys
-import traceback
-import xmlrpclib
-
-
-def literal_or_string(s):
-    try:
-        return ast.literal_eval(s)
-    except:
-        return s
-
-
-def main():
-    parser = argparse.ArgumentParser(
-        description="XML-RPC Fiddler",
-        fromfile_prefix_chars='@',
-        epilog="""Arguments may also be read from a file, specified with
-               @filename."""
-    )
-    parser.add_argument('url', help="base URL of the XML-RPC interface")
-    parser.add_argument('method', help="method name")
-    parser.add_argument(
-        'params', metavar='parameter', nargs='*',
-        help="parameter, will be interpreted as Python literal if possible")
-    parser.add_argument(
-        '-p', '--print', action='store_true',
-        help="just print, don't pretty-print")
-    parser.add_argument(
-        '--traceback', action='store_true',
-        help="print tracebacks for exceptions"
-    )
-    args = parser.parse_args()
-
-    try:
-        proxy = xmlrpclib.ServerProxy(args.url)
-        arguments = [literal_or_string(param) for param in args.params]
-        result = operator.attrgetter(args.method)(proxy)(*arguments)
-    except xmlrpclib.Fault as fault:
-        print("Fault {0.faultCode:d}: {0.faultString:s}".format(fault),
-              file=sys.stderr)
-        return fault.faultCode
-    except KeyboardInterrupt:
-        print("-- interrupted --", file=sys.stderr)
-        return 1
-    except Exception as exc:
-        if args.traceback:
-            traceback.print_exc()
-        else:
-            print(*traceback.format_exception_only(type(exc), exc),
-                  sep="", end="", file=sys.stderr)
-        return 1
-    else:
-        if args.print:
-            print(result)
-        else:
-            pprint.pprint(result)
-        return 0
-
-if __name__ == '__main__':
-    sys.exit(main())
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.