def create_launcher(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", "idea.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 create_launcher(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", "idea.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"))
     # add adb and other android tools to PATH
     paths_to_add = [os.path.join(self.install_path, "sdk", "platform-tools"),
                     os.path.join(self.install_path, "sdk", "tools")]
     add_to_user_path(paths_to_add, self.name)
    def test_get_application_desktop_file_all_empty(self):
        """We return expect results without any content"""
        self.assertEquals(tools.get_application_desktop_file(),
                          dedent("""\
                            [Desktop Entry]
                            Version=1.0
                            Type=Application
                            Name=
                            Icon=
                            Exec=
                            Comment=
                            Categories=
                            Terminal=false

                            """))
 def create_launcher(self):
     """Create the ADT launcher"""
     # copy the adt icon to local folder (as the icon is in a .*version folder, not stable)
     copy_icon(os.path.join(self.install_path,
                            'eclipse/plugins/com.android.ide.eclipse.adt.package*/icons/adt48.png'),
               self.icon_filename)
     create_launcher(self.desktop_filename, get_application_desktop_file(name=_("ADT Eclipse"),
                     icon_path=os.path.splitext(self.icon_filename)[0],
                     exec='"{}" %f'.format(os.path.join(self.install_path, "eclipse", "eclipse")),
                     comment=_("Android Developer Tools (using eclipse)"),
                     categories="Development;IDE;"))
     # add adb and other android tools to PATH
     paths_to_add = [os.path.join(self.install_path, "sdk", "platform-tools"),
                     os.path.join(self.install_path, "sdk", "tools")]
     add_to_user_path(paths_to_add, self.name)
    def test_get_application_desktop_file(self):
        """We return expect results with normal content"""
        self.assertEquals(tools.get_application_desktop_file(name="Name 1", icon_path="/to/icon/path",
                                                             exec="/to/exec/path %f", comment="Comment for Name 1",
                                                             categories="Cat1:Cat2"),
                          dedent("""\
                            [Desktop Entry]
                            Version=1.0
                            Type=Application
                            Name=Name 1
                            Icon=/to/icon/path
                            Exec=/to/exec/path %f
                            Comment=Comment for Name 1
                            Categories=Cat1:Cat2
                            Terminal=false

                            """))