Exemplo n.º 1
0
def run_all(n, childprocess_param, virtual_only=True, bbox=None):
    debug = True
    print("")
    print("n=%s" % n)
    print("------------------------------------------------------")

    if bbox:
        x1, y1, x2, y2 = map(str, bbox)
        bbox = ":".join(map(str, (x1, y1, x2, y2)))
        bboxpar = ["--bbox", bbox]
    else:
        bboxpar = []
    if debug:
        debugpar = ["--debug"]
    else:
        debugpar = []
    for x in ["default"] + pyscreenshot.backends():
        backendpar = ["--backend", x]
        # skip non X backends
        if virtual_only and x in novirt:
            continue
        p = run_mod_as_subproc(
            "pyscreenshot.check.speedtest",
            ["--childprocess", childprocess_param] + bboxpar + debugpar +
            backendpar,
        )
        print(p.stdout)
Exemplo n.º 2
0
def print_versions():
    print_name_version('pyscreenshot', pyscreenshot.__version__)
    
    for name in pyscreenshot.backends():
        v=backend_version(name, childprocess=True)
        if not v:
            v = 'missing'
        print_name_version(name, v)
Exemplo n.º 3
0
def print_versions():
    print_name_version('pyscreenshot', pyscreenshot.__version__)

    for name in pyscreenshot.backends():
        v = backend_version(name, childprocess=True)
        if not v:
            v = 'missing'
        print_name_version(name, v)
Exemplo n.º 4
0
def print_versions():
    print_name_version("python", platform.python_version())
    print_name_version("pyscreenshot", pyscreenshot.__version__)

    for name in pyscreenshot.backends():
        v = backend_version(name, childprocess=True)
        if not v:
            v = "missing"
        print_name_version(name, v)
Exemplo n.º 5
0
def print_versions():
    print_name_version("python", platform.python_version())
    print_name_version("pyscreenshot", pyscreenshot.__version__)

    for name in pyscreenshot.backends():
        v = backend_version(name)
        if not v:
            v = ""
        print_name_version(name, v)
Exemplo n.º 6
0
def print_versions():
    print_name('pyscreenshot')
    print pyscreenshot.__version__
    for name in pyscreenshot.backends():
        pyscreenshot.BACKEND_LOADER.force(name)
        print_name(name)
        try:
            x = pyscreenshot.BACKEND_LOADER.selected()
            print x.backend_version()
        except Exception:
            print 'missing'
Exemplo n.º 7
0
def run_all(n, to_file, bbox=None):
    print
    print 'n=%s' % n, ', to_file:', to_file, ', bounding box:', bbox
    print '------------------------------------------------------'

    for x in pyscreenshot.backends():
        try:
            run(x, n, to_file, bbox)
#            print 'grabbing by '+x
        except pyscreenshot.FailedBackendError as e:
            print e
Exemplo n.º 8
0
def show():
    im = []

    for x in backends():
        try:
            print 'grabbing by ' + x
            im.append(ImageGrab.grab(bbox=(500, 400, 800, 600), backend=x))
        except BackendLoaderError as e:
            print e
    print im
    for x in im:
        x.show()
        time.sleep(1)
Exemplo n.º 9
0
def show():
    im = []

    for x in backends():
        try:
            print 'grabbing by ' + x
            im.append(ImageGrab.grab(bbox=(500, 400, 800, 600), backend=x))
        except pyscreenshot.FailedBackendError as e:
            print e
    print im
    for x in im:
        x.show()
        time.sleep(1)
Exemplo n.º 10
0
def show():
    im = []

    for x in backends():
        try:
            print('grabbing by ' + x)
            im.append(ImageGrab.grab(bbox=(500, 400, 800, 600), backend=x))
        except FailedBackendError as e:
            print(e)
    print(im)
    for x in im:
        x.show()
        time.sleep(1)
Exemplo n.º 11
0
def run_all(bgcolor, display, bbox):
    print
    print 'bgcolor=', bgcolor
    print '-------------------------------------'
    for x in pyscreenshot.backends():
        try:
            with Display(size=display, bgcolor=bgcolor):
