{"action":"closed","issue":{"url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager/issues/6","repository_url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager","labels_url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager/issues/6/comments","events_url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager/issues/6/events","html_url":"https://github.com/tobiasraabe/otree_virtual_machine_manager/issues/6","id":200855885,"number":6,"title":"Create BasePrompt class","user":{"login":"tobiasraabe","id":22533006,"avatar_url":"https://avatars3.githubusercontent.com/u/22533006?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasraabe","html_url":"https://github.com/tobiasraabe","followers_url":"https://api.github.com/users/tobiasraabe/followers","following_url":"https://api.github.com/users/tobiasraabe/following{/other_user}","gists_url":"https://api.github.com/users/tobiasraabe/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasraabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasraabe/subscriptions","organizations_url":"https://api.github.com/users/tobiasraabe/orgs","repos_url":"https://api.github.com/users/tobiasraabe/repos","events_url":"https://api.github.com/users/tobiasraabe/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasraabe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager/milestones/1","html_url":"https://github.com/tobiasraabe/otree_virtual_machine_manager/milestone/1","labels_url":"https://api.github.com/repos/tobiasraabe/otree_virtual_machine_manager/milestones/1/labels","id":2378696,"number":1,"title":"Version 0.1.0","description":"First release at the beginning of next week.","creator":{"login":"tobiasraabe","id":22533006,"avatar_url":"https://avatars3.githubusercontent.com/u/22533006?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasraabe","html_url":"https://github.com/tobiasraabe","followers_url":"https://api.github.com/users/tobiasraabe/followers","following_url":"https://api.github.com/users/tobiasraabe/following{/other_user}","gists_url":"https://api.github.com/users/tobiasraabe/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasraabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasraabe/subscriptions","organizations_url":"https://api.github.com/users/tobiasraabe/orgs","repos_url":"https://api.github.com/users/tobiasraabe/repos","events_url":"https://api.github.com/users/tobiasraabe/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasraabe/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":8,"state":"open","created_at":"2017-03-10T21:24:23Z","updated_at":"2017-03-18T13:33:53Z","due_on":"2017-03-20T07:00:00Z","closed_at":null},"comments":0,"created_at":"2017-01-15T08:19:06Z","updated_at":"2017-03-18T13:33:53Z","closed_at":"2017-03-18T13:33:53Z","body":"* oTree Ubuntu Server Manager version: 0.1.0\r\n* Python version: 3.6\r\n* Operating System: Ubuntu\r\n\r\n### Description\r\n\r\nA much more sophisticate approach regarding prompts would be to build ``class BasePrompt`` which could look like this:\r\n\r\n````\r\n# prompts/base.py\r\n\"\"\"The base prompt\"\"\"\r\n\r\nclass BasePrompt():\r\n   \"\"\"A base prompt.\"\"\"\r\n\r\n    def __init__(self, prompt_string):\r\n        self.prompt_string = prompt_string\r\n        self.input = None\r\n\r\n   def input_validation(self):\r\n       # check with regular expression, type conversion, escaping of command sequences\r\n \r\n    def run(self):\r\n        raise NotImplementedError('You must implement the run() method yourself!')\r\n````\r\n\r\nUp to know, I dropped the input validation and provided examples of inputs, so that users hopefully stick to them. But in the long run users will try everything and you do not want to have a user called \"John ; DROP TABLE;\".\r\n\r\n### Remarks\r\n- usernames should not include hyphens because of postgres\r\n\r\n### Additional ressources:\r\n- http://stackoverflow.com/questions/23294658/asking-the-user-for-input-until-they-give-a-valid-response\r\n- http://www.tldp.org/LDP/LG/issue83/evans.html\r\n- http://stackoverflow.com/questions/42078103/how-to-use-click-prompt-to-get-a-valid-date-from-the-user - use ``value_proc`` argument"}}
{"actor":{"display_login":"tobiasraabe"}}