Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
serial 0642f8d6f0ec9d1a
model Nexus 5
.... ...
===============================================
"""
import logging
from tinydb import TinyDB, where
from tinydb.storages import MemoryStorage, JSONStorage
import requests
import re
logger = logging.getLogger(__name__)
TinyDB.DEFAULT_STORAGE = MemoryStorage
class ATX_Server(object):
"""
According to users requirements to select devices
"""
def __init__(self, url):
"""
Construct method
"""
self._db = TinyDB(storage=MemoryStorage)
if url and re.match(r"(http://)?(\d+\.\d+\.\d+\.\d+:\d+)", url):
if '://' not in url:
url = 'http://' + url + '/list'
else:
serial 778d4f10
platform android
mode Plusm A
.... ...
===============================================
"""
import logging
from stf import STF
from tinydb import TinyDB
from tinydb.storages import MemoryStorage
logger = logging.getLogger(__name__)
TinyDB.DEFAULT_STORAGE = MemoryStorage
class Selector(object):
"""
According to user's requirements to select devices
"""
def __init__(self, url=None, token=None):
"""
Construct method
"""
self._db = TinyDB(storage=MemoryStorage)
self._url = url
self._token = token
def load(self):
This property is also useful to define Serializers using required
`tinydb-serialization` module.
from tinymongo.serializers import DateTimeSerializer
from tinydb_serialization import SerializationMiddleware
class CustomClient(TinyMongoClient):
@property
def _storage(self):
serialization = SerializationMiddleware()
serialization.register_serializer(
DateTimeSerializer(), 'TinyDate')
# register other custom serializers
return serialization
"""
return TinyDB.DEFAULT_STORAGE
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tinydb import TinyDB
from tinydb.storages import MemoryStorage, JSONStorage
class DB(TinyDB):
# To modify the default storage for all TinyDB instances
TinyDB.DEFAULT_STORAGE = MemoryStorage
pass
class MemStroage(MemoryStorage):
pass
class JsonStorage(JSONStorage):
pass
model Nexus 5
.... ...
===============================================
"""
import logging
from tinydb import TinyDB, where
from tinydb.storages import MemoryStorage, JSONStorage
import requests
import re
from Public.ReadConfig import ReadConfig
logger = logging.getLogger(__name__)
TinyDB.DEFAULT_STORAGE = MemoryStorage
token = ReadConfig().get_server_token()
class atxserver2(object):
"""
According to users requirements to select devices
"""
def __init__(self, url):
"""
Construct method
"""
self._db = TinyDB(storage=MemoryStorage)
if url and re.match(r"(http://)?(\d+\.\d+\.\d+\.\d+:\d+)", url):
if '://' not in url: