After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779468 - language-specs: Add a content type for python3.lang
language-specs: Add a content type for python3.lang
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-02 12:04 UTC by Philip Withnall
Modified: 2017-03-09 14:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
language-specs: Add a content type for python3.lang (1.12 KB, patch)
2017-03-02 12:04 UTC, Philip Withnall
none Details | Review
language-specs: Add a content type for python3.lang (1.04 KB, patch)
2017-03-02 13:11 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-03-02 12:04:43 UTC
Trivial patch attached. Depends on https://bugs.freedesktop.org/show_bug.cgi?id=100034.
Comment 1 Philip Withnall 2017-03-02 12:04:47 UTC
Created attachment 347054 [details] [review]
language-specs: Add a content type for python3.lang

Bug #100034 in shared-mime-info adds a new text/x-python3 content type
to distinguish Python 3 files from Python 2. Use that if available to
select python3.lang over python.lang.

See https://bugs.freedesktop.org/show_bug.cgi?id=100034.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Sébastien Wilmet 2017-03-02 12:12:57 UTC
Review of attachment 347054 [details] [review]:

.

::: data/language-specs/python3.lang
@@ +23,3 @@
 <language id="python3" _name="Python 3" version="2.0" _section="Script">
   <metadata>
+    <property name="mimetypes">text/x-python3;application/x-python3</property>

The patch for shared-mime-info adds only text/x-python3, not application/x-python3. Why is application/x-python3 also added?
Comment 3 Sébastien Wilmet 2017-03-02 12:17:29 UTC
Also, the Signed-off-by is useless for GtkSourceView, see:
https://lwn.net/Articles/708069/
Comment 4 Philip Withnall 2017-03-02 13:10:16 UTC
Review of attachment 347054 [details] [review]:

::: data/language-specs/python3.lang
@@ +23,3 @@
 <language id="python3" _name="Python 3" version="2.0" _section="Script">
   <metadata>
+    <property name="mimetypes">text/x-python3;application/x-python3</property>

For consistency with python.lang, though it’s probably wrong. shared-mime-info doesn’t have an application/x-python content type since 2004 (https://bugs.freedesktop.org/show_bug.cgi?id=208); so it’s debatable about whether we should list that in python.lang. We definitely shouldn’t list it in python3.lang.
Comment 5 Philip Withnall 2017-03-02 13:11:03 UTC
Created attachment 347064 [details] [review]
language-specs: Add a content type for python3.lang

Bug #100034 in shared-mime-info adds a new text/x-python3 content type
to distinguish Python 3 files from Python 2. Use that if available to
select python3.lang over python.lang.

See https://bugs.freedesktop.org/show_bug.cgi?id=100034.
Comment 6 Sébastien Wilmet 2017-03-02 13:25:47 UTC
Review of attachment 347064 [details] [review]:

accepted, but commit after shared-mime-info patch is merged.
Comment 7 Philip Withnall 2017-03-09 14:01:27 UTC
(In reply to Sébastien Wilmet from comment #6)
> Review of attachment 347064 [details] [review] [review]:
> 
> accepted, but commit after shared-mime-info patch is merged.

shared-mime-info patch has been merged: https://bugs.freedesktop.org/show_bug.cgi?id=100034#c2
Comment 8 Philip Withnall 2017-03-09 14:02:18 UTC
Attachment 347064 [details] pushed as e157a66 - language-specs: Add a content type for python3.lang