forked from FernandoVazZ/reactblockly-customblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 16.5 KB
/
.eslintcache
1
[{"/root/Developer/pyscratch/src/index.js":"1","/root/Developer/pyscratch/src/App.js":"2","/root/Developer/pyscratch/src/toolboxCategories.js":"3","/root/Developer/pyscratch/src/customBlocks/custom_Blocks.js":"4"},{"size":230,"mtime":1682228053172,"results":"5","hashOfConfig":"6"},{"size":4321,"mtime":1682228732032,"results":"7","hashOfConfig":"6"},{"size":28347,"mtime":1682228053172,"results":"8","hashOfConfig":"6"},{"size":8333,"mtime":1682228053172,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"1m3s35h",{"filePath":"13","messages":"14","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"15","usedDeprecatedRules":"12"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":10,"fixableErrorCount":0,"fixableWarningCount":0,"source":"20"},"/root/Developer/pyscratch/src/index.js",[],["21","22"],"/root/Developer/pyscratch/src/App.js",["23","24"],"import \"./App.css\";\r\nimport \"./customBlocks/custom_Blocks\";\r\nimport React, {useEffect, useState} from \"react\";\r\nimport { BlocklyWorkspace } from \"react-blockly\";\r\nimport Blockly from \"blockly\";\r\nimport pythonGenerator from \"blockly/python\";\r\nimport {toolboxCategories} from \"./toolboxCategories\";\r\n\r\nexport default function App() {\r\n const [xml, setXml] = useState(\"\");\r\n const [pythonCode, setPythonCode] = useState(\"\");\r\n useEffect(() =>{\r\n\r\n }, [])\r\n const initialXml =\r\n '<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"start_selenium\" id=\"aKUkJCFO_I|nYt1W},No\" x=\"77\" y=\"56\"><next><block type=\"go_to_link\" id=\"Wc1[Q@7gDjjL8BL_e5us\"><value name=\"url\"><block type=\"text\" id=\"9vtGi1i98.}7[,]HAYkG\"><field name=\"TEXT\">https://zoom.us/</field></block></value><next><block type=\"click_button_text\" id=\"oOsG3_,G%=/]PsUERU}-\"><value name=\"Text\"><block type=\"text\" id=\"ww-mT8if%blm^lhR1LA^\"><field name=\"TEXT\">Sign Up</field></block></value></block></next></block></next></block><block type=\"fill_input\" id=\"e:[email protected][.M3o3.L\" x=\"77\" y=\"206\"><value name=\"input\"><block type=\"text\" id=\"|$`TllsDj%.{{k`gEAJC\"><field name=\"TEXT\">email</field></block></value><value name=\"NAME\"><block type=\"text\" id=\"$UT[W=`$$4uA)3+`[Rf3\"><field name=\"TEXT\">//*[@id=\"email\"]</field></block></value></block><block type=\"fill_input\" id=\"W}c_+Jn+4#18~[ec5cyN\" x=\"80\" y=\"334\"><value name=\"input\"><block type=\"text\" id=\"bYH}GnzjT9t#?Gm)sf!}\"><field name=\"TEXT\">password</field></block></value><value name=\"NAME\"><block type=\"text\" id=\"URb-;xk)v+8W__g=zR81\"><field name=\"TEXT\">//*[@id=\"password\"]</field></block></value></block></xml>'\r\n function workspaceDidChange(workspace) {\r\n const code = pythonGenerator.workspaceToCode(workspace);\r\n setPythonCode(code);\r\n }\r\n\r\n function DownloadPythonFile({ code }) {\r\n function handleDownloadClick() {\r\n // Create a Blob object from the code\r\n const blob = new Blob([code], { type: 'text/plain' });\r\n\r\n // Create a URL object from the Blob\r\n const url = URL.createObjectURL(blob);\r\n\r\n // Create a link element and set its href attribute to the URL\r\n const link = document.createElement('a');\r\n link.href = url;\r\n\r\n // Set the link's download attribute to the desired file name\r\n link.download = 'script.py';\r\n\r\n // Programmatically click the link to start the download\r\n document.body.appendChild(link);\r\n link.click();\r\n\r\n // Cleanup the URL object\r\n URL.revokeObjectURL(url);\r\n }\r\n\r\n return (\r\n <button className=\"button\" onClick={handleDownloadClick}>\r\n Download\r\n </button>\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n <div className=\"BG\">\r\n <div>\r\n <div className=\"title\">pyscratch</div>\r\n <div className=\"Slogan\">Scratch For <br/> Adults</div>\r\n <div className=\"Subtitle\">A cheesy line that's pog</div>\r\n <div className=\"GSButton\">Get Started</div>\r\n </div>\r\n\r\n </div>\r\n <div style={{\r\n width: \"100%\",\r\n height: \"200px\",\r\n backgroundColor: \"#1e1e1e\",\r\n border: \"1px solid #1e1e1e\",\r\n }}>\r\n </div>\r\n <div style={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n }}>\r\n <BlocklyWorkspace\r\n toolboxConfiguration={toolboxCategories}\r\n initialXml={initialXml}\r\n className=\"fill-height\"\r\n workspaceConfiguration={{\r\n theme: \"dark\"\r\n }}\r\n onWorkspaceChange={workspaceDidChange}\r\n onXmlChange={setXml}\r\n />\r\n\r\n <textarea\r\n id=\"code\"\r\n style={{ height: \"700px\", width: \"50%\", backgroundColor: \"#1e1e1e\", color: \"white\"}}\r\n value={pythonCode}\r\n readOnly\r\n ></textarea>\r\n </div>\r\n <DownloadPythonFile code={pythonCode} />\r\n\r\n </>\r\n );\r\n}","/root/Developer/pyscratch/src/toolboxCategories.js",[],"/root/Developer/pyscratch/src/customBlocks/custom_Blocks.js",["25","26","27","28","29","30","31","32","33","34"],"import Blockly from \"blockly\";\r\nimport 'blockly/python';\r\n\r\nBlockly.Blocks['start_selenium'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .appendField(\"Start Selenium\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(120);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['go_to_link'] = {\r\n init: function() {\r\n this.appendValueInput(\"url\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Go to URL\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(230);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['click_button_xpath'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .appendField(\"Click Button\");\r\n this.appendValueInput(\"XPATH\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Button XPath\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(290);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['fill_input'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Enter Input\");\r\n this.appendValueInput(\"input\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Input\");\r\n this.appendValueInput(\"NAME\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"XPath\");\r\n this.setColour(230);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['click_button_text'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .appendField(\"Click Button\");\r\n this.appendValueInput(\"Text\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Button Text\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(120);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['click_button_class_name'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .appendField(\"Click Button\");\r\n this.appendValueInput(\"Class Name\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Class Name\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(120);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['import_pd_and_np'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Import pandas\");\r\n this.appendDummyInput()\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Import NumPy\");\r\n this.appendDummyInput()\r\n .appendField(\"Create Dataframe\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(230);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['scrape_element_class_name'] = {\r\n init: function() {\r\n this.appendValueInput(\"name\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Name\");\r\n this.appendValueInput(\"class_name\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Class Name\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(65);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['scrape_element_xpath'] = {\r\n init: function() {\r\n this.appendValueInput(\"Name\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"Name\");\r\n this.appendValueInput(\"XPATH\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"XPATH\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(300);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Blocks['generate_csv'] = {\r\n init: function() {\r\n this.appendDummyInput()\r\n .appendField(\"Generate CSV\");\r\n this.appendValueInput(\"name\")\r\n .setCheck(\"String\")\r\n .setAlign(Blockly.ALIGN_RIGHT)\r\n .appendField(\"CSV Name\");\r\n this.setPreviousStatement(true, null);\r\n this.setNextStatement(true, null);\r\n this.setColour(15);\r\n this.setTooltip(\"\");\r\n this.setHelpUrl(\"\");\r\n }\r\n};\r\n\r\nBlockly.Python['start_selenium'] = function(block) {\r\n var code = 'from selenium import webdriver\\n';\r\n code += 'from selenium.webdriver.common.keys import Keys\\n';\r\n code += 'from selenium.webdriver.common.by import By\\n';\r\n code += 'driver = webdriver.Chrome()\\n' + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['go_to_link'] = function(block) {\r\n var value_url = Blockly.Python.valueToCode(block, 'url', Blockly.Python.ORDER_ATOMIC);\r\n var code = 'driver.get(' + value_url + ')\\n' + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['click_button_xpath'] = function(block) {\r\n var value_xpath = Blockly.Python.valueToCode(block, 'XPATH', Blockly.Python.ORDER_ATOMIC);\r\n var code = \"click_button = driver.find_element(By.XPATH,\" + value_xpath + \")\\n\";\r\n code += \"click_button.click()\\n\" + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['fill_input'] = function(block) {\r\n var value_input = Blockly.Python.valueToCode(block, 'input', Blockly.Python.ORDER_ATOMIC);\r\n var value_name = Blockly.Python.valueToCode(block, 'NAME', Blockly.Python.ORDER_ATOMIC);\r\n var code = 'driver.find_element(By.XPATH,' + value_name + ').send_keys(' + value_input + ')\\n' + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['click_button_text'] = function(block) {\r\n var value_text = Blockly.Python.valueToCode(block, 'Text', Blockly.Python.ORDER_ATOMIC);\r\n var code = \"click_button = driver.find_element(By.LINK_TEXT,\" + value_text + \")\\n\";\r\n code += \"click_button.click()\\n\" + \"\\n\"\r\n return code;\r\n};\r\n\r\nBlockly.Python['click_button_class_name'] = function(block) {\r\n var value_class_name = Blockly.Python.valueToCode(block, 'Class Name', Blockly.Python.ORDER_ATOMIC);\r\n var code = \"click_button = driver.find_element(By.CLASS_NAME,\" + value_class_name + \")\\n\";\r\n code += \"click_button.click()\\n\" + \"\\n\"\r\n return code;\r\n};\r\n\r\nBlockly.Python['import_pd_and_np'] = function(block) {\r\n var code = 'import pandas as pd\\n';\r\n code += 'import numpy as np\\n';\r\n code += 'df = pd.DataFrame()\\n' + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['scrape_element_class_name'] = function(block) {\r\n var value_name = Blockly.Python.valueToCode(block, 'name', Blockly.Python.ORDER_ATOMIC);\r\n var value_class_name = Blockly.Python.valueToCode(block, 'class_name', Blockly.Python.ORDER_ATOMIC);\r\n var code = 'scraped_elements = driver.find_elements(By.CLASS_NAME,' + value_class_name + ')\\n';\r\n code += 'df[' + value_name + '] = [element.text for element in scraped_elements]\\n' + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['scrape_element_xpath'] = function(block) {\r\n var value_name = Blockly.Python.valueToCode(block, 'Name', Blockly.Python.ORDER_ATOMIC);\r\n var value_xpath = Blockly.Python.valueToCode(block, 'XPATH', Blockly.Python.ORDER_ATOMIC);\r\n var code = 'scraped_elements = driver.find_elements(By.XPATH,' + value_xpath + ')\\n';\r\n code += 'df[' + value_name + '] = [element.text for element in scraped_elements]\\n' + \"\\n\";\r\n return code;\r\n};\r\n\r\nBlockly.Python['generate_csv'] = function(block) {\r\n var value_name = Blockly.Python.valueToCode(block, 'name', Blockly.Python.ORDER_ATOMIC);\r\n var code = 'df.to_csv(' + value_name + ')\\n' + \"\\n\";\r\n return code;\r\n};",{"ruleId":"35","replacedBy":"36"},{"ruleId":"37","replacedBy":"38"},{"ruleId":"39","severity":1,"message":"40","line":5,"column":8,"nodeType":"41","messageId":"42","endLine":5,"endColumn":15},{"ruleId":"39","severity":1,"message":"43","line":10,"column":12,"nodeType":"41","messageId":"42","endLine":10,"endColumn":15},{"ruleId":"44","severity":1,"message":"45","line":171,"column":45,"nodeType":"46","messageId":"47","endLine":171,"endColumn":46},{"ruleId":"44","severity":1,"message":"45","line":177,"column":50,"nodeType":"46","messageId":"47","endLine":177,"endColumn":51},{"ruleId":"44","severity":1,"message":"45","line":184,"column":38,"nodeType":"46","messageId":"47","endLine":184,"endColumn":39},{"ruleId":"44","severity":1,"message":"45","line":191,"column":100,"nodeType":"46","messageId":"47","endLine":191,"endColumn":101},{"ruleId":"44","severity":1,"message":"45","line":198,"column":38,"nodeType":"46","messageId":"47","endLine":198,"endColumn":39},{"ruleId":"44","severity":1,"message":"45","line":205,"column":38,"nodeType":"46","messageId":"47","endLine":205,"endColumn":39},{"ruleId":"44","severity":1,"message":"45","line":212,"column":37,"nodeType":"46","messageId":"47","endLine":212,"endColumn":38},{"ruleId":"44","severity":1,"message":"45","line":220,"column":89,"nodeType":"46","messageId":"47","endLine":220,"endColumn":90},{"ruleId":"44","severity":1,"message":"45","line":228,"column":89,"nodeType":"46","messageId":"47","endLine":228,"endColumn":90},{"ruleId":"44","severity":1,"message":"45","line":234,"column":50,"nodeType":"46","messageId":"47","endLine":234,"endColumn":51},"no-native-reassign",["48"],"no-negated-in-lhs",["49"],"no-unused-vars","'Blockly' is defined but never used.","Identifier","unusedVar","'xml' is assigned a value but never used.","no-useless-concat","Unexpected string concatenation of literals.","BinaryExpression","unexpectedConcat","no-global-assign","no-unsafe-negation"]