Ejemplo n.º 1
0
    def run(self, character_id):

        api = eveapi.EVEAPIConnection()
        character = Character.objects.get(id=character_id)

        # Try to fetch a valid key from DB
        try:
            apikey = APIKey.objects.get(id=character.apikey_id, is_valid=True)
        except APIKey.DoesNotExist:
            # End execution for this character
            return

        logger.debug("Updating research agents for %s..." % character.name)

        # Try to authenticate and handle exceptions properly
        try:
            auth = api.auth(keyID=apikey.keyid, vCode=apikey.vcode)
            me = auth.character(character.id)

            # Get newest page - use maximum row count to minimize amount of requests
            sheet = me.Research()

        except eveapi.Error, e:
            handle_api_exception(e, apikey)
            return
Ejemplo n.º 2
0
    def run(self, character_id):

        #define variables
        i_stats = {}
        implant = {}
        attributes = ['memory', 'intelligence', 'perception', 'willpower', 'charisma']

        #grab an api object
        api = eveapi.EVEAPIConnection()
        character = Character.objects.get(id=character_id)

        # Try to fetch a valid key from DB
        try:
            apikey = APIKey.objects.get(id=character.apikey_id, is_valid=True)
        except APIKey.DoesNotExist:
            # End execution for this character
            return

        logger.debug("Updating character sheet for %s" % character.name)

        # Try to authenticate and handle exceptions properly
        try:
            auth = api.auth(keyID=apikey.keyid, vCode=apikey.vcode)
            me = auth.character(character.id)
            sheet = me.CharacterSheet()
            i_stats['name'] = ""
            i_stats['value'] = 0

        except eveapi.Error, e:
            handle_api_exception(e, apikey)
            return
Ejemplo n.º 3
0
    def run(self, character_id):

        api = eveapi.EVEAPIConnection()
        character = Character.objects.get(id=character_id)

        # Try to fetch a valid key from DB
        try:
            apikey = APIKey.objects.get(id=character.apikey_id, is_valid=True)
        except APIKey.DoesNotExist:
            # End execution for this character
            return

        logger.debug("Updating research agents for %s..." % character.name)

        # Try to authenticate and handle exceptions properly
        try:
            auth = api.auth(keyID=apikey.keyid, vCode=apikey.vcode)
            me = auth.character(character.id)

            # Get newest page - use maximum row count to minimize amount of requests
            sheet = me.Research()

        except eveapi.Error, e:
            handle_api_exception(e, apikey)
            return
Ejemplo n.º 4
0
    def run(self, character_id):

        #define variables
        i_stats = {}
        implant = {}
        attributes = ['memory', 'intelligence', 'perception', 'willpower', 'charisma']

        #grab an api object
        api = eveapi.EVEAPIConnection()
        character = Character.objects.get(id=character_id)

        # Try to fetch a valid key from DB
        try:
            apikey = APIKey.objects.get(id=character.apikey_id, is_valid=True)
        except APIKey.DoesNotExist:
            # End execution for this character
            return

        logger.debug("Updating character sheet for %s" % character.name)

        # Try to authenticate and handle exceptions properly
        try:
            auth = api.auth(keyID=apikey.keyid, vCode=apikey.vcode)
            me = auth.character(character.id)
            sheet = me.CharacterSheet()
            i_stats['name'] = ""
            i_stats['value'] = 0

        except eveapi.Error, e:
            handle_api_exception(e, apikey)
            return
Ejemplo n.º 5
0
    def run(self, character_id):

        api = eveapi.EVEAPIConnection()
        character = Character.objects.get(id=character_id)

        # Try to fetch a valid key from DB
        try:
            apikey = APIKey.objects.get(id=character.apikey_id, is_valid=True)
        except APIKey.DoesNotExist:
            # End execution for this character
            return

        logger.debug("Updating %s's market orders..." % character.name)

        # Try to authenticate and handle exceptions properly
        try:
            auth = api.auth(keyID=apikey.keyid, vCode=apikey.vcode)
            me = auth.character(character.id)
            orders = me.MarketOrders()

        except eveapi.Error, e:
            handle_api_exception(e, apikey)
            return
Ejemplo n.º 6
0
    def run(self, character_id):

        api = eveapi.EVEAPIConnection()
        character = Character.objects.get(id=character_id)

        # Try to fetch a valid key from DB
        try:
            apikey = APIKey.objects.get(id=character.apikey_id, is_valid=True)
        except APIKey.DoesNotExist:
            # End execution for this character
            return

        logger.debug("Updating %s's market orders..." % character.name)

        # Try to authenticate and handle exceptions properly
        try:
            auth = api.auth(keyID=apikey.keyid, vCode=apikey.vcode)
            me = auth.character(character.id)
            orders = me.MarketOrders()

        except eveapi.Error, e:
            handle_api_exception(e, apikey)
            return