Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple small issues with python3... and fixes #56

Open
nolange opened this issue Oct 8, 2022 · 2 comments
Open

Couple small issues with python3... and fixes #56

nolange opened this issue Oct 8, 2022 · 2 comments

Comments

@nolange
Copy link

nolange commented Oct 8, 2022

Should be pretty self explanatory, those warn or raise exceptions on python3.10 + python3-wxgtk4.0.

Thought about setting up a PLC Tool on a ChromeBook for a relative, did not expect this kinda troubles.

Doesn't help that the links to github are rather hidden on the website.

diff --git a/editor/BeremizIDE.py b/editor/BeremizIDE.py
index c053adc..e7fa1fe 100644
--- a/editor/BeremizIDE.py
+++ b/editor/BeremizIDE.py
@@ -122,7 +122,7 @@ class Beremiz(IDEFrame):
                    kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O')
         parent.AppendSubMenu(self.RecentProjectsMenu, _("&Recent Projects"))
         parent.AppendSeparator()
-        parent.AppendMenu(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu)
+        parent.Append(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu)
 
         examples_dir = Bpath("examples")
         project_list = sorted(os.listdir(examples_dir))
diff --git a/editor/Beremiz_service.py b/editor/Beremiz_service.py
index 475c2b6..5d45748 100755
--- a/editor/Beremiz_service.py
+++ b/editor/Beremiz_service.py
@@ -341,7 +341,7 @@ if enablewx:
                 _servicename = self.pyroserver.servicename
                 _servicename = '' if _servicename is None else _servicename
                 dlg = ParamsEntryDialog(None, _("Enter a name "), defaultValue=_servicename)
-                dlg.SetTests([(lambda name: len(name) is not 0, _("Name must not be null!"))])
+                dlg.SetTests([(lambda name: len(name) != 0, _("Name must not be null!"))])
                 if dlg.ShowModal() == wx.ID_OK:
                     self.pyroserver.servicename = dlg.GetValue()
                     self.pyroserver.Restart()
diff --git a/editor/controls/ProjectPropertiesPanel.py b/editor/controls/ProjectPropertiesPanel.py
index bf10fe6..a14f811 100644
--- a/editor/controls/ProjectPropertiesPanel.py
+++ b/editor/controls/ProjectPropertiesPanel.py
@@ -256,8 +256,8 @@ class ProjectPropertiesPanel(wx.Notebook):
             elif item == "scaling":
                 for language, (x, y) in value.items():
                     if language in self.Scalings:
-                        self.Scalings[language][0].SetValue(x)
-                        self.Scalings[language][1].SetValue(y)
+                        self.Scalings[language][0].SetValue(int(x))
+                        self.Scalings[language][1].SetValue(int(y))
             else:
                 tc = getattr(self, item, None)
                 if tc is not None:
@thiagoralves
Copy link
Owner

Thanks for the fixes. Could you make a PR with those please?

PS: You should expect all kind of trouble when using a dev branch. If you want a smoother experience, try using the website installer (master branch) on a supported platform (Debian and Fedora variants).

@nolange
Copy link
Author

nolange commented Oct 10, 2022

The master branch is quite impossible to get to work on debian bookworm. There's no python2 and using pip yielded some broken wxpython libraries.

Sorry, don't think those 3 changes are worth doing a branch & PR. I am not following this further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants