def test_create_launcher_without_xdg_dir(self, SettingsMock): """Save a new launcher in an unexisting directory""" shutil.rmtree(self.local_dir) SettingsMock.list_schemas.return_value = ["foo", "bar", "baz"] create_launcher("foo.desktop", self.get_generic_desktop_content()) self.assertTrue(os.path.exists(get_launcher_path("foo.desktop")))
def post_install(self): """Create the Sublime Text Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Sublime Text"), icon_path=os.path.join(self.install_path, "Icon", "128x128", "sublime-text.png"), exec=self.exec_path, comment=_("Sophisticated text editor for code, markup and prose"), categories="Development;TextEditor;"))
def post_install(self): """Create the Twine launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Twine"), icon_path=os.path.join(self.install_path, self.icon_name), exec='"{}" %f'.format(os.path.join(self.install_path, "Twine")), comment=self.description, categories="Development;IDE;"))
def post_install(self): """Create the Visual Studio Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Visual Studio Code"), icon_path=os.path.join(self.install_path, "resources", "app", "vso.png"), exec=os.path.join(self.install_path, "Code"), comment=_("Visual Studio focused on modern web and cloud"), categories="Development;IDE;"))
def post_install(self): """Create the Atom Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Atom"), icon_path=os.path.join(self.install_path, "atom.png"), exec=self.exec_path, comment=_("The hackable text editor"), categories="Development;IDE;"))
def post_install(self): """Create the Twine launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Twine"), icon_path=os.path.join(self.install_path, self.icon_name), exec='"{}" %f'.format(self.exec_path), comment=self.description, categories="Development;IDE;"))
def test_already_existing_file_different_content(self, SettingsMock): """A file with a different file content already exists and is updated""" SettingsMock.list_schemas.return_value = ["foo", "bar", "baz"] result_file = self.write_desktop_file("foo.desktop") create_launcher("foo.desktop", self.get_generic_desktop_content()) self.assertEqual(open(result_file).read(), self.get_generic_desktop_content())
def post_install(self): """Create the Dart Editor launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Dart Editor"), icon_path=os.path.join(self.install_path, "icon.xpm"), exec=os.path.join(self.install_path, "DartEditor"), comment=_("Dart Editor for the dart language"), categories="Development;IDE;"))
def post_install(self): """Create the Firefox Developer launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Firefox Developer Edition"), icon_path=os.path.join(self.install_path, "browser", "icons", "mozicon128.png"), exec=os.path.join(self.install_path, "firefox"), comment=_("Firefox Aurora with Developer tools"), categories="Development;IDE;"))
def test_can_update_launcher(self, SettingsMock): """Update a launcher file""" SettingsMock.list_schemas.return_value = [ "foo", "bar", "com.canonical.Unity.Launcher", "baz" ] SettingsMock.return_value.get_strv.return_value = [ "application://bar.desktop", "unity://running-apps" ] create_launcher("foo.desktop", self.get_generic_desktop_content()) new_content = dedent("""\ [Desktop Entry] Version=1.0 Type=Application Name=Android Studio 2 Icon=/home/didrocks/{install_dir}/android-studio/bin/idea2.png Exec="/home/didrocks/{install_dir}/android-studio/bin/studio2.sh" %f Comment=Develop with pleasure! Categories=Development;IDE; Terminal=false StartupWMClass=jetbrains-android-studio """.format(install_dir=INSTALL_DIR)) create_launcher("foo.desktop", new_content) self.assertTrue(os.path.exists(get_launcher_path("foo.desktop"))) self.assertEqual( open(get_launcher_path("foo.desktop")).read(), new_content)
def post_install(self): """Create the Visual Studio Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Visual Studio Code"), icon_path=os.path.join(self.install_path, "resources", "app", "resources", "linux", "vscode.png"), exec=self.exec_path, comment=_("Visual Studio focused on modern web and cloud"), categories="Development;IDE;"))
def post_install(self): """Create the Netbeans launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Netbeans IDE"), icon_path=join(self.install_path, "nb", "netbeans.png"), exec=self.exec_path, comment=_("Netbeans IDE"), categories="Development;IDE;"))
def test_install_no_schema_file(self, SettingsMock): """No schema file still installs the file""" SettingsMock.list_schemas.return_value = ["foo", "bar", "baz"] create_launcher("foo.desktop", self.get_generic_desktop_content()) self.assertFalse(SettingsMock.return_value.get_strv.called) self.assertFalse(SettingsMock.return_value.set_strv.called) self.assertTrue(os.path.exists(get_launcher_path("foo.desktop")))
def post_install(self): """Create the Processing Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Processing"), icon_path=os.path.join(self.install_path, "lib", "icons", "pde-256.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=_("Processing is a flexible software sketchbook"), categories="Development;IDE;"))
def post_install(self): """Create the launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Base Framework"), icon_path=os.path.join(self.install_path, "bin", "studio.png"), exec='"{}" %f'.format(self.exec_path), comment=_("Base Framework developer environment"), categories="Development;IDE;", extra="StartupWMClass=jetbrains-base-framework"))
def post_install(self): """Create the Blender launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Blender"), icon_path=os.path.join(self.install_path, "icons", "scalable", "apps", "blender.svg"), try_exec=self.exec_path, exec=self.exec_link_name, comment=self.description, categories="Development;IDE;Graphics"))
def post_install(self): """Create the Eagle launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Eagle"), icon_path=os.path.join(self.install_path, "bin", "eagle-logo.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=self.description, categories="Development;"))
def post_install(self): """Create the LightTable Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("LightTable"), icon_path=os.path.join(self.install_path, "resources", "app", "core", "img", "lticon.png"), exec=self.exec_path, comment=_("LightTable code editor"), categories="Development;IDE;"))
def post_install(self): """Create the Android Studio launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Android Studio"), icon_path=os.path.join(self.install_path, "bin", "studio.png"), exec='"{}" %f'.format(os.path.join(self.install_path, "bin", "studio.sh")), comment=_("Android Studio developer environment"), categories="Development;IDE;", extra="StartupWMClass=jetbrains-android-studio"))
def post_install(self): """Create the DBeaver launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=self.name, icon_path=os.path.join(self.install_path, "dbeaver.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=self.description, categories="Development;IDE;"))
def post_install(self): """Create the Stencyl launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Stencyl"), icon_path=os.path.join(self.install_path, "data", "other", "icon-30x30.png"), exec='"{}" %f'.format(os.path.join(self.install_path, "Stencyl")), comment=self.description, categories="Development;IDE;", extra="Path={}\nStartupWMClass=stencyl-sw-Launcher".format(self.install_path)))
def post_install(self): """Create the Superpowers launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Superpowers"), icon_path=os.path.join(self.install_path, "resources", "app", "renderer", "images", "superpowers-256.png"), exec='"{}" %f'.format(self.exec_path), comment=self.description, categories="Development;IDE;"))
def post_install(self): """Create the Android Studio launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Android Studio"), icon_path=os.path.join(self.install_path, "bin", "studio.png"), exec='"{}" %f'.format(os.path.join(self.install_path, "bin", "studio.sh")), comment=_("Android Studio developer environment"), categories="Development;IDE;", extra="StartupWMClass=jetbrains-android"))
def post_install(self): """Create the Stencyl launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Stencyl"), icon_path=os.path.join(self.install_path, "data", "other", "icon-30x30.png"), exec='"{}" %f'.format(self.exec_path), comment=self.description, categories="Development;IDE;", extra="Path={}\nStartupWMClass=stencyl-sw-Launcher".format(self.install_path)))
def post_install(self): """Create the Fritzing launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Fritzing"), icon_path=os.path.join(self.install_path, "icons", "fritzing_icon.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=self.description, categories="Development;"))
def post_install(self): """Create the RStudio launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("RStudio"), icon_path=os.path.join(self.install_path, "rstudio.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=_("RStudio makes R easier to use." "It includes a code editor, debugging & visualization tools."), categories="Development;IDE;"))
def post_install(self): """Create the LiteIDE Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("LiteIDE"), icon_path=os.path.join(self.install_path, "share", "liteide", "welcome", "images", "liteide128.xpm"), try_exec=self.exec_path, exec=self.exec_link_name, comment=_("LiteIDE is a simple, open source, cross-platform Go IDE."), categories="Development;IDE;"))
def post_install(self): """Create the launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Base Framework"), icon_path=os.path.join(self.install_path, "bin", "studio.png"), try_exec=os.path.join(self.install_path, "bin", "studio.sh"), exec=self.exec_link_name, comment=_("Base Framework developer environment"), categories="Development;IDE;", extra="StartupWMClass=jetbrains-base-framework"))
def test_can_install_already_in_launcher(self, SettingsMock): """A file listed in launcher still install the files, but the entry isn't changed""" SettingsMock.list_schemas.return_value = ["foo", "bar", "com.canonical.Unity.Launcher", "baz"] SettingsMock.return_value.get_strv.return_value = ["application://bar.desktop", "application://foo.desktop", "unity://running-apps"] create_launcher("foo.desktop", self.get_generic_desktop_content()) self.assertFalse(SettingsMock.return_value.set_strv.called) self.assertTrue(os.path.exists(get_launcher_path("foo.desktop")))
def post_install(self): """Create the Spring Tools Suite launcher""" categories = "Development;IDE;" create_launcher(self.desktop_filename, get_application_desktop_file(name=_(self.name), icon_path=os.path.join(self.install_path, self.icon_filename), exec='"{}" %f'.format(self.exec_path), comment=_(self.description), categories=categories))
def post_install(self): """Create the GDevelop launcher""" DownloadCenter(urls=[DownloadItem(self.icon_url, None)], on_done=self.save_icon, download=True) create_launcher(self.desktop_filename, get_application_desktop_file(name=_("GDevelop"), icon_path=os.path.join(self.install_path, self.icon_filename), try_exec=self.exec_path, exec=self.exec_link_name, comment=self.description, categories="Development;IDE;"))
def post_install(self): """Create the Visual Studio Code launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Visual Studio Code"), icon_path=os.path.join(self.install_path, "resources", "app", "resources", "linux", "code.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=_("Visual Studio focused on modern web and cloud"), categories="Development;IDE;", extra="StartupWMClass=Code"))
def post_install(self): """Create the Android Studio launcher""" add_env_to_user(self.name, {"ANDROID_HOME": {"value": self.install_path, "keep": False}}) create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Android Studio"), icon_path=os.path.join(self.install_path, "bin", "studio.png"), try_exec=os.path.join(self.install_path, "bin", "studio.sh"), exec=self.exec_link_name, comment=_("Android Studio developer environment"), categories="Development;IDE;", extra="StartupWMClass=jetbrains-studio"))
def test_can_install_without_unity_running(self, SettingsMock): """Install a basic launcher icon, without a running apps entry (so will be last)""" SettingsMock.list_schemas.return_value = ["foo", "bar", "com.canonical.Unity.Launcher", "baz"] SettingsMock.return_value.get_strv.return_value = ["application://bar.desktop", "application://baz.desktop"] create_launcher("foo.desktop", self.get_generic_desktop_content()) self.assertTrue(SettingsMock.list_schemas.called) SettingsMock.return_value.set_strv.assert_called_with("favorites", ["application://bar.desktop", "application://baz.desktop", "application://foo.desktop"])
def post_install(self): """Create the Firefox Developer launcher""" create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Firefox Developer Edition"), icon_path=os.path.join(self.install_path, "browser", "chrome", "icons", "default", "default128.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=_("Firefox Aurora with Developer tools"), categories="Development;IDE;", extra="StartupWMClass=Firefox Developer Edition"))
def post_install(self): """Create the Dart Editor launcher""" create_launcher( self.desktop_filename, get_application_desktop_file( name=_("Dart Editor"), icon_path=os.path.join(self.install_path, "icon.xpm"), exec=os.path.join(self.install_path, "DartEditor"), comment=_("Dart Editor for the dart language"), categories="Development;IDE;"))
def post_install(self): """Create the Atom Code launcher""" # Add apm to PATH add_exec_link(os.path.join(self.install_path, "resources", "app", "apm", "bin", "apm"), os.path.join(self.default_binary_link_path, 'apm')) create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Atom"), icon_path=os.path.join(self.install_path, "atom.png"), try_exec=self.exec_path, exec=self.exec_link_name, comment=_("The hackable text editor"), categories="Development;IDE;"))
def post_install(self): """Create the Android Studio launcher""" add_env_to_user(self.name, {"ANDROID_HOME": {"value": self.install_path, "keep": False}, "ANDROID_SDK": {"value": self.install_path, "keep": False}}) create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Android Studio"), icon_path=os.path.join(self.install_path, "bin", "studio.png"), try_exec=os.path.join(self.install_path, "bin", "studio.sh"), exec=self.exec_link_name, comment=_("Android Studio developer environment"), categories="Development;IDE;", extra="StartupWMClass=jetbrains-studio"))
def post_install(self): """Create the Firefox Developer launcher""" create_launcher( self.desktop_filename, get_application_desktop_file( name=_("Firefox Developer Edition"), icon_path=os.path.join(self.install_path, "browser", "icons", "mozicon128.png"), exec=os.path.join(self.install_path, "firefox"), comment=_("Firefox Aurora with Developer tools"), categories="Development;IDE;"))
def post_install(self): """Create the appropriate JetBrains launcher.""" icon_path = join(self.install_path, 'bin', self.icon_filename) comment = self.description + " (UDTC)" categories = "Development;IDE;" create_launcher(self.desktop_filename, get_application_desktop_file(name=self.name, icon_path=icon_path, exec='"{}" %f'.format(self.exec_path), comment=comment, categories=categories))
def post_install(self): """Create the Unity 3D launcher and setuid chrome sandbox""" with futures.ProcessPoolExecutor(max_workers=1) as executor: # chrome sandbox requires this: https//code.google.com/p/chromium/wiki/LinuxSUIDSandbox f = executor.submit(_chrome_sandbox_setuid, os.path.join(self.install_path, "Editor", "chrome-sandbox")) if not f.result(): UI.return_main_screen(exit_status=1) create_launcher(self.desktop_filename, get_application_desktop_file(name=_("Unity3D Editor"), icon_path=os.path.join(self.install_path, "unity-editor-icon.png"), exec=os.path.join(self.install_path, "Editor", "Unity"), comment=self.description, categories="Development;IDE;"))