コード例 #1
0
def test_other_conversions():
    """Scenario: test other output conversion options.
   
    """
    device_list = devices.devices('Other')
    for x in device_list:
        yield convert_to_format, x
コード例 #2
0
def test_android_conversions():
    """Scenario: test each android conversion option.
   
    """
    device_list = devices.devices('Android')
    for x in device_list:
        yield convert_to_format, x
コード例 #3
0
def test_android_conversions():
    """Scenario: test each android conversion option.
   
    """
    device_list = devices.devices('Android')
    for x in device_list:
        yield convert_to_format, x
コード例 #4
0
def get_raw_img() -> bytes:
    devices_no = devices.get_devices_no()
    current_device = devices.devices(devices_no)
    current_img = current_device.get_screenshot()
    f = open('./img/{}.png'.format(current_img), 'rb')
    img = base64.b64encode(f.read())
    return img
コード例 #5
0
def test_other_conversions():
    """Scenario: test other output conversion options.
   
    """
    device_list = devices.devices('Other')
    for x in device_list:
        yield convert_to_format, x
コード例 #6
0
def test_android_size_output_default():
    """Scenario: the output format and size are defaults when device selected.

    """
    device_list = devices.devices('Android')
    datadir, testfiles = data.test_data(many=True, new=True)
    mvc = MVCGui()
    mvc.mvc_focus()
    mvc.browse_for_files(datadir, testfiles)

    for x in device_list:
        yield device_defaults, x, mvc
コード例 #7
0
def test_android_size_output_default():
    """Scenario: the output format and size are defaults when device selected.

    """
    device_list = devices.devices('Android')
    datadir, testfiles = data.test_data(many=True, new=True)
    mvc = MVCGui()
    mvc.mvc_focus()
    mvc.browse_for_files(datadir, testfiles)

    for x in device_list:
        yield device_defaults, x, mvc
コード例 #8
0
ファイル: api.py プロジェクト: Evervolv/evervolv_dot_com
def v1_perform(action,build_type,device):
    ret = None
    if action == 'list':
        if device in devices.devices():
            builds = fakeDatabase.by_device(device)
            if build_type.lower() == 'n':
                ret = json.dumps(builds[0])
            elif build_type.lower() == 'r':
                ret = json.dumps(builds[1])
            elif build_type.lower() == 't':
                ret = json.dumps(builds[2])
            elif build_type.lower() == 'g':
                ret = json.dumps(builds[3])
    return ret
コード例 #9
0
	def loadLibs (self, lib):
		liblist = []
		
		if type(lib) is list:
			liblist = lib
		else:
			liblist = [list]
			
		for lib in liblist:
			if lib == "cache":
				self.logger.threaddebug("Loading cache library")
				from cache import cache #, cacheDev
				self.cache = cache(self)
				
			if lib == "plugcache":
				self.logger.threaddebug("Loading plugin cache")
				from plugcache import plugcache
				self.plugcache = plugcache (self)
				
			if lib == "actions":
				self.logger.threaddebug("Loading actions library")
				from actions import actions
				self.act = actions (self)
				
			if lib == "actionsv2":
				self.logger.threaddebug("Loading actions v2 library")
				from actions_v2 import actions
				self.actv2 = actions (self)	
				
			if lib == "devices":
				self.logger.threaddebug("Loading device extensions library")
				from devices import devices
				self.devices = devices (self)
								
			if lib == "conditions":
				self.logger.threaddebug("Loading conditions library")
				from conditions import conditions
				self.cond = conditions(self)
				
				# Conditions require plug cache
				if "plugcache" in dir(self):
					if self.plugcache is None:
						X = 1				
				else:
					self.logger.threaddebug("Loading plugin cache")
					from plugcache import plugcache
					self.plugcache = plugcache (self)
					
		self.logger.threaddebug("User libraries complete")
コード例 #10
0
ファイル: eps.py プロジェクト: dstrickler/Homebridge
	def loadLibs (self, lib):
		liblist = []
		
		if type(lib) is list:
			liblist = lib
		else:
			liblist = [list]
			
		for lib in liblist:
			if lib == "cache":
				self.logger.threaddebug("Loading cache library")
				from cache import cache #, cacheDev
				self.cache = cache(self)
				
			if lib == "plugcache":
				self.logger.threaddebug("Loading plugin cache")
				from plugcache import plugcache
				self.plugcache = plugcache (self)
				
			if lib == "actions":
				self.logger.threaddebug("Loading actions library")
				from actions import actions
				self.act = actions (self)
				
			if lib == "devices":
				self.logger.threaddebug("Loading device extensions library")
				from devices import devices
				self.devices = devices (self)
								
			if lib == "conditions":
				self.logger.threaddebug("Loading conditions library")
				from conditions import conditions
				self.cond = conditions(self)
				
				# Conditions require plug cache
				if "plugcache" in dir(self):
					if self.plugcache is None:
						X = 1				
				else:
					self.logger.threaddebug("Loading plugin cache")
					from plugcache import plugcache
					self.plugcache = plugcache (self)
					
		self.logger.threaddebug("User libraries complete")
コード例 #11
0
ファイル: eps.py プロジェクト: paulforrester/HomeKit-Bridge
    def loadLibs(self, lib):
        liblist = []

        if type(lib) is list:
            liblist = lib
        else:
            liblist = [list]

        for lib in liblist:
            if lib == "cache":
                self.logger.threaddebug("Loading cache library")
                from cache import cache  #, cacheDev
                self.cache = cache(self)

            if lib == "plugcache":
                self.logger.threaddebug("Loading plugin cache")
                from plugcache import plugcache
                self.plugcache = plugcache(self)

            if lib == "plugdetails" or lib == "actions3":
                self.logger.threaddebug("Loading plugin details library")
                from plugdetails import plugdetails
                self.plugdetails = plugdetails(self)

            if lib == "actions":
                self.logger.threaddebug("Loading actions library")
                from actions import actions
                self.act = actions(self)

            if lib == "actionsv2":
                self.logger.threaddebug("Loading actions v2 library")
                from actions_v2 import actions
                self.actv2 = actions(self)

            if lib == "actions3":
                # NOTE: The plugcache library MUST be loaded FIRST because the init of actions relies on it
                self.logger.threaddebug("Loading actions 3 library")
                from actions3 import actions
                self.actv3 = actions(self)

            if lib == "devices":
                self.logger.threaddebug("Loading device extensions library")
                from devices import devices
                self.devices = devices(self)

            if lib == "http" or lib == "api":
                self.logger.threaddebug("Loading http server library")
                from httpsvr import httpServer
                self.http = httpServer(self)

            if lib == "api":
                self.logger.threaddebug("Loading RESTful api server library")
                from apienh import api
                self.api = api(self)

            if lib == "homekit":
                self.logger.threaddebug("Loading HomeKit api server library")
                from homekit import HomeKit
                self.homekit = HomeKit(self)

            if lib == "conditions":
                self.logger.threaddebug("Loading conditions library")
                from conditions import conditions
                self.cond = conditions(self)

                # Conditions require plug cache
                if "plugcache" in dir(self):
                    if self.plugcache is None:
                        X = 1
                else:
                    self.logger.threaddebug("Loading plugin cache")
                    from plugcache import plugcache
                    self.plugcache = plugcache(self)

        self.logger.threaddebug("User libraries complete")
コード例 #12
0
ファイル: mainwindow.py プロジェクト: lishucai/PhotoDBS
 def slotdevices(self):
     self.devices=devices()
     self.devices.show()