{"action":"created","issue":{"url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1","repository_url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0","labels_url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1/comments","events_url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1/events","html_url":"https://github.com/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1","id":166976860,"number":1,"title":"dbConnect() - NameError: global name 'db' is not defined`","user":{"login":"Noirad","id":2172115,"avatar_url":"https://avatars.githubusercontent.com/u/2172115?v=3","gravatar_id":"","url":"https://api.github.com/users/Noirad","html_url":"https://github.com/Noirad","followers_url":"https://api.github.com/users/Noirad/followers","following_url":"https://api.github.com/users/Noirad/following{/other_user}","gists_url":"https://api.github.com/users/Noirad/gists{/gist_id}","starred_url":"https://api.github.com/users/Noirad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noirad/subscriptions","organizations_url":"https://api.github.com/users/Noirad/orgs","repos_url":"https://api.github.com/users/Noirad/repos","events_url":"https://api.github.com/users/Noirad/events{/privacy}","received_events_url":"https://api.github.com/users/Noirad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/labels/bug","name":"bug","color":"ee0701"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-22T06:12:13Z","updated_at":"2016-07-23T15:38:35Z","closed_at":"2016-07-23T14:22:29Z","body":"I've got everything setup, however when I run: `python raspberry.py` my server returns \r\n\r\n\tFound ChromeCast: ['Vegeta', 'Krypton', 'Terran']\r\n\tTraceback (most recent call last):\r\n\t\tFile \"raspberry.py\", line 147, in <module>\r\n   \t\t\tdbConnect()\r\n  \t\tFile \"raspberry.py\", line 111, in dbConnect\r\n    \t\t\tcur = db.cursor()\r\n\tNameError: global name 'db' is not defined`\r\n\r\nThis is [screenshot](https://drive.google.com/file/d/0B76FmSgsTcs2RlA5ZlBad0pndUk/view?usp=sharing) of my current `raspberry.py`, any idea what I'm doing wrong?\r\n\r\n(Also has anyone else noticed that Alexa is more responsive (noticing the Chromecast when #/usr/bin/env python is in the code?)\r\n  \r\n**Additional info:** \r\n\r\n_______________________________________________________________________________________________________\r\nIf I commit the name of my database _\"chromey_\" to lines 109-112:\r\n\r\n\t  \t\"def dbConnect(chromey):\r\n\t  \t\t#Set's up the connection to run commands\r\n\t  \t\tcur = db.cursor(chromey.db)\r\nit returns:\r\n\r\n\t  \tFound ChromeCast: ['Krypton', 'Vegeta', 'Terran']\r\n  \t\t  \t  \tTraceback (most recent call last):\r\n  \t\t  \t    \tFile \"raspberry.py\", line 148, in <module>\r\n    \t\t  \t  \tdbConnect()\r\n  \t\t  \t TypeError: dbConnect() takes exactly 1 argument (0 given)\r\n\r\n_______________________________________________________________________________________________________\r\nIn addition, if i commit the database name _\"chromey\"_ into lines 148:\r\n\r\n  \t\t   #Loops Continuously to get new commands.\r\n \t\t  \t  \twhile True:\r\n     \t\t  \t  \tdbConnect(chromey)\r\n     \t\t  \t  \ttime.sleep(2)\r\n\r\nIt returns this error: \r\n\r\n  \t\t   Found ChromeCast: ['Krypton', 'Vegeta', 'Terran']\r\n  \t\t   Traceback (most recent call last):\r\n  \t\t     \t\t    File \"raspberry.py\", line 148, in <module>\r\n     \t\t   \t\t      dbConnect(chromey)\r\n  \t\t   NameError: name 'chromey' is not defined\r\n\r\n**Python3:**\r\n______________________________________________________________________________________________________\r\nIf I specify `python3 raspberry.py` it returns this:\r\n\r\n  \t\t   File \"raspberry.py\", line 143\r\n     \t\t    cur.execute(\"DELETE FROM commands WHERE id=\" + str(idOfQuert))\r\n                                               \t\t     \t\t     \t\t     \t\t     \t\t               ^\r\n  \t\t   TabError: inconsistent use of tabs and spaces in indentation\r\n\r\nAny ideas? Perhaps it's the dbConnect?\r\n\t"},"comment":{"url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/comments/234724544","html_url":"https://github.com/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1#issuecomment-234724544","issue_url":"https://api.github.com/repos/Pizzaface/Alexa-Chromecast-Skill-2.0/issues/1","id":234724544,"user":{"login":"Pizzaface","id":10016234,"avatar_url":"https://avatars.githubusercontent.com/u/10016234?v=3","gravatar_id":"","url":"https://api.github.com/users/Pizzaface","html_url":"https://github.com/Pizzaface","followers_url":"https://api.github.com/users/Pizzaface/followers","following_url":"https://api.github.com/users/Pizzaface/following{/other_user}","gists_url":"https://api.github.com/users/Pizzaface/gists{/gist_id}","starred_url":"https://api.github.com/users/Pizzaface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pizzaface/subscriptions","organizations_url":"https://api.github.com/users/Pizzaface/orgs","repos_url":"https://api.github.com/users/Pizzaface/repos","events_url":"https://api.github.com/users/Pizzaface/events{/privacy}","received_events_url":"https://api.github.com/users/Pizzaface/received_events","type":"User","site_admin":false},"created_at":"2016-07-23T15:38:35Z","updated_at":"2016-07-23T15:38:35Z","body":"If you look, `(1146, u\"Table 'chromey.commands' doesn't exist\")` means that your table doesn't exist inside your database. Try just doing \"commands\" instead. you've already specified the database in your connection string, if that doesn't work, try recloning."}}
{"actor":{"display_login":"Pizzaface"}}