TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: DENNIS LEE BIEBER
date: 2019-11-06 12:04:00
subject: Re: file -i vs xdg-mime q

On Wed, 6 Nov 2019 08:59:35 +0100, "R.Wieser" 
declaimed the following:


>pi@raspberrypi: ~ $ uname -a
>Linux raspberrypi 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l
>GNU/Linux
>
>Thats exactly the same for both the sd cards I have, even though they come
>from different sources (one bought, the other downloaded myself.  whats the
>chance of that ?  :-) ).

 Based upon the date, that looks a lot like it is based on NOOBS 3.2.0
(I still have that archived with a download date of July 12). I believe
that was the first Buster version using official Debian release (the
foundation had released a version using "testing" sources about two weeks
earlier because the recently released 4B required the new OS).

https://www.raspberrypi.org/downloads/noobs/ shows that "NOOBS Lite" is a
July 10 file, while the full NOOBS is September 30. Since the Lite version
is a network installer I can't tell exactly what version it really installs
-- it might pull down 3.2.1 files if run today.

 The foundation doesn't seem to make older images available (unlike
Beagle -- they have an FTP site with practically every release including
daily development builds)



>The "no execute request" isn't that strange when it doesn't identify as a
>script and thus the DTM doesn't know which program to start it with.   Or
>maybe its just that that mimetype has no executable registered for it.
>
 However it was set "chmod +x" so had the flags that said it was an
executable. And typing ./test1.py in a console does execute it.

>Though the "opens in Thonny" does baffle me.   The only thing I can think of
>is that the returned mime type for that file somehow got linked to Thonny.
>What do the files properties show ?   The "Open with:" entry I mean.
>

 Thonny seems to be the foundation's preferred Python IDE (ignoring IDLE
-- as I always do ).

test1.py (no shebang)
Open with >
 Geany
 Thonny Python IDE
 Text Editor
 gVim
 Vim
 LibreOffice Writer

test2.py (shebang)
Open with >
 mu
 Geany
 Thonny Python IDE
 Text Editor
 gVim
 Vim
 LibreOffice Writer


 "mu" is described as a beginning editor for Python -- but isn't
running; from a command line I get a nasty traceback ending with

    from PyQt5.Qsci import QsciScintilla, QsciLexerPython, QsciAPIs
ImportError: /usr/lib/libqscintilla2_qt5.so.13: undefined symbol:
_ZN27QsciAccessibleScintillaBase14interface_castEN11QAccessible13InterfaceTyPeE

Going to try apt-get remove on mu-editor, then autoremove on the crud it
left behind... then reinstall it... No change, so I'm going to just remove
it permanently... No sense having menu entries for things that won't run.

 Thonny is the second entry in mailcap for python.

pi@rpi3bplus-1:~$ grep -i "python" /etc/mailcap
text/x-python; geany %s; test=test -n "$DISPLAY"
text/x-python; /usr/bin/thonny %s; test=test -n "$DISPLAY"

Hmmm, and no x-python3 entries in mailcap, but there is one in the xdg-mime
database. Per "man xdg-mime" it uses the various .desktop files to
determine what applications go with what types.

pi@rpi3bplus-1:~$ xdg-mime query default text/x-python3
pi@rpi3bplus-1:~$ xdg-mime query default text/x-python
Thonny.desktop
pi@rpi3bplus-1:~$

... so Thonny is the .desktop configuration for general x-python. And that
.desktop file has the mimetype definition line.




--
 Wulfraed                 Dennis Lee Bieber         AF6VN
 wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.