示例#1
0
def create_pool():
    if is_wine() or(PY3 and is_windows()):
        # ProcessPoolExecutor is broken under wine, and under py3+msys2
        # https://github.com/Alexpux/MINGW-packages/issues/837
        return ThreadPoolExecutor(1)
    else:
        return ProcessPoolExecutor(None)
示例#2
0
def create_pool():
    if is_wine() or(PY3 and is_windows()):
        # ProcessPoolExecutor is broken under wine, and under py3+msys2
        # https://github.com/Alexpux/MINGW-packages/issues/837
        return ThreadPoolExecutor(1)
    else:
        return ProcessPoolExecutor(None)
示例#3
0
 def test_get_link_target_unicode(self):
     path = os.path.join(DATA_DIR, "test2.lnk")
     d = windows.get_link_target(path)
     self.assertTrue(isinstance(d, unicode))
     if is_wine():
         # wine doesn't support unicode paths here..
         self.assertEqual(os.path.basename(d), u"\xe1??.txt")
     else:
         self.assertEqual(os.path.basename(d), u"\xe1\U00016826.txt")
示例#4
0
 def test_get_link_target_unicode(self):
     path = get_data_path("test2.lnk")
     d = windows.get_link_target(path)
     self.assertTrue(isinstance(d, text_type))
     if is_wine():
         # wine doesn't support unicode paths here..
         self.assertEqual(os.path.basename(d), u"\xe1??.txt")
     else:
         self.assertEqual(os.path.basename(d), u"\xe1\U00016826.txt")
示例#5
0
def create_pool():
    if is_wine():
        # ProcessPoolExecutor is broken under wine
        return ThreadPoolExecutor(1)
    else:
        return ProcessPoolExecutor(None)
示例#6
0
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

from gi.repository import Gtk
from senf import fsnative, getcwd

from quodlibet.qltk.chooser import choose_files, get_current_dir, \
    set_current_dir, choose_folders, create_chooser_filter, \
    choose_target_file, choose_target_folder, with_response
from quodlibet.qltk import gtk_version
from quodlibet.util import is_osx, is_wine

from . import TestCase, skipIf


@skipIf(is_wine(), "hangs under wine")
@skipIf(gtk_version < (3, 16, 0) or is_osx(), "crashy on older gtk+ and macOS")
class Tchooser(TestCase):
    def test_choose_files(self):
        w = Gtk.Window()
        with with_response(Gtk.ResponseType.CANCEL):
            assert choose_files(w, u"title", u"action") == []

    def test_choose_folders(self):
        w = Gtk.Window()
        with with_response(Gtk.ResponseType.CANCEL):
            assert choose_folders(w, u"title", u"action") == []

    def test_choose_filter(self):
        cf = create_chooser_filter(u"filter", ["*.txt"])
        assert isinstance(cf, Gtk.FileFilter)