schodet / nxt-python

NXT-Python is a python driver/interface for the Lego Mindstorms NXT robot based on NXT_python.
https://ni.srht.site/nxt-python/latest/
GNU General Public License v3.0
237 stars 74 forks source link

nxt_filer needs to be updated (minor fixes) #181

Closed tcwan closed 2 years ago

tcwan commented 2 years ago

nxt_filer script is no longer tracking the latest nxt-python 3.0.0 and Gtk library requirements. This is a minor patch to fix the bugs.

nxt_filer.diff.txt

schodet commented 2 years ago

How did I missed this? Thanks for the patch.

schodet commented 2 years ago

The import and flags arguments can actually be removed.

Are you OK with this commit:

commit 79d710b1f2391644567fc3223b372c817893693c (HEAD -> master)
Author: TC Wan <tcwan@usm.my>
Date:   Wed Mar 16 09:20:35 2022 +0100

    Fix nxt_filer

diff --git a/scripts/nxt_filer b/scripts/nxt_filer
index c4cbdb6..6839022 100755
--- a/scripts/nxt_filer
+++ b/scripts/nxt_filer
@@ -57,7 +57,6 @@ import nxt.locator
 from usb.core import USBError
 from nxt.locator import BrickNotFoundError
 from nxt.error import FileExistsError, SystemProtocolError
-from nxt.telegram import OPCODES, Telegram

 def play_soundfile(b, fname):
@@ -382,9 +381,7 @@ class AboutDialog(Gtk.AboutDialog):

 class Application(Gtk.Application):
     def __init__(self, *args, **kwargs):
-        super().__init__(*args,
-                         flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
-                         **kwargs)
+        super().__init__(*args, **kwargs)
         self.window = None

         self.set_option_context_summary(
tcwan commented 2 years ago

I'm fine with it.