lucaschessR2 icon indicating copy to clipboard operation
lucaschessR2 copied to clipboard

building/running on Fedora 37

Open ratmice opened this issue 2 years ago • 9 comments

I don't know much of anything about python, but trying to build on fedora 37 I ran into a few issues.

  • first patch fixes running LucasR.py, Without this all calls to _("foo") take the form of a call to None(...), so I imported gettext and defined _ so it is no longer None. I can only imagine either my python or some dependency has changed such _ is no longer being defined anywhere.
  • second patch when running the built installer fixes a None in Icons.get() of the changed file, within that function the bin_icons and dict_icons are None.

Thanks

ratmice avatar Dec 31 '22 11:12 ratmice

Thank you very much for the suggestions

_ is defined as a builtin in imagen

The possibility to select icons turned as sepia and darked, perhaps has some issue in Linux, I have to test it.

lukasmonk avatar Jan 03 '23 17:01 lukasmonk

Thanks for the feedback, i'll see if I can't figure out why this builtin given above doesn't appear to be getting defined!

ratmice avatar Jan 03 '23 20:01 ratmice

So, i'm a bit stumped I added a call to print "Initializing translations" to stderr the __init__ function given above (using the main branch), from the bug.log file, it seems that function is actually being called but the _ builtin still seems to be None, a bit perplexing.

Initializing translations
Traceback (most recent call last):
  File "/path/to/lucaschessR2/bin/LucasR.py", line 20, in <module>
    Code.Base.Init.init()
  File "/path/to/lucaschessR2/bin/Code/Base/Init.py", line 19, in init
    resp = Gui.run_gui(main_procesador)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lucaschessR2/bin/Code/MainWindow/Gui.py", line 112, in run_gui
    procesador.iniciar_gui()
  File "/path/to/lucaschessR2/bin/Code/Procesador.py", line 171, in iniciar_gui
    self.main_window = MainWindow.MainWindow(self)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lucaschessR2/bin/Code/MainWindow/MainWindow.py", line 28, in __init__
    self.base = WBase.WBase(self, manager)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lucaschessR2/bin/Code/MainWindow/WBase.py", line 84, in __init__
    self.create_toolbar()
  File "/path/to/lucaschessR2/bin/Code/MainWindow/WBase.py", line 120, in create_toolbar
    dic_opciones = self.dic_opciones_tb()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lucaschessR2/bin/Code/MainWindow/WBase.py", line 149, in dic_opciones_tb
    TB_PLAY: (_("Play"), Iconos.Libre()),
              ^^^^^^^^^
TypeError: 'NoneType' object is not callable

Edit: I should also note I tried running LucasChessR.py -translate foo and that popped up a window and seemed to work.

ratmice avatar Jan 03 '23 20:01 ratmice

TypeError: 'NoneType' object is not callable

You could test if file Translate.py, function install is executed You could add a print below Code.translations = Translations(lang), something like print(lang)

lukasmonk avatar Jan 03 '23 21:01 lukasmonk

I went ahead and added a print both before and after, the code in that branch which gets hit once

        print("Before Translations: ", Code.translations, lang, None if Code.translations == None else Code.translations.lang)
        Code.translations = Translations(lang)
        print("After translations: ", lang)

The thing I note is that the __init__ print statement shows up in the middle, I assume due to the call to Translations(lang),

Before Translations:  None en None
Initializing translations
After translations:  en

ratmice avatar Jan 03 '23 21:01 ratmice

Have you kept the folder structure after downloading the sources?

lukasmonk avatar Jan 04 '23 17:01 lukasmonk

I'm not exactly sure that I understand what exactly is being asked,

Building from git I had done a git clean, to remove untracked files, and can checkout the unmodified sources from git.

Alternately the only modifications to the source directory were those listed in step 6 of http://lucaschess.blogspot.com/2021/07/linux-tutorial-for-creating-installer.html

I did a build using the R2.04 tag, which had previously worked fine on an older version of fedora 36. So it seems likely that there is some change in a newer version of python versions may have caused this to no longer work.

ratmice avatar Jan 04 '23 21:01 ratmice

It is tested with python 3.7 and 3.8

lukasmonk avatar Jan 04 '23 21:01 lukasmonk

Sorry, meant to mention f37 has Python 3.11

ratmice avatar Jan 04 '23 21:01 ratmice