diff options
| author | Antony Lesuisse <lesuisse@gmail.com> | 2014-05-29 18:33:04 +0200 |
|---|---|---|
| committer | Antony Lesuisse <lesuisse@gmail.com> | 2014-05-29 18:33:04 +0200 |
| commit | d4624fa826a5e9542782f2c53c8ba2c766d093bc (patch) | |
| tree | be214779eb6d1f17157aa48e72fbcbf95405e38b /openerpcommand/call.py | |
| parent | 045ecc603e67911a5390c812cb6b5b123d9c190e (diff) | |
[IMP] repository cleanup
- move packaging stuff to setup
- remove historical stuff
- remove oe, odoo-cmd-fme will be merged with the convered commands
- add an odoo.py script to run odo and boostrap it
- simplify README
- prepare to move documentation to the github wiki
Diffstat (limited to 'openerpcommand/call.py')
| -rw-r--r-- | openerpcommand/call.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/openerpcommand/call.py b/openerpcommand/call.py deleted file mode 100644 index b4f9e95075a..00000000000 --- a/openerpcommand/call.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -Call an arbitrary model's method. -""" -import ast -import os -import pprint -import sys -import time -import xmlrpclib - -import client - -class Call(client.Client): - """\ - Call an arbitrary model's method. - - Example: - > oe call res.users.read '[1, 3]' '[]' -u 1 -p admin - """ - # TODO The above docstring is completely borked in the - # --help message. - - command_name = 'call' - - def __init__(self, subparsers=None): - super(Call, self).__init__(subparsers) - self.parser.add_argument('call', metavar='MODEL.METHOD', - help='the model and the method to call, using the ' - '<model>.<method> format.') - self.parser.add_argument('args', metavar='ARGUMENT', - nargs='+', - help='the argument for the method call, must be ' - '`ast.literal_eval` compatible. Can be repeated.') - - def work(self): - try: - model, method = self.args.call.rsplit('.', 1) - except: - print "Invalid syntax `%s` must have the form <model>.<method>." - sys.exit(1) - args = tuple(map(ast.literal_eval, self.args.args)) if self.args.args else () - x = self.execute(model, method, *args) - pprint.pprint(x, indent=4) - |
