Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Asset List Parser #4

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

Asset List Parser #4

sudorandom opened this issue Dec 29, 2013 · 13 comments

Comments

@sudorandom
Copy link
Contributor

No description provided.

@flexd
Copy link

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
Copy link

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
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

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
Copy link

flexd commented Feb 16, 2014

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

@sudorandom
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants