{"action":"created","issue":{"url":"https://api.github.com/repos/hgrecco/pyvisa-sim/issues/7","labels_url":"https://api.github.com/repos/hgrecco/pyvisa-sim/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/hgrecco/pyvisa-sim/issues/7/comments","events_url":"https://api.github.com/repos/hgrecco/pyvisa-sim/issues/7/events","html_url":"https://github.com/hgrecco/pyvisa-sim/issues/7","id":57044125,"number":7,"title":"Parser: defining properties","user":{"login":"hgrecco","id":278566,"avatar_url":"https://avatars.githubusercontent.com/u/278566?v=3","gravatar_id":"","url":"https://api.github.com/users/hgrecco","html_url":"https://github.com/hgrecco","followers_url":"https://api.github.com/users/hgrecco/followers","following_url":"https://api.github.com/users/hgrecco/following{/other_user}","gists_url":"https://api.github.com/users/hgrecco/gists{/gist_id}","starred_url":"https://api.github.com/users/hgrecco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgrecco/subscriptions","organizations_url":"https://api.github.com/users/hgrecco/orgs","repos_url":"https://api.github.com/users/hgrecco/repos","events_url":"https://api.github.com/users/hgrecco/events{/privacy}","received_events_url":"https://api.github.com/users/hgrecco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-09T15:21:27Z","updated_at":"2015-02-09T15:26:20Z","closed_at":null,"body":"Syntax:\r\n```\r\n@property <property name>[: <specification>]\r\nget >>> <get string>\r\nget <<< <return format using stringparser>\r\nset >>> <set string using PEP 3101>\r\n[set <<< <return string when everything is ok using stringparser>]\r\n[err <<< <return string when an error is  found using stringparser>]\r\n```\r\n\r\nThings between brackets are optional.\r\nIf `set <<<` or `err <<<` are not given, it is assumed that nothing is returned.\r\nIf the specification is not given, any value is possible.\r\n\r\nFor example:\r\n```\r\n@property frequency\r\nget >>> FREQ?\r\nget <<< {.3f}\r\nset >>> FREQ {.3f}\r\nset <<< OK\r\nerr <<< ERROR\r\n@end \r\n```\r\n\r\n#### How to write the specification\r\n\r\n**A** using lantz-like kwargs Feat.\r\nRange: `limits = min, max, step value`\r\nValid values: `values = value1, value2, value3`\r\n\r\n**B** using a more texty way:\r\nRange: `min < value < max`\r\nStep: `step = step value`\r\nValid values: `value1 | value2 | value3`\r\n\r\n\r\nSee #3 "},"comment":{"url":"https://api.github.com/repos/hgrecco/pyvisa-sim/issues/comments/73526975","html_url":"https://github.com/hgrecco/pyvisa-sim/issues/7#issuecomment-73526975","issue_url":"https://api.github.com/repos/hgrecco/pyvisa-sim/issues/7","id":73526975,"user":{"login":"MatthieuDartiailh","id":4481740,"avatar_url":"https://avatars.githubusercontent.com/u/4481740?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthieuDartiailh","html_url":"https://github.com/MatthieuDartiailh","followers_url":"https://api.github.com/users/MatthieuDartiailh/followers","following_url":"https://api.github.com/users/MatthieuDartiailh/following{/other_user}","gists_url":"https://api.github.com/users/MatthieuDartiailh/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthieuDartiailh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthieuDartiailh/subscriptions","organizations_url":"https://api.github.com/users/MatthieuDartiailh/orgs","repos_url":"https://api.github.com/users/MatthieuDartiailh/repos","events_url":"https://api.github.com/users/MatthieuDartiailh/events{/privacy}","received_events_url":"https://api.github.com/users/MatthieuDartiailh/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T15:26:20Z","updated_at":"2015-02-09T15:26:20Z","body":"I was wondering if it might not be possible to accept arbitrary function definition (marked with lets say '@python' to allow more exotic stuff (as it seems to me it often ends up not being that exotic). When parsing the file the def can be exec and assigned as getter or setter. We should only agree on a given signature."}}