Commit Graph

227 Commits

Author SHA1 Message Date
Jason Gerard DeRose
69acff450c New Param: removed more depreciated 'import ipa_types' 2009-01-14 12:00:47 -07:00
Jason Gerard DeRose
2b2e73e7df Removed depreciated code from frontend.py; frontend.py no longer imports ipa_types 2009-01-14 11:39:29 -07:00
Jason Gerard DeRose
9d091c98f1 Plugin.__init__() now checks that subclass hasn't defined attributes that conflict with the logger methods; added corresponding unit test 2008-12-21 19:34:32 -07:00
Jason Gerard DeRose
69041c3b1b Removed Plugin.name property and replaced with instance attribute created in Plugin.__init__() 2008-12-17 21:47:43 -07:00
Jason Gerard DeRose
29d680b211 Continued work on xmlrpc.dispatch() unit tests; fixed bug in Command.args_to_kw() 2008-11-25 13:52:40 -07:00
Jason Gerard DeRose
2db738e899 Some changes to make reading dubugging output easier 2008-11-24 10:09:30 -07:00
Jason Gerard DeRose
500b816681 Added unit test for Param.ispassword() method 2008-11-18 16:29:08 -07:00
Jason Gerard DeRose
4afee15d4b Calling 'passwd' command now prompts for password using textui.prompt_password() 2008-11-18 13:43:43 -07:00
Jason Gerard DeRose
8474bd01da Command.get_defaults() now returns param.default if param.type is a Bool 2008-11-17 18:50:30 -07:00
Jason Gerard DeRose
9de56d43f0 env plugin now subclasses from RemoteOrLocal 2008-11-14 21:58:39 -07:00
Jason Gerard DeRose
36737c2d91 Added frontend.LocalOrRemote command base class for commands like env 2008-11-14 21:29:46 -07:00
Jason Gerard DeRose
860d391f3e Change Param.__repr__() so it returns the exact expression that could create it; added unit test for Param.__repre__() 2008-11-13 22:16:04 -07:00
Jason Gerard DeRose
1f635269e8 Param.__repr__() now uses util.make_repr() 2008-11-13 21:17:33 -07:00
Jason Gerard DeRose
8ad5502354 Added util.make_repr() function; added corresponding unit tests 2008-11-13 21:07:47 -07:00
Jason Gerard DeRose
f04aaff97c output_for_cli signature is now output_for_cli(textui, result, *args, **options) 2008-11-12 09:55:11 -07:00
Jason Gerard DeRose
09161e399a Command.get_default() will now fill-in None for all missing non-required params 2008-11-12 01:47:37 -07:00
Jason Gerard DeRose
d76202fea3 API.env is now an Env instance rather than an Environment instance 2008-10-27 01:35:40 -06:00
Jason Gerard DeRose
603baf6b10 Fixed typos in tables in docstrings for Attribute and Method 2008-10-21 08:42:52 -06:00
Jason Gerard DeRose
461f547e6a Added docstring (with example) to frontend.Attribute class 2008-10-20 20:28:24 -06:00
Jason Gerard DeRose
c818fe1d2d Added docstring (with examples) to frontend.Method class 2008-10-20 19:57:02 -06:00
Jason Gerard DeRose
bb978e591b Fixed bug in DefaultFrom where impleied keys were using entire func_code.co_varnames instead of an approprate slice 2008-10-20 16:45:32 -06:00
Jason Gerard DeRose
5c5641e8c2 Added some more examples to Param docstrings 2008-10-18 00:16:22 -06:00
Jason Gerard DeRose
721982870e Removed generic Command.output_for_cli() method; CLI.run_interactive() now only calls output_for_cli() if it has been implemented 2008-10-17 21:05:03 -06:00
Jason Gerard DeRose
f1eb74e22c make-test now runs doctests also; fixed several broken doctests 2008-10-17 20:50:34 -06:00
Jason Gerard DeRose
8322138f38 Added new Param.flags attribute (set with flags=foo kwarg) 2008-10-17 19:34:26 -06:00
Jason Gerard DeRose
1480224724 Started roughing out user_add() using api.Backend.ldap; added Command.output_for_cli() to take care of formatting print output 2008-10-14 01:45:30 -06:00
Jason Gerard DeRose
446037fd60 Added Object.get_dn() method; added corresponding unit tests 2008-10-13 23:26:24 -06:00
Jason Gerard DeRose
2357360e2a Command.params are now sorted the same way as Object.params (make user-add prompt for first, last before login) 2008-10-13 21:53:03 -06:00
Jason Gerard DeRose
8674086b85 Param now takes cli_name kwarg that sets Param.cli_name attribute 2008-10-13 17:24:23 -06:00
Jason Gerard DeRose
887016e69d Base Command.execute() method now raises NotImplementedError; updated unit tests 2008-10-08 18:18:13 -06:00
Jason Gerard DeRose
b7fe92f44f Reorganized Command methods so it is easier to understand and added lots of docstrings 2008-10-08 18:01:22 -06:00
Jason Gerard DeRose
3ffbaac64c Backend.xmlrpc and simple-server.py now use the xmlrpc_marshal() and xmlrpc_unmarshal() functions respectively 2008-10-02 19:42:06 -06:00
Jason Gerard DeRose
ed3a5855f3 -m 2008-10-02 17:51:50 -06:00
Jason Gerard DeRose
993b9f4f63 Command.get_default() now only returns a defaults for required values 2008-10-02 17:46:48 -06:00
Jason Gerard DeRose
6000b6b5c6 Implemented basic Command.forward() method 2008-10-02 17:02:24 -06:00
Martin Nagy
afdc721038 Add support for environment variables, change tests accordingly 2008-09-29 17:45:14 -06:00
Jason Gerard DeRose
d77907d2d0 373: Replaced type_ optional arg to Param.__init__() with pure kw arg type; updated unit tests and related code 2008-09-27 01:30:39 +00:00
Jason Gerard DeRose
8901b9a837 372: Started work on docstring for Param class 2008-09-27 00:31:59 +00:00
Jason Gerard DeRose
031daabcc4 371: Added examples to parse_param_spec() docstring and changed syntax guide into a reStructuredText table 2008-09-26 23:41:51 +00:00
Jason Gerard DeRose
7bbd81d831 370: Added detailed examples to decstring for DefaultFrom class 2008-09-26 22:52:15 +00:00
Jason Gerard DeRose
aa45ec616a 369: Added Object.backend attribute used to associated it with a particular backend component 2008-09-26 02:43:11 +00:00
Jason Gerard DeRose
152f3089e1 363: Added Object.params_minus_pk instance attribute 2008-09-25 03:27:40 +00:00
Jason Gerard DeRose
023f612921 361: Implemented crud.Add.get_options() method; added corresponding unit tests 2008-09-25 02:13:16 +00:00
Jason Gerard DeRose
9f704e001d 360: Removed Method.get_options() default implementation; cleaned up unit tests for Method 2008-09-25 01:52:34 +00:00
Jason Gerard DeRose
54c97b4948 359: Added Object.primary_key instance attribute; added corresponding unit tests 2008-09-25 01:44:53 +00:00
Jason Gerard DeRose
4267422793 358: Cleaned up private methods in Object 2008-09-25 01:04:10 +00:00
Jason Gerard DeRose
4747563a80 356: Modified Method.get_options() to now pull from self.obj.params(); updated unit tests for Method.get_options() 2008-09-25 00:42:38 +00:00
Jason Gerard DeRose
79b33ad366 355: Object.set_api() now creates Object.params namespace by merging takes_params and properties together intelegintly 2008-09-25 00:00:58 +00:00
Jason Gerard DeRose
f531f7da81 354: Added NameSpace.__todict__() method that returns copy of NameSpace.__map; updated NameSpace unit test to also test __todict__() 2008-09-24 23:49:44 +00:00
Jason Gerard DeRose
be2e323bbf 353: The Object.parms instance attribute is now created in Object.set_api() instead of in Object.__init__() 2008-09-24 23:29:15 +00:00
Jason Gerard DeRose
c3b09b2116 352: Now removed Object.Property property and added in its place Object.properties instance attribute 2008-09-24 23:19:34 +00:00
Jason Gerard DeRose
3d6ab69b46 351: Removed Object.Method property and added in its place Object.methods instance attribute 2008-09-24 22:19:43 +00:00
Jason Gerard DeRose
e2a680d7c9 350: If Param default_from kwarg is callable but not a DefaltFrom instances, the instance is created implicity 2008-09-24 22:05:01 +00:00
Jason Gerard DeRose
755ea8d0c2 349: Improved clarity of local variables in Param.__init__() 2008-09-24 21:57:34 +00:00
Jason Gerard DeRose
250a01b5b7 348: If no keys are passed to DefaultFrom.__init__(), the keys from callback.func_code.co_varnames are used; updated DefaultFrom unit tests to test this usage 2008-09-24 21:46:37 +00:00
Jason Gerard DeRose
566d5ea02a 347: Added primary_key instance attribute to Param and corresponding kwarg; expanded unit tests for Param.__init__() 2008-09-24 21:29:15 +00:00
Jason Gerard DeRose
f8bb60f02d 344: Added Param.__clone__() method; added corresponding unit tests 2008-09-24 19:45:46 +00:00
Jason Gerard DeRose
a79434584e 343: create_param() function no longer parses the param spec itself but relies on Param.__init__() to do it 2008-09-24 18:44:43 +00:00
Jason Gerard DeRose
97f0310a4c 342: Added unit test that TypeError is raised when Param() is created with extra kw args 2008-09-24 18:33:25 +00:00
Jason Gerard DeRose
06d7fb42ec 341: Param now only takes type_=ipa_types.Unicode() as an optional positional arg, and the rest as pure kwargs 2008-09-24 18:27:14 +00:00
Jason Gerard DeRose
792bf7b1d0 340: Changed default for Param.required to True 2008-09-24 18:02:00 +00:00
Jason Gerard DeRose
11a07008b8 339: Added parse_param_spec() function and corresponding unit tests 2008-09-24 17:55:29 +00:00
Jason Gerard DeRose
744406958d 337: Some cleanup in Params; added docstrings for most all Param methods 2008-09-24 07:56:31 +00:00
Jason Gerard DeRose
fb57b91937 336: Param.__dispatch() now returns None for any in (None, '', u'', tuple(), []) regardless whether Param is multivalue 2008-09-24 07:05:43 +00:00
Jason Gerard DeRose
e63c462f31 335: If Command.__convert_scalar() is called with None, it now returns None instead of raising TypeError 2008-09-24 06:48:27 +00:00
Jason Gerard DeRose
4215da30ad 334: Renamed Command.__multivalue() helper method to Command.dispatch() 2008-09-24 06:36:48 +00:00
Jason Gerard DeRose
1125d420bd 333: Param.convert() now uses name Param.__multivalue() helper method as Param.normalize() 2008-09-24 06:35:19 +00:00
Jason Gerard DeRose
6bedb15674 332: Param.normalize() now returns None if multivalue and len() == 0 2008-09-24 06:25:12 +00:00
Jason Gerard DeRose
d56f4c643b 331: Param.normalize() no longer raises a TypeError when value in not a basestring 2008-09-24 06:11:46 +00:00
Jason Gerard DeRose
95abdcd714 330: Command.normalize() now normalizes all keys, not just keys in params 2008-09-24 05:49:30 +00:00
Jason Gerard DeRose
15b83ab1bf 329: Command.convert() now converts all keys, not just keys in params 2008-09-24 05:46:49 +00:00
Jason Gerard DeRose
126b31de55 328: Command.get_default() now returns defaults for all values not present, not just defaults that aren't None 2008-09-24 05:42:31 +00:00
Jason Gerard DeRose
eaf15d5a52 327: Improved formatting on show-api cli command 2008-09-24 05:35:40 +00:00
Jason Gerard DeRose
3bf2da5714 324: Removed 'smart_option_order' from Command.__public__; cli commands help, console, and show_plugins now override Command.run() instead of Command.__call__() 2008-09-24 03:10:35 +00:00
Jason Gerard DeRose
19bbc48eb6 323: Added Command.run() method that dispatches to execute() or forward(); added corresponding unit tests 2008-09-24 02:52:19 +00:00
Jason Gerard DeRose
81de10f176 319: Added new backend and tests.test_backend modules; added place-holder Backend class and corresponding unit tests 2008-09-24 00:12:35 +00:00
Jason Gerard DeRose
2842e85d88 317: Renamed public.py to frontend.py; renamed test_public.py to test_frontend.py 2008-09-23 23:51:03 +00:00