コード例 #1
0
 def __init__(self, loggly_token: str, fqdn=False, localname=None, facility=None, cookies=None):
     super().__init__()
     self.fqdn = fqdn
     self.localname = localname
     self.facility = facility
     self.cookies = cookies or {}
     self.url = "https://logs-01.loggly.com/inputs/{token}/tag/{tag}".format(
         token=utils.deobfuscate(loggly_token), tag='lbrynet-' + __version__
     )
コード例 #2
0
 def __init__(self, loggly_token: str, config: 'Config'):
     super().__init__()
     self.cookies = {}
     self.url = "https://logs-01.loggly.com/inputs/{token}/tag/{tag}".format(
         token=utils.deobfuscate(loggly_token),
         tag='lbrynet-' + __version__)
     self._loop = asyncio.get_event_loop()
     self._session = aiohttp.ClientSession()
     self._config = config
コード例 #3
0
ファイル: analytics.py プロジェクト: walbens59/lbry-sdk
 def __init__(self, conf: Config, installation_id: str, session_id: str):
     self.conf = conf
     self.cookies = {}
     self.url = ANALYTICS_ENDPOINT
     self._write_key = utils.deobfuscate(ANALYTICS_TOKEN)
     self._tracked_data = collections.defaultdict(list)
     self.context = _make_context(system_info.get_platform())
     self.installation_id = installation_id
     self.session_id = session_id
     self.task: typing.Optional[asyncio.Task] = None
     self.external_ip: typing.Optional[str] = None
コード例 #4
0
 def test_can_use_unicode(self):
     plain = '☃'
     obf = utils.obfuscate(plain.encode())
     self.assertEqual(plain, utils.deobfuscate(obf))
コード例 #5
0
 def test_deobfuscation_reverses_obfuscation(self):
     plain = "my_test_string"
     obf = utils.obfuscate(plain.encode())
     self.assertEqual(plain, utils.deobfuscate(obf))