Beispiel #1
0
 def __on_card_presented(self):
     # Setup connection and connect to the provided card
     connection = self.__service.connection
     try:
         connection.connect()
         # Send command to acquired connection
         self.__send_command(connection, self.__GETUIDCOMMAND)
     except (CardConnectionException, NoCardException) as e:
         Logger.warn("Could not connect to card when trying to read UID!")
         return
Beispiel #2
0
 def vibrate_cb(self, time=1):
     
     try:
         vibrator.vibrate(time)
     except (NotImplementedError, ImportError):
         Logger.warn(
             "DEVICE: No vibrate function defined for {} platform.".format(
                 constants.PLATFORM))     
     else:
         Logger.info("DEVICE: BUZZ!!")                      
Beispiel #3
0
from cryptikchaos.libs.utilities import bytes_to_num
from cryptikchaos.libs.utilities import md5hash

from cryptikchaos.libs.obscure import shuffler
from cryptikchaos.libs.obscure import unshuffler

from cryptikchaos.exceptions.streamExceptions import \
    StreamOverflowError

from cryptikchaos.core.comm.stream.stream import Stream

if constants.AES_AVAILABLE:
    Logger.info("STREAM: AES Crypto available.")
    from Crypto.Cipher import AES
else:
    Logger.warn("STREAM: AES Crypto unavailable.")

import struct

STREAM_TYPES = enum(UNAUTH=False, AUTH=True)


class StreamManager(StoreManager):

    "Stream manager class."

    def __init__(self, peerid, peerkey, peerhost):

        # Authorized keys
        self._valid_keys = (
            'STREAM_FLAG',
 def on_type(self, _, type):
     if type not in self.types:
         Logger.warn("Game: '{}' is not a type, terminating this Body".format(type))
         Clock.schedule_once(self.remove, 0)
Beispiel #5
-1
 def notify_cb(self, title='', message='', timeout=1):
     
     try:
         notification.notify(
             title=title, 
             message=message, 
             app_name=constants.APP_NAME, 
             app_icon=os.path.join(constants.KIVY_RESOURCE_PATH_1, 'icon.png'),
             timeout=timeout
         )
     except (NotImplementedError, ImportError):
         Logger.warn(
             "DEVICE: No vibrate function defined for {} platform.".format(
                 constants.PLATFORM))     
     else:
         Logger.info("DEVICE: Fired Notification!")