Git Product home page Git Product logo

Comments (21)

eyeonus avatar eyeonus commented on July 23, 2024

I didn't write the edapi code, @bgol did. I don't know why it's 127.2.0.1

"companion": {
"CAPI_LIVE_URL": "https://companion.orerve.net",
"CAPI_BETA_URL": "https://pts-companion.orerve.net",
"CLIENT_ID": "0d60c9fe-1ae3-4849-91e9-250db5de9d79",
"REDIRECT_URI": "http://127.2.0.1:2989/callback",
},

Hopefully mentioning him will bring him into this conversation and he can tell us why he used that address.

from trade-dangerous.

bgol avatar bgol commented on July 23, 2024

I just used another localhost address to avoid port collisions (127.2.0.1 is rarely used). You can change the IP:Port setting in the config file to whatever you want.

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

Is there a way in python of retrieving the network address of the PC and redirecting back to that? Or would that not work?

from trade-dangerous.

bgol avatar bgol commented on July 23, 2024

I don't really know. A PC can have multiple addresses, too much work for no gain. What's wrong with localhost?

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

If you mean 127.0.0.1, then nothing at all, but you must have used 127.2.0.1 for a reason. The thing is that in order to get this to work on macOS you have to do all type of fiddly things in order to instruct macOS that 127.2.0.1 is a loopback IP address and it is a pain. So, I'm trying to find out a) why you used that address and not 127.0.0.1, b) can 127.0.0.1 be used and what are the drawbacks and c) can the local network IP address be used instead (yes it can, I've just tried it).

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

So, 127.0.0.1 works without problems as far as I can see. That still doesn't answer the question of why 127.2.0.1?

[Edit] Sorry, I missed the bit about port collisions. That's the reason.

Still, the risk of a port collision is still slight, so I'm going to ask that this be changed to 127.0.0.1 in the release version.

from trade-dangerous.

bgol avatar bgol commented on July 23, 2024

In IPv4 the complete 127.0.0.0/8 block (so anything starting with 127) is for loopback. I was just funny using a different one. Sorry it caused you problems. There is nothing wrong in changing it to another address/port or name/port (that's why it can be overwritten in the config file).

from trade-dangerous.

eyeonus avatar eyeonus commented on July 23, 2024

Config file?

from trade-dangerous.

bgol avatar bgol commented on July 23, 2024

Yes, the EDAPI plugin does write a config file edapi.config in the data directory to save its config and authorisation tokens. Otherwise you would have to login every time.

from trade-dangerous.

eyeonus avatar eyeonus commented on July 23, 2024

Oh. Right. That config file. :)

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

If you don't use TD on a Mac, then there's no problem at all. The Mac these days tends to tie a lot of things down in the interests of "security" and you have to tell the OS that you want certain things, like 127.2.0.1 to be a loopback address.

What I'm after is the user not having to configure anything when using the TD Helper if at all possible. I didn't realise that it was such a pain getting macOS to use anything other than 127.0.0.1. But it is.

I suppose that I could write a config file in advance of calling the edapi plug in with only the IP address and port written in. Would edapi use those values instead if all the other values are missing?

from trade-dangerous.

eyeonus avatar eyeonus commented on July 23, 2024

Probably. From glancing at the code, I'd say yes, but I'd have to look through it to make sure that's the case.

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

That might be the easiest answer then. I'll give it a try and see what happens.

from trade-dangerous.

eyeonus avatar eyeonus commented on July 23, 2024

Just update TD. I agree that port collision isn't a very likely thing, so I've changed it.

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

TD is now giving me the error pasted below. I presume I have to pip install pylint?

Traceback (most recent call last):
File "/usr/local/bin/trade", line 6, in
from tradedangerous.trade import main
File "/usr/local/lib/python3.7/site-packages/tradedangerous/trade.py", line 35, in
from tradedangerous import cli, gui
File "/usr/local/lib/python3.7/site-packages/tradedangerous/gui.py", line 55, in
from pylint.test.functional.invalid_name import argv
ModuleNotFoundError: No module named 'pylint'

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

Yep, that's what to do.

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

I think this one can be closed as fixed now. The latest TD EDAPI works fine on macOS.

Thanks to all.

from trade-dangerous.

eyeonus avatar eyeonus commented on July 23, 2024

That import shouldn't even be there. What're you doing, Eclipse?

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

IntelliJ from JetBrains

Uninstalling TD & pylint and installing older versions of TD working backwards, it seems that the problem started with 10.5. Before that no error, after that I get the error and have to install the module.

from trade-dangerous.

eyeonus avatar eyeonus commented on July 23, 2024

(I don't like IntelliJ, myself. To each their own.)

Well, that makes sense, since the import is in the gui. It's a mistake on the part of the Python auto-importer. That is, the thing that detects what imports need to be made and adds them into the file automatically. Obviously in this case it messed up.

Time to update TD again.

from trade-dangerous.

MarkAusten avatar MarkAusten commented on July 23, 2024

Choice is a good thing. I don't particularly like eclipse or netbeans. However, I do like the common look & feel between PhpStorm, WebStorm, DataGrip, Rider and IntelliJ all of which I use professionally.

10.5.5 works as expected. Thanks.

from trade-dangerous.

Related Issues (20)

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.