예제 #1
0
    def testCreateShortcut(self):
        setupWizard = SetupWizard("Mock setup wizard")
        setupWizard.init()

        WineShortcut.wizard(setupWizard).withName("Shortcut name")\
            .withExecutableName("winecfg")\
            .withArguments(["argument 1", "argument 2"])\
            .withWineDebug("-all")\
            .withWorkingDirectory("Working directory")\
            .withWinePrefix("Wine prefix")\
            .create()

        shortcuts = Environment.getShortcutsPath()
        shortcut = os.path.join(shortcuts, "Shortcut name")

        shortcutFileContent = open(shortcut, "r").read()

        shortcutJson = json.loads(shortcutFileContent)

        self.assertEquals("com.playonlinux.library.shortcuts.WineShortcut", shortcutJson["@class"])
        self.assertEquals("-all", shortcutJson["wineDebug"])
        self.assertEquals("Wine prefix", shortcutJson["winePrefix"])
        self.assertEquals("Working directory", shortcutJson["workingDirectory"])
        self.assertEquals("winecfg", shortcutJson["executableName"])
        self.assertEquals("argument 1", shortcutJson["arguments"][0])
        self.assertEquals("argument 2", shortcutJson["arguments"][1])

        setupWizard.close()
예제 #2
0
    def testCreateShortcut(self):
        setupWizard = SetupWizard("Mock setup wizard")
        setupWizard.init()

        WineShortcut.wizard(setupWizard).withName("Shortcut name")\
            .withExecutableName("winecfg")\
            .withArguments(["argument 1", "argument 2"])\
            .withWineDebug("-all")\
            .withWorkingDirectory("Working directory")\
            .withWinePrefix("Wine prefix")\
            .create()

        shortcuts = Environment.getShortcutsPath()
        shortcut = os.path.join(shortcuts, "Shortcut name")

        shortcutFileContent = open(shortcut, "r").read()

        shortcutJson = json.loads(shortcutFileContent)

        self.assertEquals("com.playonlinux.library.shortcuts.WineShortcut",
                          shortcutJson["@class"])
        self.assertEquals("-all", shortcutJson["wineDebug"])
        self.assertEquals("Wine prefix", shortcutJson["winePrefix"])
        self.assertEquals("Working directory",
                          shortcutJson["workingDirectory"])
        self.assertEquals("winecfg", shortcutJson["executableName"])
        self.assertEquals("argument 1", shortcutJson["arguments"][0])
        self.assertEquals("argument 2", shortcutJson["arguments"][1])

        setupWizard.close()
예제 #3
0
        def POL_Shortcut(self):
            setupWindowId = self.command[2]
            setupWindow = self.setupWindowManager.getWindow(setupWindowId)

            winePrefix = self.command[3]
            binary = self.command[4]
            shortcutName = self.command[5]
            websiteIcon = self.command[6]
            argument = self.command[7]
            categories = self.command[8]

            WineShortcut.wizard(setupWindow)\
                .withArguments([argument])\
                .withExecutableName(binary)\
                .withWinePrefix(winePrefix)\
                .withName(shortcutName)\
                .create()
예제 #4
0
        def POL_Shortcut(self):
            setupWindowId = self.command[2]
            setupWindow = self.setupWindowManager.getWindow(setupWindowId)

            winePrefix = self.command[3]
            binary = self.command[4]
            shortcutName = self.command[5]
            websiteIcon = self.command[6]
            argument = self.command[7]
            categories = self.command[8]

            WineShortcut.wizard(setupWindow)\
                .withArguments([argument])\
                .withExecutableName(binary)\
                .withWinePrefix(winePrefix)\
                .withName(shortcutName)\
                .create()