Asset List Parser #4

Open
sudorandom opened this Issue Dec 29, 2013 · 13 comments

Projects

None yet

2 participants

@sudorandom
Contributor

No description provided.

@sudorandom sudorandom added a commit that closed this issue Dec 30, 2013
@sudorandom sudorandom Adds asset list parser
Resolves #4
fbae045
@flexd
flexd commented Feb 16, 2014

This asset list parser does not seems not to work on most stuff.
I know just commenting like this is not exactly helpful, I'd love to submit some code but I can't at the moment.

result: [
"assets",
[
{
category: "",
group: "Siege Module",
meta_level: null,
name: "Bastion Module I",
quantity: 108,
size: null,
slot: "High",
tech_level: null,
volume: "21600 m3"
}
],
[
"Genolution Core Augmentation CA-1  1   Cyberimplant     1 1 m3 ",
"Genolution Core Augmentation CA-2  1   Cyberimplant     4 1 m3 ",
"Expanded Cargohold II  2   Expanded Cargohold   Low    10 m3 ",
"Festival Launcher  2   Festival Launcher    High   40 m3 "
]
]
}
@flexd
flexd commented Feb 16, 2014

I just installed evepaste moments before posting here. What python version are you using that with? I am on 2.7.3

@sudorandom
Contributor

Ah, okay. I'm using Python 2.7.6, but it shouldn't matter that much. Can you post a full example instead of just the output?

@flexd
flexd commented Feb 16, 2014

This is how I use it now, https://gist.github.com/flexd/66bf80138a30fead43d8

This is currently running here, http://eve.cognitive.io:5000/pscan

And this where parse_assets is (someone elses code), which works. http://pastie.org/8739459

You can toggle using evepaste or parse_assets() using the checkbox.

Sorry for the slow replies, I'm having some connectivity issues with the datacenter the server is in.

@sudorandom
Contributor

Okay, I think I figured out the issue. You're probably running this on windows because the new line chars look like \r\n instead of \n. The fix for this is fairly easy. Thanks for the info.

@sudorandom sudorandom reopened this Feb 16, 2014
@flexd
flexd commented Feb 16, 2014

My server is Ubuntu/Debian (two servers), I am on OSX, my EVE client runs on Windows.

@sudorandom
Contributor

If that's the case then that's really odd... I'm about to push up a change which I believe fixes this, regardless of where the problem actually comes from.

@flexd
flexd commented Feb 16, 2014

We will see. I am controlling my EVE machine via synergy (which also means I can copy between machines). It's possible that is causing the problem. Let me know when you have pushed the change and I will see.

@sudorandom
Contributor

I pushed it up (a11d532). To try it out you can either download the source and run python setup.py install or you can use this command if you use pip: pip install -U git+git://github.com/evepraisal/evepaste.git. I'll release it to pypi if it fixes your issue

@flexd
flexd commented Feb 16, 2014

That seems to work, items are being parsed.

Volume is not being parsed though, json should be uniform, it needs to be parsed to 0,1 and not "0,1 m3"

@sudorandom
Contributor

I've avoided following through with that due to issues with different localizations... For example, these are all the same number: '1.000,1', '1000.1', '1000.1' (which, to a programmer, looks like: '1\xa0000.1').

@flexd
flexd commented Feb 16, 2014

Yeah, but is that just the four or five languages EVE has been translated to? Or is it every locale known to computers?

For my purposes I only need the name and quantity anyway.

@sudorandom
Contributor

I believe it's related to the languages that EVE has been translated into.

For my purposes, I also only needed the name and quantity as well. That's basically why I put off this issue. I think it's possible, but it just wasn't worth putting in the effort to solve. With that said, I think having the volume as a float value (rather than a string) would be good in the case that people name their ships. It could be used to verify that someone didn't name their drake "Avatar" or to guess that "Fluffy Wonder Pants" has the same volume as a drake and is most likely a drake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment