Closed hellocatfood closed 4 years ago
I've done some tweaking and I've got an experimental branch that should use the BootTidal.hs from the most recent installation of Tidal, provided it's installed in the default location. Seems to work on Windows but it'd be too good to be true if it worked first time on mac/linux so feel free to give it a try:
I've tried that branch and not getting the previous errors but now it seems it's having trouble rendering the interface. The widow opens but the terminal output is:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__
return self.func(*args)
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 189, in store_data
self.finish()
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 117, in finish
self.client.setup(**self.options)
File "/home/hellocatfood/Desktop/Troop/src/client.py", line 126, in setup
self.ui = Interface(self, title, self.lang, logging)
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 303, in __init__
self.lang.start()
File "/home/hellocatfood/Desktop/Troop/src/interpreter.py", line 393, in start
package = os.listdir(tidal_root)[-1]
UnboundLocalError: local variable 'os' referenced before assignment
And when I try and execute code it outputs
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__
return self.func(*args)
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 189, in store_data
self.finish()
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 117, in finish
self.client.setup(**self.options)
File "/home/hellocatfood/Desktop/Troop/src/client.py", line 126, in setup
self.ui = Interface(self, title, self.lang, logging)
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 157, in __init__
height=15, bd=0, highlightthickness=0, yscrollcommand=self.scroll.set)
File "/home/hellocatfood/Desktop/Troop/src/interface/textbox.py", line 87, in __init__
self.configure_font()
File "/home/hellocatfood/Desktop/Troop/src/interface/textbox.py", line 827, in configure_font
self.font = tkFont.Font(family=fontfamily, size=12, name="Font")
File "/usr/lib/python2.7/lib-tk/tkFont.py", line 91, in __init__
tk.call("font", "create", self.name, *font)
TclError: named font "Font" already exists
Woops, it only imported the os
library for Windows, which is fixed. I wonder if it just didn't load everything after that error was thrown. If you can do a git pull and let me know how you get on that'd be great
Server appears to start fine. After launching the client in Tidal mode this is my terminal output:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__
return self.func(*args)
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 189, in store_data
self.finish()
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 117, in finish
self.client.setup(**self.options)
File "/home/hellocatfood/Desktop/Troop/src/client.py", line 126, in setup
self.ui = Interface(self, title, self.lang, logging)
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 303, in __init__
self.lang.start()
File "/home/hellocatfood/Desktop/Troop/src/interpreter.py", line 391, in start
package = os.listdir(tidal_root)[-1]
OSError: [Errno 2] No such file or directory: '~/.cabal/packages/hackage.haskell.org/tidal'
I looked in the directory for tidal ( ~/.cabal/packages/hackage.haskell.org/ ) and that directory contains multiple tidal versions
0.9.10 0.9.9 1.0.13 1.0.5 1.4.3 1.4.4 1.4.7
I suspect other folders will be created as Alex releases newer versions of Tidal.
When I try executing code I get this error, which I suspect is the same as previously reported
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__
return self.func(*args)
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 1106, in evaluate
lines = self.get_current_block()
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 1072, in get_current_block
return self.lang.get_block_of_code(self.text, self.text.marker.get_tcl_index())
AttributeError: 'NoneType' object has no attribute 'get_tcl_index'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__
return self.func(*args)
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 189, in store_data
self.finish()
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 117, in finish
self.client.setup(**self.options)
File "/home/hellocatfood/Desktop/Troop/src/client.py", line 126, in setup
self.ui = Interface(self, title, self.lang, logging)
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 157, in __init__
height=15, bd=0, highlightthickness=0, yscrollcommand=self.scroll.set)
File "/home/hellocatfood/Desktop/Troop/src/interface/textbox.py", line 87, in __init__
self.configure_font()
File "/home/hellocatfood/Desktop/Troop/src/interface/textbox.py", line 827, in configure_font
self.font = tkFont.Font(family=fontfamily, size=12, name="Font")
File "/usr/lib/python2.7/lib-tk/tkFont.py", line 91, in __init__
tk.call("font", "create", self.name, *font)
TclError: named font "Font" already exists
Additionally, on my other computer the client failed to launch due to a tk error. This was fixed by installing the python-tk. Should this be listed as a dependency on the README?
Here's a temporary fix: https://github.com/Qirky/Troop/pull/33
The tidal library (and therefore BootTidal.hs) can be found in a wide variety of places depending on how haskell was installed etc.
The ghc-pkg
command can be run to find out where it is ghc-pkg field tidal data-dir
The atom package does its best: https://github.com/tidalcycles/atom-tidalcycles
You can also load the file with :script c:\path\to\BootTidal.hs
instead of reading in and then sending line by line
Thanks Alex, good idea to have a hard copy of BootTidal.hs for the time being. I'm not sure what the structure of haskell packages are on Linux but on Windows they seem to be in .tar files, which :script
didn't like. However, this is in the default location on the haskell website but ghc-pkg field tidal data-dir
gives you the director where data is stored i.e. BootTidal, which is nice and should make this process quite simple. Thanks!
And yes, python-tk should be included as a dependency!
Ah I see, we're looking at different things. The .tar file is a cache of the package that cabal downloads before it installs the library.
Cabal will install BootTidal.hs in the filesystem as part of the install process as a related data file (because it's listed in tidal.cabal)
On my system running ghc-pkg field tidal data-dir
returns data-dir: /home/alex/.cabal/share/x86_64-linux-ghc-8.6.5/tidal-1.4.6
The /home/alex/.cabal/share/x86_64-linux-ghc-8.6.5/tidal-1.4.6
folder only contains BootTidal.hs
(just re-read your comment and realise you already said much of the above!)
Anyway, this is all a bit fragile, and @ndr-brt been through a lot getting it working reliably in the atom plugin.. Actually I think we're still hitting problems dealing with spaces in filenames..
Ok, cool - this should work whenever a user updates Tidal provided that ghc-pkg
returns the directories in order of newest to oldest. You can also specify a different file to boot with in Troop's config files.
If either could let me know if this branch works with Linux I'll merge it into the main one. Thanks!
Just did a git pull and got this error running the client
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__
return self.func(*args)
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 189, in store_data
self.finish()
File "/home/hellocatfood/Desktop/Troop/src/interface/conn_info.py", line 117, in finish
self.client.setup(**self.options)
File "/home/hellocatfood/Desktop/Troop/src/client.py", line 126, in setup
self.ui = Interface(self, title, self.lang, logging)
File "/home/hellocatfood/Desktop/Troop/src/interface/interface.py", line 315, in __init__
raise(e)
IOError: [Errno 2] No such file or directory: '/home/hellocatfood/Desktop/Troop/src/conf/boot.txt'
Woops! My .gitignore is set to ignore .txt files so I've pushed it again, though I should handle that error if a user accidentally deletes the file anyway
It all works! At least it does for me. @yaxu can you test it as well?
Yes works for me too! Thanks @Qirky !
Thank you both for your help! Big improvement to the tool :)
I'm using Troop 0.9.6 on Ubuntu 19.10 (was also tested on Mac OSX) and the Troop client is failing to start.
Attached is the output from the terminal and the Troop message window.
message_window_output.txt
terminal_output.txt
No errors occurred when selecting FoxDot as the language, but I also don't have FoxDot installed.