Skip to content

Commit 2144fb3

Browse files
Fix Create Desktop Shortcut
1 parent 07cfe31 commit 2144fb3

File tree

10 files changed

+413
-27
lines changed

10 files changed

+413
-27
lines changed

CHANGELOG.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ when selecting in Tree shows the filename in StatusBar.
2424
- Modified import statements to allow running RIDE without Robot Framework installed or versions older than 6.0.
2525
- On Windows ignore false modification on files when opening Test Suites, causing confirmation dialog.
2626

27+
=== Fixed
28+
- Fixed Create Desktop Shortcut by pointing executable to ``python -m robotide``.
29+
2730
== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.1.3.rst[2.1.3] - 2025-03-24
2831

2932
=== Added

README.adoc

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

4242
`pip install -U robotframework-ride`
4343

44-
(3.8 <= python <= 3.13) Install current development version (**2.2dev27**) with:
44+
(3.8 <= python <= 3.13) Install current development version (**2.2dev28**) with:
4545

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

src/robotide/application/CHANGELOG.html

Lines changed: 18 additions & 16 deletions
Large diffs are not rendered by default.

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def set_content(self, html_win, content):
172172
</ul>
173173
<p><strong>New Features and Fixes Highlights</strong></p>
174174
<ul class="simple">
175+
<li>Fixed Create Desktop Shortcut by pointing executable to <b>python -m robotide</b>.</li>
175176
<li>Changed arguments parser to allow <b>--version</b> and <b>--help</b> functional in Windows.</li>
176177
<li>Improved auto-complete in Grid Editor, to allow several matches.</li>
177178
<li>Fixed white blocks on Tree due to failed animation when test execution is too rapid, causing crash on Windows.</li>
@@ -239,7 +240,7 @@ def set_content(self, html_win, content):
239240
<pre class="literal-block">python -m robotide.postinstall -install</pre>
240241
<p>or</p>
241242
<pre class="literal-block">ride_postinstall.py -install</pre>
242-
<p>RIDE {VERSION} was released on 20/May/2025.</p>
243+
<p>RIDE {VERSION} was released on 25/May/2025.</p>
243244
<!-- <br/>
244245
<h3>May The Fourth Be With You!</h3>
245246
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>

src/robotide/postinstall/RIDE.app/Contents/Info.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<key>CFBundleExecutable</key>
2121
<string>RIDE</string>
2222
<key>CFBundleGetInfoString</key>
23-
<string>2.0b2, (c) 2016- Robot Framework Foundation.</string>
23+
<string>2.1.4, (c) 2016- Robot Framework Foundation.</string>
2424
<key>CFBundleHelpBookFolder</key>
2525
<array>
2626
<string>Documentation</string>
@@ -37,17 +37,17 @@
3737
<key>CFBundleInfoDictionaryVersion</key>
3838
<string>6.0</string>
3939
<key>CFBundleLongVersionString</key>
40-
<string>2.0b2, (c) 2016- Robot Framework Foundation.</string>
40+
<string>2.1.4, (c) 2016- Robot Framework Foundation.</string>
4141
<key>CFBundleName</key>
4242
<string>RIDE</string>
4343
<key>CFBundlePackageType</key>
4444
<string>APPL</string>
4545
<key>CFBundleShortVersionString</key>
46-
<string>2.0b2</string>
46+
<string>2.1.4</string>
4747
<key>CFBundleSignature</key>
4848
<string>RIDE</string>
4949
<key>CFBundleVersion</key>
50-
<string>2.0b2</string>
50+
<string>2.1.4</string>
5151
<key>CSResourcesFileMapped</key>
5252
<true/>
5353
<key>LSRequiresCarbon</key>

src/robotide/postinstall/RIDE.app/Contents/MacOS/RIDE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ for i in `cat /etc/paths`
66
done
77
PATH=$PAL
88
export $PATH
9-
/usr/bin/python3 -m robotide.__init__ $* 2> /dev/null &
9+
/usr/bin/python3 -m robotide $* 2> /dev/null &

