barolet / kovans-ogbot

Automatically exported from code.google.com/p/kovans-ogbot
0 stars 0 forks source link

Bot doesn't work. Problem with AttributeError, strptime ?? #297

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
ENGLISH ONLY.
IF ANY OF THE INFO BELOW IS MISSING THE BUG REPORT WILL BE DELETED.
Thank you.

Bot version:
OGame server language: Polish, ogame.onet.pl
OGame server version: v 0.83
Using admirals or commander (specify)?: I'm not
Operating System: Windows XP

Description of the problem:

Hello all. I got a problem. I have added translates to my polish.ini and I
still cant
run bot. I dunno what's wrong with it.

Have a look 

Traceback (most recent call last):
  File "src\OGBot.py", line 106, in run
  File "src\OGBot.py", line 139, in _connect
  File "src\WebAdapter.py", line 409, in updatePlayerData
  File "src\WebAdapter.py", line 394, in getMyPlanets
  File "src\WebAdapter.py", line 894, in parseTime
AttributeError: type object 'datetime.datetime' has no attribute 'strptime'

What's wrong?
Could you help me ?
Sry my poor english :P

Peace!

Original issue reported on code.google.com by przem...@wp.pl on 9 Feb 2009 at 4:52

GoogleCodeExporter commented 8 years ago
check that this is the function

def parseTime(strTime, format = "%a %b %d %H:%M:%S"):# example: Mon Aug 7 
21:08:52
    ''' parses a time string formatted in OGame's most usual format and
    converts it to a datetime object'''

    format = "%Y " + format
    strTime = str(datetime.datetime.now().year) + " " +strTime
    date = datetime.datetime.strptime(strTime, format)
    return date

and that this line is at the top (line 10 or so)

import datetime, time

and can you post your translation

Original comment by King.Vash@gmail.com on 10 Feb 2009 at 12:33

GoogleCodeExporter commented 8 years ago

Original comment by King.Vash@gmail.com on 12 Feb 2009 at 7:20