|
|
Patch Set 1 #
Total comments: 24
Patch Set 2 : Divide PYSON doc into ref and topic chapters #
Total comments: 20
Patch Set 3 : Add topics/pyson example content #
Total comments: 26
Patch Set 4 : New Patch #Patch Set 5 : Some more minor changes. #
Total comments: 29
Patch Set 6 : Overwork doc #Patch Set 7 : Fix headings #
Total comments: 28
Patch Set 8 : Please check for Not() if it follows the pattern... #
Total comments: 22
Patch Set 9 : add last suggestions #
Total comments: 20
Patch Set 10 : next versions #
Total comments: 5
Patch Set 11 : fix last issues #MessagesTotal messages: 25
http://codereview.appspot.com/975044/diff/1/2 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/1/2#newcode7 doc/topics/pyson.rst:7: Pyson is a domain specific language (DSL_) to parse Python strings which need It is not Python strings http://codereview.appspot.com/975044/diff/1/2#newcode8 doc/topics/pyson.rst:8: to be evaluated into a JavaScript Object Notation (JSON_) string. On client It is not only on client side. http://codereview.appspot.com/975044/diff/1/2#newcode8 doc/topics/pyson.rst:8: to be evaluated into a JavaScript Object Notation (JSON_) string. On client PYSON doesn't need to be evaluated into JSON. It is a possibility. And it is the default representation used in Tryton to communicate statements. http://codereview.appspot.com/975044/diff/1/2#newcode15 doc/topics/pyson.rst:15: The Pyson syntax is close to Scheme programming language and looks in I don't think it is good to talk about Scheme. http://codereview.appspot.com/975044/diff/1/2#newcode20 doc/topics/pyson.rst:20: where argument can be another Expression or a Python value of the following Not necessary a Python value it depends of the implementation language. http://codereview.appspot.com/975044/diff/1/2#newcode21 doc/topics/pyson.rst:21: data types: integer, long, nummeric, decimal, string, bool, list. numeric http://codereview.appspot.com/975044/diff/1/2#newcode21 doc/topics/pyson.rst:21: data types: integer, long, nummeric, decimal, string, bool, list. types are the jyson types. http://codereview.appspot.com/975044/diff/1/2#newcode25 doc/topics/pyson.rst:25: The PYSON encoder class inherits from json.JSONEncoder. See json_ module No need to talk about JSONEncoder here. http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, This is the technical explanation. I would prefer a usage explanation for the documentation.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/1/2 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 17:43:52, ced wrote: > This is the technical explanation. I would prefer a usage explanation for the > documentation. May you give me an example or just some keywords?
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/1/2 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 17:51:10, udono wrote: > On 2010/04/27 17:43:52, ced wrote: > > This is the technical explanation. I would prefer a usage explanation for the > > documentation. > May you give me an example or just some keywords? This statement will return the value of 'argument' if define in the context or the default value.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/1/2 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 17:56:32, ced wrote: > On 2010/04/27 17:51:10, udono wrote: > > On 2010/04/27 17:43:52, ced wrote: > > > This is the technical explanation. I would prefer a usage explanation for > the > > > documentation. > > May you give me an example or just some keywords? > > This statement will return the value of 'argument' if define in the context or > the default value. which context you mean? the tryton context dictionary or another context?
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/1/2 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 18:58:59, udono wrote: > On 2010/04/27 17:56:32, ced wrote: > > On 2010/04/27 17:51:10, udono wrote: > > > On 2010/04/27 17:43:52, ced wrote: > > > > This is the technical explanation. I would prefer a usage explanation for > > the > > > > documentation. > > > May you give me an example or just some keywords? > > > > This statement will return the value of 'argument' if define in the context or > > the default value. > which context you mean? the tryton context dictionary or another context? > The context to evaluate the statement.
Sign in to reply to this message.
Done all corrections and suggestions. Please review Patch set 2. Thanks Udo http://codereview.appspot.com/975044/diff/1/2 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/1/2#newcode7 doc/topics/pyson.rst:7: Pyson is a domain specific language (DSL_) to parse Python strings which need On 2010/04/27 17:43:52, ced wrote: > It is not Python strings Done. http://codereview.appspot.com/975044/diff/1/2#newcode8 doc/topics/pyson.rst:8: to be evaluated into a JavaScript Object Notation (JSON_) string. On client On 2010/04/27 17:43:52, ced wrote: > It is not only on client side. Done. http://codereview.appspot.com/975044/diff/1/2#newcode8 doc/topics/pyson.rst:8: to be evaluated into a JavaScript Object Notation (JSON_) string. On client On 2010/04/27 17:43:52, ced wrote: > PYSON doesn't need to be evaluated into JSON. It is a possibility. And it is the > default representation used in Tryton to communicate statements. Done. http://codereview.appspot.com/975044/diff/1/2#newcode15 doc/topics/pyson.rst:15: The Pyson syntax is close to Scheme programming language and looks in On 2010/04/27 17:43:52, ced wrote: > I don't think it is good to talk about Scheme. Done. http://codereview.appspot.com/975044/diff/1/2#newcode20 doc/topics/pyson.rst:20: where argument can be another Expression or a Python value of the following On 2010/04/27 17:43:52, ced wrote: > Not necessary a Python value it depends of the implementation language. Done. http://codereview.appspot.com/975044/diff/1/2#newcode21 doc/topics/pyson.rst:21: data types: integer, long, nummeric, decimal, string, bool, list. On 2010/04/27 17:43:52, ced wrote: > numeric Done. http://codereview.appspot.com/975044/diff/1/2#newcode21 doc/topics/pyson.rst:21: data types: integer, long, nummeric, decimal, string, bool, list. On 2010/04/27 17:43:52, ced wrote: > types are the jyson types. Done. http://codereview.appspot.com/975044/diff/1/2#newcode25 doc/topics/pyson.rst:25: The PYSON encoder class inherits from json.JSONEncoder. See json_ module On 2010/04/27 17:43:52, ced wrote: > No need to talk about JSONEncoder here. Done. http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 17:43:52, ced wrote: > This is the technical explanation. I would prefer a usage explanation for the > documentation. Done. http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 17:56:32, ced wrote: > On 2010/04/27 17:51:10, udono wrote: > > On 2010/04/27 17:43:52, ced wrote: > > > This is the technical explanation. I would prefer a usage explanation for > the > > > documentation. > > May you give me an example or just some keywords? > > This statement will return the value of 'argument' if define in the context or > the default value. > Done. http://codereview.appspot.com/975044/diff/1/2#newcode54 doc/topics/pyson.rst:54: Returns a JSON dictionary with key ``'__class__'`` with value ``'Eval'``, On 2010/04/27 19:20:44, ced wrote: > On 2010/04/27 18:58:59, udono wrote: > > On 2010/04/27 17:56:32, ced wrote: > > > On 2010/04/27 17:51:10, udono wrote: > > > > On 2010/04/27 17:43:52, ced wrote: > > > > > This is the technical explanation. I would prefer a usage explanation > for > > > the > > > > > documentation. > > > > May you give me an example or just some keywords? > > > > > > This statement will return the value of 'argument' if define in the context > or > > > the default value. > > which context you mean? the tryton context dictionary or another context? > > > > The context to evaluate the statement. Don't know if it is right now. See patch set 2
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/7001/8001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/7001/8001#newcode1 doc/ref/pyson.rst:1: .. _ref-pyson: .. module:: trytond.pyson http://codereview.appspot.com/975044/diff/7001/8001#newcode7 doc/ref/pyson.rst:7: .. class:: PYSONEncoder .. class:: PYSONEncoder() http://codereview.appspot.com/975044/diff/7001/8001#newcode9 doc/ref/pyson.rst:9: The PYSON encoder class inherits from json.JSONEncoder. See json_ module I think it is better to explain the usage of PYSONEncoder: PYSONEncoder().encode() http://codereview.appspot.com/975044/diff/7001/8001#newcode16 doc/ref/pyson.rst:16: .. method:: default(object) No need to document this method. http://codereview.appspot.com/975044/diff/7001/8001#newcode31 doc/ref/pyson.rst:31: Missing Eval, And, Or etc. http://codereview.appspot.com/975044/diff/7001/8002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/7001/8002#newcode7 doc/topics/pyson.rst:7: PYSON is a domain specific language (DSL_) for statements which need to be Why not: ... is a `domain specific language`_ http://codereview.appspot.com/975044/diff/7001/8002#newcode8 doc/topics/pyson.rst:8: evaluated. It is the default representation of statements in Tryton, evaluated independently of the programming language. http://codereview.appspot.com/975044/diff/7001/8002#newcode8 doc/topics/pyson.rst:8: evaluated. It is the default representation of statements in Tryton, It is not default as it is the only one. http://codereview.appspot.com/975044/diff/7001/8002#newcode9 doc/topics/pyson.rst:9: which control field attributes like Fields.domain, Fields.states I don't think it is the right place to talk about domain, states etc. http://codereview.appspot.com/975044/diff/7001/8002#newcode13 doc/topics/pyson.rst:13: JavaScript Object Notation (JSON_), which is standardize by the IETF_. PYSON is not in JSON, it uses it but it is internal. http://codereview.appspot.com/975044/diff/7001/8002#newcode29 doc/topics/pyson.rst:29: false null true. I think we mix stuff here. There is the PYSON python module in trytond and there is a communication language to transfer PYSON statement. http://codereview.appspot.com/975044/diff/7001/8002#newcode32 doc/topics/pyson.rst:32: PYSON Statements Should go into ref http://codereview.appspot.com/975044/diff/7001/8002#newcode37 doc/topics/pyson.rst:37: in the context dictionary or the ``default`` value. context is not necessary a dictionary it is the context of the PYSONDecoder
Sign in to reply to this message.
Hi, I have uploaded the overworked topics/pyson.rst, including the provided ideas and corrections. Thanks a lot for review. Cheers Udo http://codereview.appspot.com/975044/diff/7001/8002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/7001/8002#newcode7 doc/topics/pyson.rst:7: PYSON is a domain specific language (DSL_) for statements which need to be On 2010/04/27 22:27:59, ced wrote: > Why not: > > ... is a `domain specific language`_ Done. http://codereview.appspot.com/975044/diff/7001/8002#newcode8 doc/topics/pyson.rst:8: evaluated. It is the default representation of statements in Tryton, On 2010/04/27 22:27:59, ced wrote: > evaluated independently of the programming language. Done. http://codereview.appspot.com/975044/diff/7001/8002#newcode9 doc/topics/pyson.rst:9: which control field attributes like Fields.domain, Fields.states On 2010/04/27 22:27:59, ced wrote: > I don't think it is the right place to talk about domain, states etc. Done. http://codereview.appspot.com/975044/diff/7001/8002#newcode13 doc/topics/pyson.rst:13: JavaScript Object Notation (JSON_), which is standardize by the IETF_. On 2010/04/27 22:27:59, ced wrote: > PYSON is not in JSON, it uses it but it is internal. Done. http://codereview.appspot.com/975044/diff/7001/8002#newcode29 doc/topics/pyson.rst:29: false null true. On 2010/04/27 22:27:59, ced wrote: > I think we mix stuff here. > There is the PYSON python module in trytond and there is a communication > language to transfer PYSON statement. Hopefully Done. http://codereview.appspot.com/975044/diff/7001/8002#newcode32 doc/topics/pyson.rst:32: PYSON Statements On 2010/04/27 22:27:59, ced wrote: > Should go into ref Done. http://codereview.appspot.com/975044/diff/7001/8002#newcode37 doc/topics/pyson.rst:37: in the context dictionary or the ``default`` value. On 2010/04/27 22:27:59, ced wrote: > context is not necessary a dictionary > it is the context of the PYSONDecoder Done.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/15001/16001 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/15001/16001#newcode7 doc/topics/pyson.rst:7: PYSON is the *PY* thon *S* tatement and *O* bject *N* otation. It is a The *PY* thon ... syntax is not really readable. http://codereview.appspot.com/975044/diff/15001/16001#newcode12 doc/topics/pyson.rst:12: between trytond and any clients. clients -> third-party software. http://codereview.appspot.com/975044/diff/15001/16001#newcode14 doc/topics/pyson.rst:14: Tryton server and client have an implementation of the PYSON parser for I don't think it is useful to say that of course tryton has PYSON otherwise there will be not documentation. http://codereview.appspot.com/975044/diff/15001/16001#newcode15 doc/topics/pyson.rst:15: Python language included. Look at ``trytond/trytond/pyson.py`` for the It should be a link to ref http://codereview.appspot.com/975044/diff/15001/16001#newcode16 doc/topics/pyson.rst:16: implementation. A similar PYSON parser can easily implemented Any PYSON parser can easily... http://codereview.appspot.com/975044/diff/15001/16001#newcode17 doc/topics/pyson.rst:17: into other programming languages. So clients do not need to depend on clients -> third-party software http://codereview.appspot.com/975044/diff/15001/16001#newcode25 doc/topics/pyson.rst:25: The syntax of a PYSON statements are in general following this pattern: It is not 'in general', it is http://codereview.appspot.com/975044/diff/15001/16001#newcode30 doc/topics/pyson.rst:30: `JSON data types <http://tools.ietf.org/html/rfc4627#section-2.1>`_: I prefer to have url in comment. http://codereview.appspot.com/975044/diff/15001/16001#newcode31 doc/topics/pyson.rst:31: object, array, number or string, or one of the following names: Those types are not right because they depends of the programing language. http://codereview.appspot.com/975044/diff/15001/16001#newcode35 doc/topics/pyson.rst:35: of a PYSON statement is always a string or True, False or None. This is false, the result can be anything. http://codereview.appspot.com/975044/diff/15001/16001#newcode41 doc/topics/pyson.rst:41: If you want to express PYSON statements you need to import all used This is really to childly. It is the basic of Python programing. http://codereview.appspot.com/975044/diff/15001/16001#newcode51 doc/topics/pyson.rst:51: ``Eval()`` checks the local context for the variable ``active_id`` It is not the local context, it is the evaluation context. http://codereview.appspot.com/975044/diff/15001/16001#newcode87 doc/topics/pyson.rst:87: In this example the result is determined by a if-then-else condition. http://en.wikipedia.org/wiki/Conditional_statement#If-Then.28-Else.29
Sign in to reply to this message.
New patch uploaded. Please review. http://codereview.appspot.com/975044/diff/15001/16001 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/15001/16001#newcode7 doc/topics/pyson.rst:7: PYSON is the *PY* thon *S* tatement and *O* bject *N* otation. It is a On 2010/04/28 18:11:19, ced wrote: > The *PY* thon ... syntax is not really readable. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode12 doc/topics/pyson.rst:12: between trytond and any clients. On 2010/04/28 18:11:19, ced wrote: > clients -> third-party software. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode14 doc/topics/pyson.rst:14: Tryton server and client have an implementation of the PYSON parser for On 2010/04/28 18:11:19, ced wrote: > I don't think it is useful to say that of course tryton has PYSON otherwise > there will be not documentation. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode15 doc/topics/pyson.rst:15: Python language included. Look at ``trytond/trytond/pyson.py`` for the On 2010/04/28 18:11:19, ced wrote: > It should be a link to ref Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode16 doc/topics/pyson.rst:16: implementation. A similar PYSON parser can easily implemented On 2010/04/28 18:11:19, ced wrote: > Any PYSON parser can easily... Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode17 doc/topics/pyson.rst:17: into other programming languages. So clients do not need to depend on On 2010/04/28 18:11:19, ced wrote: > clients -> third-party software Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode25 doc/topics/pyson.rst:25: The syntax of a PYSON statements are in general following this pattern: On 2010/04/28 18:11:19, ced wrote: > It is not 'in general', it is Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode30 doc/topics/pyson.rst:30: `JSON data types <http://tools.ietf.org/html/rfc4627#section-2.1>`_: On 2010/04/28 18:11:19, ced wrote: > I prefer to have url in comment. > Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode31 doc/topics/pyson.rst:31: object, array, number or string, or one of the following names: On 2010/04/28 18:11:19, ced wrote: > Those types are not right because they depends of the programing language. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode35 doc/topics/pyson.rst:35: of a PYSON statement is always a string or True, False or None. On 2010/04/28 18:11:19, ced wrote: > This is false, the result can be anything. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode41 doc/topics/pyson.rst:41: If you want to express PYSON statements you need to import all used On 2010/04/28 18:11:19, ced wrote: > This is really to childly. > It is the basic of Python programing. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode51 doc/topics/pyson.rst:51: ``Eval()`` checks the local context for the variable ``active_id`` On 2010/04/28 18:11:19, ced wrote: > It is not the local context, it is the evaluation context. Done. http://codereview.appspot.com/975044/diff/15001/16001#newcode87 doc/topics/pyson.rst:87: In this example the result is determined by a if-then-else condition. On 2010/04/28 18:11:19, ced wrote: > http://en.wikipedia.org/wiki/Conditional_statement#If-Then.28-Else.29 Done.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/18002/19001 File doc/ref/models/pyson.rst (right): http://codereview.appspot.com/975044/diff/18002/19001#newcode1 doc/ref/models/pyson.rst:1: .. _ref-models-pyson: not in models http://codereview.appspot.com/975044/diff/18002/19001#newcode10 doc/ref/models/pyson.rst:10: How to document this? Base class of any PYSON statement. It could not be used directly. http://codereview.appspot.com/975044/diff/18002/19001#newcode16 doc/ref/models/pyson.rst:16: How to document this? Method that return the dictionary representation of the statement. http://codereview.appspot.com/975044/diff/18002/19001#newcode20 doc/ref/models/pyson.rst:20: How to document this? Return all possible type that the statement can become when evaluated. http://codereview.appspot.com/975044/diff/18002/19001#newcode22 doc/ref/models/pyson.rst:22: .. method:: PYSON.eval() it is a classmethod and have this definition eval(dct, context) http://codereview.appspot.com/975044/diff/18002/19001#newcode24 doc/ref/models/pyson.rst:24: How to document this? Return the evaluation of the statement with the context. http://codereview.appspot.com/975044/diff/18002/19001#newcode30 doc/ref/models/pyson.rst:30: .. class:: PYSONEncoder Encoder of pyson statement into string representation http://codereview.appspot.com/975044/diff/18002/19001#newcode32 doc/ref/models/pyson.rst:32: The PYSON encoder class inherits from json.JSONEncoder. For more No need to talk about inherits. http://codereview.appspot.com/975044/diff/18002/19001#newcode47 doc/ref/models/pyson.rst:47: Returns a JSON string representation of a given PYSON statement. Not talk about JSON http://codereview.appspot.com/975044/diff/18002/19001#newcode53 doc/ref/models/pyson.rst:53: The following operators are implemented in PYSON. operators => statement http://codereview.appspot.com/975044/diff/18002/19001#newcode59 doc/ref/models/pyson.rst:59: .. class:: Eval Eval(value, [default]) http://codereview.appspot.com/975044/diff/18002/19001#newcode65 doc/ref/models/pyson.rst:65: .. attribute:: Eval._value Don't document internal attribute. http://codereview.appspot.com/975044/diff/18002/19001#newcode75 doc/ref/models/pyson.rst:75: .. method:: Eval.pyson() No need to talk about those method as they are describe above. http://codereview.appspot.com/975044/diff/18002/19001#newcode92 doc/ref/models/pyson.rst:92: .. class:: Not Not(value) http://codereview.appspot.com/975044/diff/18002/19002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/18002/19002#newcode9 doc/topics/pyson.rst:9: of statements in the Tryton application framework. PYSON is an I don't find good to always refer to Tryton. It is the Tryton doc so every thing here is "in Tryton application..." http://codereview.appspot.com/975044/diff/18002/19002#newcode10 doc/topics/pyson.rst:10: intermediate language. It is used to express statements which can be Why intermediate? http://codereview.appspot.com/975044/diff/18002/19002#newcode23 doc/topics/pyson.rst:23: You could also add that the statements are determinism and never fails to be evaluated due to check of values passed to each statements.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/18002/19001 File doc/ref/models/pyson.rst (right): http://codereview.appspot.com/975044/diff/18002/19001#newcode1 doc/ref/models/pyson.rst:1: .. _ref-models-pyson: On 2010/04/29 18:50:22, ced wrote: > not in models Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode16 doc/ref/models/pyson.rst:16: How to document this? On 2010/04/29 18:50:22, ced wrote: > Method that return the dictionary representation of the statement. Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode20 doc/ref/models/pyson.rst:20: How to document this? On 2010/04/29 18:50:22, ced wrote: > Return all possible type that the statement can become when evaluated. Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode22 doc/ref/models/pyson.rst:22: .. method:: PYSON.eval() On 2010/04/29 18:50:22, ced wrote: > it is a classmethod > and have this definition eval(dct, context) Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode24 doc/ref/models/pyson.rst:24: How to document this? On 2010/04/29 18:50:22, ced wrote: > Return the evaluation of the statement with the context. Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode30 doc/ref/models/pyson.rst:30: .. class:: PYSONEncoder On 2010/04/29 18:50:22, ced wrote: > Encoder of pyson statement into string representation Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode32 doc/ref/models/pyson.rst:32: The PYSON encoder class inherits from json.JSONEncoder. For more On 2010/04/29 18:50:22, ced wrote: > No need to talk about inherits. Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode47 doc/ref/models/pyson.rst:47: Returns a JSON string representation of a given PYSON statement. On 2010/04/29 18:50:22, ced wrote: > Not talk about JSON Done. http://codereview.appspot.com/975044/diff/18002/19001#newcode53 doc/ref/models/pyson.rst:53: The following operators are implemented in PYSON. On 2010/04/29 18:50:22, ced wrote: > operators => statement Done. http://codereview.appspot.com/975044/diff/18002/19002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/18002/19002#newcode10 doc/topics/pyson.rst:10: intermediate language. It is used to express statements which can be On 2010/04/29 18:50:22, ced wrote: > Why intermediate? Hmm, good question. Maybe because it handles statements from third party and translate them to python statements. But when following this thought, Python is also an intermediate language to handle bytecode... bytecode is intermediate to machine code... on the end its moving quarks... So it is intermediate but not worth a word, because everything in this area is 'intermediate'. Removed. http://codereview.appspot.com/975044/diff/18002/19002#newcode23 doc/topics/pyson.rst:23: On 2010/04/29 18:50:22, ced wrote: > You could also add that the statements are determinism Do you mean http://en.wikipedia.org/wiki/Deterministic_algorithm >and never fails to be > evaluated due to check of values passed to each statements. Done.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/18002/19002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/18002/19002#newcode23 doc/topics/pyson.rst:23: On 2010/04/30 17:16:45, udono wrote: > On 2010/04/29 18:50:22, ced wrote: > > You could also add that the statements are determinism > Do you mean http://en.wikipedia.org/wiki/Deterministic_algorithm Yes.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/21002/25001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/21002/25001#newcode19 doc/ref/pyson.rst:19: Method that returns the dictionary representation of the statement. ... the internal dictionary representation ... http://codereview.appspot.com/975044/diff/21002/25001#newcode23 doc/ref/pyson.rst:23: Method that returns all possible types which the statement can become ... returns a set of all possible types ... http://codereview.appspot.com/975044/diff/21002/25001#newcode23 doc/ref/pyson.rst:23: Method that returns all possible types which the statement can become ... which the statement can return when evaluated. http://codereview.appspot.com/975044/diff/21002/25001#newcode29 doc/ref/pyson.rst:29: :attr:`eval.dct` within the :attr:`eval.context`. dct and context are not attr http://codereview.appspot.com/975044/diff/21002/25001#newcode29 doc/ref/pyson.rst:29: :attr:`eval.dct` within the :attr:`eval.context`. Must says that ``dct`` is the internal representation of a statement and ``context`` is a dictionary with contextual values. http://codereview.appspot.com/975044/diff/21002/25001#newcode31 doc/ref/pyson.rst:31: Attributes: There is no attributes http://codereview.appspot.com/975044/diff/21002/25001#newcode55 doc/ref/pyson.rst:55: Attribute: There is no attribute or at least no one that must appear in doc. http://codereview.appspot.com/975044/diff/21002/25001#newcode65 doc/ref/pyson.rst:65: The following statements are implemented in :class:`PYSON`. I don't understand this. PYSON doesn't implement nothing. http://codereview.appspot.com/975044/diff/21002/25001#newcode76 doc/ref/pyson.rst:76: .. class:: Eval(value[, default]) I will use this kind of description: An evaluation statement. When evaluated, it will return the value of the variable named by ``value`` if defined in the evaluation context otherwise the ``default`` value (empty string by default). ``value`` can use dot notation to access objects value in context . http://codereview.appspot.com/975044/diff/21002/25001#newcode78 doc/ref/pyson.rst:78: Returns :attr:`Eval.value` if defined in the evaluation context, class doesn't return anything except just an instance of itself. http://codereview.appspot.com/975044/diff/21002/25001#newcode81 doc/ref/pyson.rst:81: Class attributes: Doesn't contain any attribute and it will be the same for all others classes.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/21002/25002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/21002/25002#newcode7 doc/topics/pyson.rst:7: PYSON is the Python statement and object notation. It is a You can put capital letters for the PYSON acronym. http://codereview.appspot.com/975044/diff/21002/25002#newcode17 doc/topics/pyson.rst:17: evaluated. All values passed in a statement are checked before used. ... will always succeed to evaluate statements. http://codereview.appspot.com/975044/diff/21002/25002#newcode17 doc/topics/pyson.rst:17: evaluated. All values passed in a statement are checked before used. All values passed ... This is not really that they are checked, but more that there is a default behavior for unknown values.
Sign in to reply to this message.
Fix all issues, but having some questions... Please review. Thanks! http://codereview.appspot.com/975044/diff/21002/25001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/21002/25001#newcode19 doc/ref/pyson.rst:19: Method that returns the dictionary representation of the statement. On 2010/05/02 08:02:25, ced wrote: > ... the internal dictionary representation ... Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode23 doc/ref/pyson.rst:23: Method that returns all possible types which the statement can become On 2010/05/02 08:02:25, ced wrote: > ... returns a set of all possible types ... Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode23 doc/ref/pyson.rst:23: Method that returns all possible types which the statement can become On 2010/05/02 08:02:25, ced wrote: > ... which the statement can return when evaluated. Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode29 doc/ref/pyson.rst:29: :attr:`eval.dct` within the :attr:`eval.context`. On 2010/05/02 08:02:25, ced wrote: > dct and context are not attr Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode29 doc/ref/pyson.rst:29: :attr:`eval.dct` within the :attr:`eval.context`. On 2010/05/02 08:02:25, ced wrote: > Must says that ``dct`` is the internal representation of a statement and > ``context`` is a dictionary with contextual values. Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode31 doc/ref/pyson.rst:31: Attributes: On 2010/05/02 08:02:25, ced wrote: > There is no attributes Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode55 doc/ref/pyson.rst:55: Attribute: On 2010/05/02 08:02:25, ced wrote: > There is no attribute or at least no one that must appear in doc. Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode65 doc/ref/pyson.rst:65: The following statements are implemented in :class:`PYSON`. On 2010/05/02 08:02:25, ced wrote: > I don't understand this. > PYSON doesn't implement nothing. Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode76 doc/ref/pyson.rst:76: .. class:: Eval(value[, default]) On 2010/05/02 08:02:25, ced wrote: > I will use this kind of description: > > An evaluation statement. > When evaluated, it will return the value of the variable named by ``value`` if > defined in the evaluation context otherwise the ``default`` value (empty string > by default). > > ``value`` can use dot notation to access objects value in context . Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode78 doc/ref/pyson.rst:78: Returns :attr:`Eval.value` if defined in the evaluation context, On 2010/05/02 08:02:25, ced wrote: > class doesn't return anything except just an instance of itself. Done. http://codereview.appspot.com/975044/diff/21002/25001#newcode81 doc/ref/pyson.rst:81: Class attributes: On 2010/05/02 08:02:25, ced wrote: > Doesn't contain any attribute and it will be the same for all others classes. Done. http://codereview.appspot.com/975044/diff/21002/25002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/21002/25002#newcode7 doc/topics/pyson.rst:7: PYSON is the Python statement and object notation. It is a On 2010/05/02 08:09:12, ced wrote: > You can put capital letters for the PYSON acronym. Done. http://codereview.appspot.com/975044/diff/21002/25002#newcode17 doc/topics/pyson.rst:17: evaluated. All values passed in a statement are checked before used. On 2010/05/02 08:09:12, ced wrote: > ... will always succeed to evaluate statements. Done. http://codereview.appspot.com/975044/diff/21002/25002#newcode17 doc/topics/pyson.rst:17: evaluated. All values passed in a statement are checked before used. On 2010/05/02 08:09:12, ced wrote: > All values passed ... > This is not really that they are checked, but more that there is a default > behavior for unknown values. Done. http://codereview.appspot.com/975044/diff/31001/32001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/31001/32001#newcode77 doc/ref/pyson.rst:77: --- ``value`` can use the dot notation to access objects values in the context. Does this apply also here and to the other statements
Sign in to reply to this message.
Thx! You only write about PYSONEncoder, nothing about Decoder, is this by design? http://codereview.appspot.com/975044/diff/31001/32001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/31001/32001#newcode316 doc/ref/pyson.rst:316: :attr:`day` are defaulted from datetime.date.today(). take their defaults from http://codereview.appspot.com/975044/diff/31001/32001#newcode360 doc/ref/pyson.rst:360: :attr:`DateTime.microseconds` are defaulted to s. above http://codereview.appspot.com/975044/diff/31001/32002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/31001/32002#newcode9 doc/topics/pyson.rst:9: of statements. PYSON is used to express statements which can be to encode http://codereview.appspot.com/975044/diff/31001/32002#newcode10 doc/topics/pyson.rst:10: evaluated in different programming languages, for the serving for the communication http://codereview.appspot.com/975044/diff/31001/32002#newcode12 doc/topics/pyson.rst:12: A PYSON parser can easily implemented into other programming languages. can easily be implemented in other programming languages http://codereview.appspot.com/975044/diff/31001/32002#newcode13 doc/topics/pyson.rst:13: So third party software do not need to depend on Python to be able to softwares http://codereview.appspot.com/975044/diff/31001/32002#newcode17 doc/topics/pyson.rst:17: succeed to evaluate statemets. There is a default behavior for statements http://codereview.appspot.com/975044/diff/31001/32002#newcode67 doc/topics/pyson.rst:67: evaluated by a logical *or* operator. The first expression part is *OR* ? http://codereview.appspot.com/975044/diff/31001/32002#newcode79 doc/topics/pyson.rst:79: In this example the result is determined by a `if-then-else`_ condition. by an ? http://codereview.appspot.com/975044/diff/31001/32002#newcode81 doc/topics/pyson.rst:81: the string ``'company'`` is in the dictionary ``context``, returns the key ``'company'`` ?
Sign in to reply to this message.
Thanks for review. http://codereview.appspot.com/975044/diff/31001/32001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/31001/32001#newcode316 doc/ref/pyson.rst:316: :attr:`day` are defaulted from datetime.date.today(). On 2010/05/03 10:00:57, yangoon wrote: > take their defaults from Done. http://codereview.appspot.com/975044/diff/31001/32001#newcode360 doc/ref/pyson.rst:360: :attr:`DateTime.microseconds` are defaulted to On 2010/05/03 10:00:57, yangoon wrote: > s. above Done. http://codereview.appspot.com/975044/diff/31001/32002 File doc/topics/pyson.rst (right): http://codereview.appspot.com/975044/diff/31001/32002#newcode9 doc/topics/pyson.rst:9: of statements. PYSON is used to express statements which can be On 2010/05/03 10:00:57, yangoon wrote: > to encode Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode10 doc/topics/pyson.rst:10: evaluated in different programming languages, for the On 2010/05/03 10:00:57, yangoon wrote: > serving for the communication Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode12 doc/topics/pyson.rst:12: A PYSON parser can easily implemented into other programming languages. On 2010/05/03 10:00:57, yangoon wrote: > can easily be implemented in other programming languages Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode13 doc/topics/pyson.rst:13: So third party software do not need to depend on Python to be able to On 2010/05/03 10:00:57, yangoon wrote: > softwares Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode17 doc/topics/pyson.rst:17: succeed to evaluate statemets. There is a default behavior for On 2010/05/03 10:00:57, yangoon wrote: > statements Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode67 doc/topics/pyson.rst:67: evaluated by a logical *or* operator. The first expression part is On 2010/05/03 10:00:57, yangoon wrote: > *OR* ? Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode79 doc/topics/pyson.rst:79: In this example the result is determined by a `if-then-else`_ condition. On 2010/05/03 10:00:57, yangoon wrote: > by an ? Done. http://codereview.appspot.com/975044/diff/31001/32002#newcode81 doc/topics/pyson.rst:81: the string ``'company'`` is in the dictionary ``context``, returns On 2010/05/03 10:00:57, yangoon wrote: > the key ``'company'`` ? Done.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/31001/32001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/31001/32001#newcode77 doc/ref/pyson.rst:77: --- On 2010/05/02 08:51:13, udono wrote: > ``value`` can use the dot notation to access objects values in the context. > > Does this apply also here and to the other statements Not it is only on Eval() http://codereview.appspot.com/975044/diff/36001/37001#newcode96 doc/ref/pyson.rst:96: .. class:: Bool(value) Could you put the class definition before the description? http://codereview.appspot.com/975044/diff/36001/37001#newcode99 doc/ref/pyson.rst:99: nemed -> named variable -> statement http://codereview.appspot.com/975044/diff/36001/37001#newcode132 doc/ref/pyson.rst:132: statement1 http://codereview.appspot.com/975044/diff/36001/37001#newcode151 doc/ref/pyson.rst:151: variable http://codereview.appspot.com/975044/diff/36001/37001#newcode169 doc/ref/pyson.rst:169: A :class:`Greater` object represents the PYSON ``Greater()`` variable http://codereview.appspot.com/975044/diff/36001/37001#newcode184 doc/ref/pyson.rst:184: ``condition`` http://codereview.appspot.com/975044/diff/36001/37001#newcode219 doc/ref/pyson.rst:219: for date ... http://codereview.appspot.com/975044/diff/36001/37001#newcode220 doc/ref/pyson.rst:220: .. attribute:: Less.equal a date object It is not linked to Python http://codereview.appspot.com/975044/diff/36001/37001#newcode223 doc/ref/pyson.rst:223: *less than or equal* operation is used for comparison, defaults from today Not linked to Python http://codereview.appspot.com/975044/diff/36001/37001#newcode263 doc/ref/pyson.rst:263: default from now
Sign in to reply to this message.
@yangoon: > You only write about PYSONEncoder, nothing about Decoder, > is this by design? Add decoder. thx. http://codereview.appspot.com/975044/diff/36001/37001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/36001/37001#newcode96 doc/ref/pyson.rst:96: .. class:: Bool(value) On 2010/05/03 18:28:39, ced wrote: > Could you put the class definition before the description? Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode99 doc/ref/pyson.rst:99: representation of the value of the variable nemed by On 2010/05/03 18:28:39, ced wrote: > nemed -> named > variable -> statement Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode132 doc/ref/pyson.rst:132: .. class:: Equal(statemant1, statement2) On 2010/05/03 18:28:39, ced wrote: > statement1 Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode151 doc/ref/pyson.rst:151: Is the value of the vaiable named by ``equal`` is true, then On 2010/05/03 18:28:39, ced wrote: > variable Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode169 doc/ref/pyson.rst:169: Is the value of the vaiable named ``equal`` is true, then On 2010/05/03 18:28:39, ced wrote: > variable Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode184 doc/ref/pyson.rst:184: ``If.condition`` evaluates true. Otherwise returns the value of the On 2010/05/03 18:28:39, ced wrote: > ``condition`` Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode219 doc/ref/pyson.rst:219: Operator fo Date representation and basic calculation. On 2010/05/03 18:28:39, ced wrote: > for date ... Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode220 doc/ref/pyson.rst:220: Returns a datetime.date object which represents On 2010/05/03 18:28:39, ced wrote: > a date object > > It is not linked to Python Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode223 doc/ref/pyson.rst:223: ``day`` take their defaults from datetime.date.today(). On 2010/05/03 18:28:39, ced wrote: > defaults from today > Not linked to Python Done. http://codereview.appspot.com/975044/diff/36001/37001#newcode263 doc/ref/pyson.rst:263: default from ``datetime.date.today()`` and On 2010/05/03 18:28:39, ced wrote: > default from now Done.
Sign in to reply to this message.
http://codereview.appspot.com/975044/diff/42001/43001 File doc/ref/pyson.rst (right): http://codereview.appspot.com/975044/diff/42001/43001#newcode41 doc/ref/pyson.rst:41: Encoder for PYSON statements into string representations. In other doc, we don't indent description under class http://codereview.appspot.com/975044/diff/42001/43001#newcode68 doc/ref/pyson.rst:68: .. class:: pyson.Eval(value[, default]) We are under the module trytond.pyson so class definition must be: .. class:: Eval(value, [default]) http://codereview.appspot.com/975044/diff/42001/43001#newcode118 doc/ref/pyson.rst:118: .. class:: pyson.Greater(statement1, statement2[, equal]) I start to use: .. class:: Greater(statement1, statement2, [equal]) http://codereview.appspot.com/975044/diff/42001/43001#newcode155 doc/ref/pyson.rst:155: A :class:`pason.Get` object represents the PYSON ``Get()`` pason -> pyson but pyson part should be removed http://codereview.appspot.com/975044/diff/42001/43001#newcode181 doc/ref/pyson.rst:181: Variables: Arguments
Sign in to reply to this message.
|