{"action":"created","issue":{"url":"https://api.github.com/repos/WheatonCS/Lexos/issues/433","repository_url":"https://api.github.com/repos/WheatonCS/Lexos","labels_url":"https://api.github.com/repos/WheatonCS/Lexos/issues/433/labels{/name}","comments_url":"https://api.github.com/repos/WheatonCS/Lexos/issues/433/comments","events_url":"https://api.github.com/repos/WheatonCS/Lexos/issues/433/events","html_url":"https://github.com/WheatonCS/Lexos/issues/433","id":164625245,"number":433,"title":"tokenizer not caching all the options","user":{"login":"chantisnake","id":10100995,"avatar_url":"https://avatars.githubusercontent.com/u/10100995?v=3","gravatar_id":"","url":"https://api.github.com/users/chantisnake","html_url":"https://github.com/chantisnake","followers_url":"https://api.github.com/users/chantisnake/followers","following_url":"https://api.github.com/users/chantisnake/following{/other_user}","gists_url":"https://api.github.com/users/chantisnake/gists{/gist_id}","starred_url":"https://api.github.com/users/chantisnake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chantisnake/subscriptions","organizations_url":"https://api.github.com/users/chantisnake/orgs","repos_url":"https://api.github.com/users/chantisnake/repos","events_url":"https://api.github.com/users/chantisnake/events{/privacy}","received_events_url":"https://api.github.com/users/chantisnake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-08T22:06:07Z","updated_at":"2016-07-14T03:30:43Z","closed_at":null,"body":"if you click the `regenerate table` button, all the option is not cached(including tokenize and analysis options)\r\n\r\nwe tried to move the two lines on [lexos.py L1757](https://github.com/WheatonCS/Lexos/blob/master/lexos.py#L1757) and L1758 up,\r\n\r\n\r\nwe changed the code from:\r\n\r\n``` python\r\n        return render_template('tokenizer.html', draw=1, labels=labels, headers=headerLabels, columns=cols, rows=rows, numRows=recordsTotal, orientation=csvorientation, numActiveDocs=numActiveDocs)\r\n\r\n    if request.method == \"POST\":\r\n        if 'get-csv' in request.form:\r\n            # The 'Download Matrix' button is clicked on tokenizer.html.\r\n            session_manager.cacheAnalysisOption()\r\n            session_manager.cacheCSVOptions()\r\n            savePath, fileExtension = utility.generateCSV(fileManager)\r\n            managers.utility.saveFileManager(fileManager)\r\n```\r\n\r\nto:\r\n\r\n``` python \r\n        return render_template('tokenizer.html', draw=1, labels=labels, headers=headerLabels, columns=cols, rows=rows, numRows=recordsTotal, orientation=csvorientation, numActiveDocs=numActiveDocs)\r\n\r\n    if request.method == \"POST\":\r\n        session_manager.cacheAnalysisOption()\r\n        session_manager.cacheCSVOptions()\r\n\r\n        if 'get-csv' in request.form:\r\n            # The 'Download Matrix' button is clicked on tokenizer.html.\r\n            savePath, fileExtension = utility.generateCSV(fileManager)\r\n            managers.utility.saveFileManager(fileManager)\r\n\r\n```\r\n\r\nand the browser gives us a:\r\n```\r\nDataTables warning: table id=example - Ajax error. For more information about this error, please see http://datatables.net/tn/7\r\n```\r\n\r\nTested on Edge and Firefox on windows 10. I thought you will be able to fix it @scottkleinman \r\n\r\nall these changes are not pushed to the remote."},"comment":{"url":"https://api.github.com/repos/WheatonCS/Lexos/issues/comments/232547986","html_url":"https://github.com/WheatonCS/Lexos/issues/433#issuecomment-232547986","issue_url":"https://api.github.com/repos/WheatonCS/Lexos/issues/433","id":232547986,"user":{"login":"scottkleinman","id":1125917,"avatar_url":"https://avatars.githubusercontent.com/u/1125917?v=3","gravatar_id":"","url":"https://api.github.com/users/scottkleinman","html_url":"https://github.com/scottkleinman","followers_url":"https://api.github.com/users/scottkleinman/followers","following_url":"https://api.github.com/users/scottkleinman/following{/other_user}","gists_url":"https://api.github.com/users/scottkleinman/gists{/gist_id}","starred_url":"https://api.github.com/users/scottkleinman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottkleinman/subscriptions","organizations_url":"https://api.github.com/users/scottkleinman/orgs","repos_url":"https://api.github.com/users/scottkleinman/repos","events_url":"https://api.github.com/users/scottkleinman/events{/privacy}","received_events_url":"https://api.github.com/users/scottkleinman/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T03:30:43Z","updated_at":"2016-07-14T03:30:43Z","body":"OK, it now seems like most frequent words was not applied (I had to try a number other than 10 to see this). I managed to trace the problem to `file_manager.mostFrequentWord()`, which was still looking for `request.form`. I changed\r\n\r\n```python\r\nLowerRankBound = int(request.form['mfwnumber'])\r\n```\r\nto\r\n\r\n```python\r\nif request.json:\r\n    LowerRankBound = int(request.json['mfwnumber'])\r\nelse:\r\n    LowerRankBound = int(request.form['mfwnumber'])            \r\n```\r\nAs I mentioned, this is not necessarily the most elegant solution, but I'll push it as soon as I get rid of all my debugging print statements.\r\n\r\nWe may have to dig around some other examples of functions which expect `request.form`."}}
{"actor":{"display_login":"scottkleinman"}}