Esempio n. 1
0
    def testInstallWineVersion(self):
        time.sleep(2)
        ServiceManagerGetter().init(
            "com.playonlinux.contexts.WineVersionServicesContext")

        setupWizard = SetupWizard("Mock setup wizard")
        setupWizard.init()

        wineVersionManager = ServiceManagerGetter.serviceManager.getService(
            WineVersionManager)

        while (wineVersionManager.isUpdating()):
            print "Updating wine version list..."
            time.sleep(2)

        if (wineVersionManager.hasFailed()):
            raise Exception("Failed to download the list of wineversions")

        wineInstallation = WineVersion("1.7.36", "upstream-x86", setupWizard)
        wineInstallation.install()

        installationPath = "%s/engines/wine/upstream-%s-x86/1.7.36/bin/wine" %\
                           (Environment.getUserRoot(), OperatingSystem.fetchCurrentOperationSystem().getNameForWinePackages())

        ServiceManagerGetter.serviceManager.shutdown()

        print "Checking that wine binary is installed in %s" % installationPath

        self.assertTrue(os.path.exists(installationPath))
Esempio n. 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()
Esempio n. 3
0
    def testInstallWineVersion(self):
        time.sleep(2)
        ServiceManagerGetter().init("com.playonlinux.contexts.WineVersionServicesContext")

        setupWizard = SetupWizard("Mock setup wizard")
        setupWizard.init()

        wineVersionManager = ServiceManagerGetter.serviceManager.getService(WineVersionManager)

        while(wineVersionManager.isUpdating()):
            print "Updating wine version list..."
            time.sleep(2)

        if(wineVersionManager.hasFailed()):
            raise Exception("Failed to download the list of wineversions")

        wineInstallation = WineVersion("1.7.36", "upstream-x86", setupWizard)
        wineInstallation.install()

        installationPath = "%s/engines/wine/upstream-%s-x86/1.7.36/bin/wine" %\
                           (Environment.getUserRoot(), OperatingSystem.fetchCurrentOperationSystem().getWinePackage())

        ServiceManagerGetter.serviceManager.shutdown()

        print "Checking that wine binary is installed in %s" % installationPath

        self.assertTrue(os.path.exists(installationPath))
Esempio n. 4
0
    def main(self):
        setupWindow = SetupWizard("TITLE")

        print "Hello from python!"

        setupWindow.message("Test\nTest")
        setupWindow.message("Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 " +
                                  "Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 " +
                                  "Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 ")

        result = setupWindow.textbox("Test 3")
        print result

        setupWindow.message("Test 4")
        setupWindow.message("Test 5")

        setupWindow.close()
Esempio n. 5
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()
Esempio n. 6
0
import com.playonlinux.framework.SetupWizard as POL_SetupWindow

setupWindow = POL_SetupWindow("TITLE")

print "Hello from python!"

setupWindow.message("Test\nTest")
setupWindow.message("Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 " +
                          "Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 " +
                          "Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 ")

result = setupWindow.textbox("Test 3")
print result

setupWindow.message("Test 4")
setupWindow.message("Test 5")

setupWindow.close()

Esempio n. 7
0
from com.playonlinux.framework import SetupWizard

setupWindow = SetupWizard("TITLE")

print "Hello from python!"

# -----BEGIN PGP SIGNATURE-----
# Version: GnuPG/MacGPG2 v2.0.17 (Darwin)

# MOCKED SIGNATURE (PYTHON)
# -----END PGP SIGNATURE-----

setupWindow.message("Test\nTest")
setupWindow.message("Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 " +
                          "Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 " +
                          "Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 Test 2 ");

result = setupWindow.textbox("Test 3")
print result

setupWindow.message("Test 4")
setupWindow.message("Test 5")

Esempio n. 8
0
 def newWindow(self, windowId, title):
     self.managedWindows[windowId] = SetupWizard(title)
     return self.managedWindows[windowId]