These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Sorry to ask this but if I could get some help I'd really appreciate it.

Author
Zeta Zhul
Preemptive Paranoia
#1 - 2014-01-23 06:08:35 UTC
So I am sorry to say that I am at a bit of a loss as to why this is not working. I do plan on getting back into python a lot more than before but I would really like to have a working system now rather than waiting until I can fix it myself. So any help at all would be greatly appreciated. And to Entity: this is really great package you've got here. It used to work as-is on my other laptops but they were windows Vista while this one is a 64-bit Windows 8 based laptop. That might be the problem but I do not know.

Basically the script grabs the current item prices on both buy and sell orders and then puts them into individual .csv files which are then concatenated into one large .csv file. That that master .csv file is read by another script file which updates a database with current prices.

Additionally there are 2 harddrives. A "C:" drive which is a SSD that holds the Windows directory and the User directory which also contains the AppData directory and the physical location of the cache and a "D:" drive which holds the EvE client. The laptop is a Toshiba Qosimo and is pretty nicely tricked out.

The problem is that the script runs and produces pretty much nothing. No .csv files, no error messages. Nothing. Normally I would see a list of item names scrolling as the cache is processed but so far bupkis. I am wondering if there is a problem finding the cache directory or something.

Really any help or pointers would be greatly appreciated. This whole system is very useful to me for maintaining my pricing database and otherwise I would end up relying on

The source:

# Change the following settings to suit your needs:

EVEROOT = r"D:/Games/CCP/EVE"
OUTPATH = r"D:/dev/eve/zetazhul/marketorders"

import pprint
import time
import os
from reverence import blue

def evetime2date(evetime):
s = (evetime - 116444736000000000) / 10000000
ss = time.strftime("%Y-%m-%d %I:%M:%S %p", time.gmtime(s))
return ss

eve = blue.EVE(EVEROOT)
cfg = eve.getconfigmgr()
cachemgr = eve.getcachemgr()
cmc = cachemgr.LoadCacheFolder("CachedMethodCalls")

for key, obj in cmc.iteritems():
print key[1] + "\n"
if key[1]=="GetOrders":
item = cfg.invtypes.Get(key[3])
item.name = item.name.replace('/', ' ')
item.name = item.name.replace('"', ' ')
item.name = item.name.replace(':', ' ')
region = cfg.evelocations.Get(key[2])
print "Processing " + item.name + " [" + region.locationName +"]... \n"
txtfile = open(os.path.join(OUTPATH, item.name+"-"+region.locationName+".csv"), 'w')
txtfile.write("orderID,typeID,volumeEntered,volumeRemaining,price,minVolume,bid,issued,duration,stationID,regionID,solarsystemID,range,jumps \n")
for history_item in obj['lret']:
for entry in history_item:
#print vars(history_item) # this code is to print out the value of a variable or array
line = "%(OrderID)i, %(TypeID)i, %(VolEnt)i, %(VolRem)i, %(Price).2f, %(MinVolume)i, %(Bid)s, %(Issued)s, %(Duration)i, %(StationID)i, %(RegionID)i, %(SolarSystemID)i, %(Range)i, %(Jumps)i," % \
{'OrderID': entry['orderID'], \
'TypeID': entry['typeID'], \
'VolEnt': entry['volEntered'], \
'VolRem': entry['volRemaining'], \
'Price': entry['price'], \
'MinVolume': entry['minVolume'], \
'Bid': entry['bid'], \
'Issued': evetime2date( entry['issueDate'] ), \
'Duration': entry['duration'], \
'StationID': entry['stationID'], \
'RegionID': entry['regionID'], \
'SolarSystemID': entry['solarSystemID'], \
'Range': entry['range'], \
'Jumps': entry['jumps']}
txtfile.write(line+"\n")
txtfile.close()
Drapko Nitzhonot
Abdera Logistics
#2 - 2014-01-23 20:57:36 UTC
Change cmc value to: cmc = cachemgr.LoadCacheFolder(os.path.join(cachemgr.machocachepath,'CachedMethodCalls'))
Zeta Zhul
Preemptive Paranoia
#3 - 2014-01-24 02:22:56 UTC
Thanks for the fix you suggested! Definitely did the trick. I need to update my python skills and work on some better and more up to date code but just not feeling the energy atm. So thank you and I hope you enjoy the honorarium I sent you as a more quantifiable thank you.
Drapko Nitzhonot
Abdera Logistics
#4 - 2014-01-24 18:13:37 UTC
Glad to hear it's fixed.

Thanks for your very very very generous honorarium Big smile