src/robotide/postinstall/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ def _create_buttons(self, sizer, no_default=False):
122122
if no_default:
123123
flags |= wx.NO_DEFAULT
124124
buttons = self.CreateStdDialogButtonSizer(flags)
125+
if not no_default:
126+
buttons.SetAffirmativeButton(buttons.GetItemById(wx.OK))
125127
self.SetBackgroundColour(Colour(self.color_background))
126128
self.SetForegroundColour(Colour(self.color_foreground))
127129
for item in self.GetChildren():
@@ -223,7 +225,7 @@ def _create_desktop_shortcut_linux(frame=None):
223225
roboticon = join("FIXME: find correct path to: .../site-packages/", "robotide", "widgets", ROBOT_ICO)
224226
with open(link, "w+") as shortcut:
225227
shortcut.write(f"#!/usr/bin/env xdg-open\n[Desktop Entry]\n"
226-
f"Exec={sys.executable} -m robotide.__init__\n"
228+
f"Exec={sys.executable} -m robotide\n"
227229
f"Comment=A Robot Framework IDE\nGenericName=RIDE\n"
228230
f"Icon={roboticon}\n"
229231
f"Name=RIDE\nStartupNotify=true\nTerminal=false\n"
@@ -248,7 +250,7 @@ def _create_desktop_shortcut_mac(frame=None):
248250
app_script = os.path.join(ride_app_module_path, 'Contents', 'MacOS', 'RIDE')
249251
with open(app_script, 'w+') as shortcut:
250252
shortcut.write("#!/bin/sh\nPAL=$PATH\nfor i in `cat /etc/paths`\n do\n PAL=\"$PAL:$i\"\n"
251-
" done\nPATH=$PAL\nexport $PATH\n{} -m robotide.__init__ $* 2>"
253+
" done\nPATH=$PAL\nexport $PATH\n{} -m robotide $* 2>"
252254
" /dev/null &\n".format(sys.executable))
253255
if exists(ride_app_pc_path):
254256
shutil.rmtree(ride_app_pc_path, True)
@@ -290,7 +292,7 @@ def _create_desktop_shortcut_windows(frame=None):
290292
shortcut = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None,
291293
pythoncom.CLSCTX_INPROC_SERVER,
292294
shell.IID_IShellLink)
293-
command_args = " -c \"from robotide import main; main()\""
295+
command_args = " -m robotide "
294296
shortcut.SetPath(sys.executable.replace('python.exe', 'pythonw.exe'))
295297
shortcut.SetArguments(command_args)
296298
shortcut.SetDescription("Robot Framework testdata editor")

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.2dev27'
18+
VERSION = 'v2.2dev28'

utest/application/test_app_main.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,26 @@ def test_missing_wx(self): # This test passed in PyCharm but not when run in co
4646
import robotide
4747
print(dir(robotide))
4848

49+
@pytest.mark.order(2)
50+
def test_postinstall_wx(self): # This test passed in PyCharm but not when run in command line
51+
with MonkeyPatch().context() as m:
52+
with pytest.raises((ImportError, SystemExit)): # (ImportError, ModuleNotFoundError, SystemExit)):
53+
sys.modules.pop('wx.Color', None)
54+
builtins.__import__ = myimport
55+
import robotide.postinstall
56+
from wx import Colour
57+
print(dir(robotide.postinstall), dir(Colour))
58+
59+
@pytest.mark.order(3)
60+
def test_fail_verify(self):
61+
with MonkeyPatch().context() as m:
62+
with pytest.raises(SystemExit):
63+
sys.modules.pop('wx.version', None)
64+
builtins.__import__ = myimport
65+
from robotide.postinstall import verify_install
66+
result = verify_install()
67+
assert not result
68+
4969

5070
builtins.__import__ = real_import
5171

0 commit comments

Comments
 (0)