Giter Site home page Giter Site logo

battlenet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

battlenet's Issues

PyPi

Do you have any plans to update the version of this library that's on PyPi? Or was it someone else that posted it there?

Changes needed in things.py to support Python 2.5

"namedtuple" is a Python 2.6 feature not present in 2.5. The Google App Engine environment requires Python 2.5.

File "test/battlenet/things.py", line 529, in init
Tree = collections.namedtuple('Tree', ('points', 'total',))
AttributeError: 'module' object has no attribute 'namedtuple'

If you could use something other than namedtuple that would be great! :)

Test fails for test_data.py, APIError: HTTP Error 500: Internal Server Error

A test in test_data.py fails with a 500 error.

File "test/test_data.py", line 70, in test_items
item = self.connection.get_item(battlenet.UNITED_STATES, 60249)
File "test/battlenet/connection.py", line 217, in get_item
data = self.make_request(region, '/data/item/%d' % item_id)
File "test/battlenet/connection.py", line 110, in make_request
raise APIError(str(e))
APIError: HTTP Error 500: Internal Server Error

battle.net api issues

  • Enchants on equipped items should be Item Ids?
  • No information on how to relate criteria with achievements on guild API
  • Titles are invalid and no way to know the selected title in character API
  • Hunter pets do not have talents in character API
  • Faction on guild API is not consistent with character API's guild value
  • Emblem is not provided by guild API, but provided by character API's guild value
  • No recent activity feed

very minor typo

in things.py, line 453

self.average_item_level_equiped = data['averageItemLevelEquipped']

should be

self.average_item_level_equipped = data['averageItemLevelEquipped']

(missing a 'p')

Test failure in test_character.py: Mismatching achievement dates?

Test failure in test_character.py: Mismatching achievement dates?

File "test_character.py", line 104, in test_achievements
self.assertEqual(character.achievements[513], datetime.datetime(2011, 1, 25, 12, 22, 8))
AssertionError: datetime.datetime(2011, 1, 25, 15, 22, 8) != datetime.datetime(2011, 1, 25, 12, 22, 8)

Hello? What's the status of this?

The version of this project on PyPi is three years old. #23 was opened a year and a half ago to update it, and hasn't even been commented on. There are a bunch of open pull requests with little to no activity.

I need something like this for a project of mine, and more importantly, I need something that works with Python 3.

Is it worth it for me to open a pull request? @vishnevskiy, do you have interest in continuing development on this? If not, would you consider letting someone else take over the project here and on PyPi? If no to both, would you mind if I forked this, renamed it, merged some of these outstanding PRs, and uploaded that to pypi?

Text encoding issue?

Throws error when attempting to decode inputs of non-standard english characters. For instance, test_unicode () in test_character.py results in:

ERROR: test_unicode (main.CharacterTest)

Traceback (most recent call last):
File "C:\Users\Isaac\Desktop\test_character.py", line 87, in test_unicode
character = Character(battlenet.UNITED_STATES, 'Nazjatar', 'Clí')
File "D:\Python27\lib\battlenet\things.py", line 135, in init
data = self.connection.get_character(region, realm, name, raw=True, fields=self._fields)
File "D:\Python27\lib\battlenet\connection.py", line 114, in get_character
name = quote(name.lower())
File "D:\Python27\lib\battlenet\utils.py", line 13, in quote
return urllib.quote(normalize(name))
File "D:\Python27\lib\battlenet\utils.py", line 7, in normalize
name = name.decode('utf8')
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3: unexpected end of data


I ran this test after the following resulted in a similar error:

import battlenet
from battlenet import Connection, Character
character = Character(battlenet.UNITED_STATES,'Stormreaver','Tøth',fields=[Character.ITEMS]) 

ø is character 248 in Latin1. Resulting error reads:

Traceback (most recent call last):
File "<pyshell#2>", line 1, in
character = Character(battlenet.UNITED_STATES,'Stormreaver','Tøth',fields=[Character.ITEMS])
File "D:\Python27\lib\battlenet\things.py", line 135, in init
data = self.connection.get_character(region, realm, name, raw=True, fields=self._fields)
File "D:\Python27\lib\battlenet\connection.py", line 114, in get_character
name = quote(name.lower())
File "D:\Python27\lib\battlenet\utils.py", line 13, in quote
return urllib.quote(normalize(name))
File "D:\Python27\lib\battlenet\utils.py", line 7, in normalize
name = name.decode('utf8')
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf8 in position 1: invalid start byte


Possible user error? I ran the test to be sure. Running Python 2.7 on Windows.

No mastery

If a talent tree is blank there is no name or icon

Automatic updating of characters fails with unicode names

As stated in the title, updating a character by referring to unknown data fails for names which require unicode characters

Code example:

import battlenet
REGION = battlenet.UNITED_STATES
REALM = 'Nazjatar'
GUILD = 'Excellence'

from battlenet import Connection
from battlenet import Guild
from battlenet import Character
Connection.setup()

def test_1():
    g = Guild(REGION, REALM, GUILD, fields=[Guild.MEMBERS])
    c = g.get_leader()
    foo = c.talents    # Produces an error

def test_2():
    c = Character(REGION, REALM, u'Clí')
    foo = c.talents    # Another error

def test_3():
    c = Character(REGION, REALM, u'Clí', fields=[Character.TALENTS])
    foo = c.talents    # Works fine

The error returned:

 Traceback (most recent call last):
  File "<<Work Directory>>\testsuite.py", line 17, in <module>
    foo = c.talents
  File "<<Work Directory>>\battlenet\things.py", line 254, in talents
    if self._refresh_if_not_present(Character.TALENTS):
  File "<<Work Directory>>\battlenet\things.py", line 43, in _refresh_if_not_present
    self.refresh(field)
  File "<<Work Directory>>\battlenet\things.py", line 271, in refresh
    self.name, raw=True, fields=self._fields))
  File "<<Work Directory>>\battlenet\connection.py", line 114, in get_character
    name = quote(name.lower())
  File "<<Work Directory>>\battlenet\utils.py", line 13, in quote
    return urllib.quote(normalize(name))
  File "<<Work Directory>>\battlenet\utils.py", line 7, in normalize
    name = name.decode('utf8')
  File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3: unexpected end of data

doesn't support russian names

If guildwork are using your lib atm then it doesn't support names in russian, i think it caused by link encoding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.