#                time.sleep(1)
                try:
                    run(x, bbox, bgcolor=bgcolor)
                except pyscreenshot.FailedBackendError as e:
                    print e
        except Exception as e:
            print e
Exemplo n.º 12
0
def run_all(n):
    print('')

    s = ''
    s += 'n=%s' % n
    print(s)

    print('------------------------------------------------------')

    for x in pyscreenshot.backends():
        try:
            run(x, n)
        except pyscreenshot.FailedBackendError as e:
            print(e)
Exemplo n.º 13
0
def run_all(n):
    print('')

    s = ''
    s += 'n=%s' % n
    print(s)

    print('------------------------------------------------------')

    for x in pyscreenshot.backends():
        try:
            run(x, n)
        except pyscreenshot.FailedBackendError as e:
            print(e)
Exemplo n.º 14
0
def run_all(bgcolor, display, bbox):
    print
    print 'bgcolor=', bgcolor
    print '-------------------------------------'
    for x in pyscreenshot.backends():
        try:
            with Display(size=display, bgcolor=bgcolor):
                #                time.sleep(1)
                try:
                    run(x, bbox, bgcolor=bgcolor)
                except pyscreenshot.FailedBackendError as e:
                    print e
        except Exception as e:
            print e
Exemplo n.º 15
0
def run_all(n, bbox=None):
    print('')

    s = ''
    s += 'n=%s' % n
    s += '\t'
    s += ' bounding box: {}'.format(bbox)
    print(s)

    print('------------------------------------------------------')

    for x in pyscreenshot.backends():
        try:
            run(x, n, bbox)
        except pyscreenshot.FailedBackendError as e:
            print(e)
Exemplo n.º 16
0
def show():
    im = []
    blist = []

    for x in backends():
        try:
            print("--> grabbing by " + x)
            im.append(pyscreenshot.grab(bbox=(500, 400, 800, 600), backend=x))
            blist.append(x)
        except Exception as e:
            print(e)
    print(im)
    print(blist)
    for x in im:
        x.show()
        time.sleep(1)
Exemplo n.º 17
0
def run_all(n, childprocess, virtual_only=True):
    print("")
    print("n=%s" % n)
    print("------------------------------------------------------")

    for x in pyscreenshot.backends():
        if virtual_only and x == "gnome-screenshot":
            continue
        if childprocess:
            try:
                run(x, n, True)
            except pyscreenshot.FailedBackendError:
                pass
        else:
            p = proc("pyscreenshot.check.speedtest", ["--backend", x])
            print(p.stdout)
Exemplo n.º 18
0
def run_all(n, virtual_only=True):
    print('')

    s = ''
    s += 'n=%s' % n
    print(s)

    print('------------------------------------------------------')

    for x in pyscreenshot.backends():
        if virtual_only and x == 'gnome-screenshot':
            continue
        try:
            run(x, n)
        except pyscreenshot.FailedBackendError as e:
            print(e)
Exemplo n.º 19
0
def run_all(n, to_file, bbox=None):
    print('')

    s = ''
    s += 'n=%s' % n
    s += '\t'
    s += ' to_file: %s' % to_file
    s += '\t'
    s += ' bounding box: {}'.format(bbox)
    print(s)

    print('------------------------------------------------------')

    for x in pyscreenshot.backends():
        try:
            run(x, n, to_file, bbox)
        except pyscreenshot.FailedBackendError as e:
            print(e)
Exemplo n.º 20
0
def run_all(n, to_file, bbox=None):
    print('')

    s = ''
    s += 'n=%s' % n
    s += '\t'
    s += ' to_file: %s' % to_file
    s += '\t'
    s += ' bounding box: %s' % (bbox, )
    print(s)

    print('------------------------------------------------------')

    for x in pyscreenshot.backends():
        try:
            run(x, n, to_file, bbox)
        except pyscreenshot.FailedBackendError as e:
            print(e)
Exemplo n.º 21
0
def teste():
    print(ImageGrab.backends())
    im = ImageGrab.grab(bbox=None, backend='gnome-screenshot', childprocess='gnome-calculator')
    im.save('screenShot1.jpg', 'jpeg')