Skip to content

Commit af9f105

Browse files
Improvement to open binary files on their registered apps from File Explorer.
1 parent 6393757 commit af9f105

File tree

7 files changed

+29
-5
lines changed

7 files changed

+29
-5
lines changed

CHANGELOG.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ All notable changes to this project will be documented in this file.
66
The format is based on http://keepachangelog.com/en/1.0.0/[Keep a Changelog]
77
and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioning].
88

9-
// == https://github.com/robotframework/RIDE[Unreleased]
9+
== https://github.com/robotframework/RIDE[Unreleased]
10+
11+
=== Changed
12+
- In File Explorer opening non-text files is done by the operating system registered app. Text files are opened in simple editor, or RIDE if valid types.
13+
1014

1115
== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.2.1.1.rst[2.2.1.1] - 2025-12-08
1216

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Likewise, the current version of wxPython, is 4.2.3, but RIDE is known to work w
4646

4747
`pip install -U robotframework-ride`
4848

49-
(3.9 <= python <= 3.14) Install current development version (**2.2.1.1**) with:
49+
(3.9 <= python <= 3.14) Install current development version (**2.2.2dev1**) with:
5050

5151
`pip install -U https://github.com/robotframework/RIDE/archive/develop.zip`
5252

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ classifiers = [
4545
"Topic :: Software Development :: Testing",
4646
]
4747
dependencies = [
48+
"isbinary",
4849
"psutil",
4950
"Pygments",
5051
"PyPubSub",

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Pywin32; sys_platform == 'win32'
44
Pygments # This enables syntax highlighted in Text Editor
55
robotframework
66
Pypubsub
7+
isbinary
78
psutil
89
packaging
910
requests>=2.32.4

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ def set_content(self, html_win, content):
177177
</ul>
178178
<p><strong>New Features and Fixes Highlights</strong></p>
179179
<ul class="simple">
180+
<li>In File Explorer opening non-text files is done by the operating system registered app.</li>
180181
<li>Added context menu to File Explorer, to Open test suites directories or test suites files (also with double-click).
181182
</li>
182183
<li>Added context menu option to Open Containing Folder, in operating system file explorer, or specific tool.</li>
@@ -238,7 +239,7 @@ def set_content(self, html_win, content):
238239
<pre class="literal-block">python -m robotide.postinstall -install</pre>
239240
<p>or</p>
240241
<pre class="literal-block">ride_postinstall.py -install</pre>
241-
<p>RIDE {VERSION} was released on 08/December/2025.</p>
242+
<p>RIDE {VERSION} was released on 13/December/2025.</p>
242243
<br/>
243244
<!--
244245
<h3>Celebrate the bank holiday, 1st December, Restoration of the Independence of Portugal (from Spain in 1640)!!</h3>

src/robotide/ui/mainframe.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
import builtins
1717
import os
18+
import subprocess
19+
import sys
1820

1921
import wx
2022
import wx.lib.agw.aui as aui
@@ -42,6 +44,7 @@
4244
from ..ui.tagdialogs import ViewAllTagsDialog
4345
from ..utils import RideFSWatcherHandler
4446
from ..widgets import RIDEDialog, ImageProvider, HtmlWindow
47+
from isbinary import is_binary_file
4548

4649
_ = wx.GetTranslation # To keep linter/code analyser happy
4750
builtins.__dict__['_'] = wx.GetTranslation
@@ -81,6 +84,17 @@ def get_menudata():
8184
help_3 + help_4 + help_6 + help_7)
8285

8386

87+
def start_external_app(file_path):
88+
if sys.platform.startswith('darwin'): # macOS
89+
subprocess.call(['open', file_path])
90+
elif sys.platform.startswith('win32'): # Windows
91+
subprocess.call(['cmd', '/c', 'start', file_path], shell=True)
92+
elif sys.platform.startswith('linux'): # Linux
93+
subprocess.call(['xdg-open', file_path])
94+
else:
95+
print('Unsupported OS')
96+
97+
8498
class RideFrame(wx.Frame):
8599

86100
_menudata_nt = """[File]
@@ -464,7 +478,10 @@ def on_open_file(self, event):
464478
return
465479
if self.open_suite(path):
466480
return
467-
customsourceeditor.main(path)
481+
if not is_binary_file(path):
482+
customsourceeditor.main(path)
483+
else:
484+
start_external_app(path)
468485

469486
def on_menu_open_file(self, event):
470487
if not self.filemgr:

src/robotide/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.2.1.1'
18+
VERSION = 'v2.2.2dev1'

0 commit comments

Comments
 (0)