ParthJadhav / Tkinter-Designer

An easy and fast way to create a Python GUI 🐍
BSD 3-Clause "New" or "Revised" License
8.62k stars 793 forks source link

Invalid File URL #412

Closed HailKagamine123 closed 1 month ago

HailKagamine123 commented 1 month ago

I followed your instruction on how to copy the File URL but for the past few hours I kept receiving the error message, "Please enter a valid file URL." I even tried clicking the frame first before actually trying to copy the file URL, but it still wont work.

image

anuragverma77 commented 1 month ago

go to gui/gui.py and replace at line #48 r'https://www.figma.com/file/([0-9A-Za-z]+)', URL.strip()) with r'https://www.figma.com/design/([0-9A-Za-z]+)', URL.strip())

RiumiToki commented 1 month ago

go to gui/gui.py and replace at line #48 r'https://www.figma.com/file/([0-9A-Za-z]+)', URL.strip()) with r'https://www.figma.com/design/([0-9A-Za-z]+)', URL.strip())

F:\Tkinter-Designer-master>python -u "f:\Tkinter-Designer-master\gui\gui.py" Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64qbz5n2kfra8p0\Lib\tkinter\init.py", line 1967, in call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "f:\Tkinter-Designer-master\gui\gui.py", line 72, in btn_clicked designer.design() File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 32, in design code = self.to_code() ^^^^^^^^^^^^^^ File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 19, in to_code for f in self.file_data["document"]["children"][0]["children"]:


KeyError: 'document'
AngeleAkane commented 1 month ago

go to gui/gui.py and replace at line #48 r'https://www.figma.com/file/([0-9A-Za-z]+)', URL.strip()) with r'https://www.figma.com/design/([0-9A-Za-z]+)', URL.strip())

F:\Tkinter-Designer-master>python -u "f:\Tkinter-Designer-master\gui\gui.py" Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64qbz5n2kfra8p0\Lib\tkinterinit__.py", line 1967, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "f:\Tkinter-Designer-master\gui\gui.py", line 72, in btn_clicked designer.design() File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 32, in design code = self.to_code() ^^^^^^^^^^^^^^ File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 19, in to_code for f in self.file_data["document"]["children"][0]["children"]: ~~~~~~^^^^^^^^^^^^ KeyError: 'document'

I dunno what you did but it worked for me.

RiumiToki commented 1 month ago

go to gui/gui.py and replace at line #48 r'https://www.figma.com/file/([0-9A-Za-z]+)', URL.strip()) with r'https://www.figma.com/design/([0-9A-Za-z]+)', URL.strip())

F:\Tkinter-Designer-master>python -u "f:\Tkinter-Designer-master\gui\gui.py" Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64qbz5n2kfra8p0\Lib\tkinterinit__.py", line 1967, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "f:\Tkinter-Designer-master\gui\gui.py", line 72, in btn_clicked designer.design() File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 32, in design code = self.to_code() ^^^^^^^^^^^^^^ File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 19, in to_code for f in self.file_data["document"]["children"][0]["children"]: ~~~~~~^^^^^^^^^^^^ KeyError: 'document'

I dunno what you did but it worked for me.

Do you mind sending me the full gui.py code please? or better help me generate the code from my figma file. It would be such a great help. https://www.figma.com/design/pRjWLN5nq838lUUXdz4FIi/Untitled?node-id=0%3A1&t=FOS74B01VILl6m4C-1 ty

mozaddedalfeshani commented 1 month ago

Thank's man it's work for me

ParthJadhav commented 1 month ago

solved in latest commit.

AngeleAkane commented 1 month ago

go to gui/gui.py and replace at line #48 r'https://www.figma.com/file/([0-9A-Za-z]+)', URL.strip()) with r'https://www.figma.com/design/([0-9A-Za-z]+)', URL.strip())

F:\Tkinter-Designer-master>python -u "f:\Tkinter-Designer-master\gui\gui.py" Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64qbz5n2kfra8p0\Lib\tkinterinit__.py", line 1967, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "f:\Tkinter-Designer-master\gui\gui.py", line 72, in btn_clicked designer.design() File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 32, in design code = self.to_code() ^^^^^^^^^^^^^^ File "F:\Tkinter-Designer-master\tkdesigner\designer.py", line 19, in to_code for f in self.file_data["document"]["children"][0]["children"]: ~~~~~~^^^^^^^^^^^^ KeyError: 'document'

I dunno what you did but it worked for me.

Do you mind sending me the full gui.py code please? or better help me generate the code from my figma file. It would be such a great help. https://www.figma.com/design/pRjWLN5nq838lUUXdz4FIi/Untitled?node-id=0%3A1&t=FOS74B01VILl6m4C-1 ty

Sorry for this last response. Try to download again Tkinter Designer and do the steps. Probably you deleted something.