Comments (21)
I didn't write the edapi code, @bgol did. I don't know why it's 127.2.0.1
Trade-Dangerous/plugins/edapi_plug.py
Lines 120 to 125 in c4bf271
Hopefully mentioning him will bring him into this conversation and he can tell us why he used that address.
from trade-dangerous.
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.
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.
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.
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.
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.
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.
Config file?
from trade-dangerous.
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.
Oh. Right. That config file. :)
from trade-dangerous.
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.
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.
That might be the easiest answer then. I'll give it a try and see what happens.
from trade-dangerous.
Just update TD. I agree that port collision isn't a very likely thing, so I've changed it.
from trade-dangerous.
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.
Yep, that's what to do.
from trade-dangerous.
I think this one can be closed as fixed now. The latest TD EDAPI works fine on macOS.
Thanks to all.
from trade-dangerous.
That import shouldn't even be there. What're you doing, Eclipse?
from trade-dangerous.
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.
(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.
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)
- Executing a trade run after a database update gives an error. In my TD\data folder the Tradedangerous.prices file is not showing HOT 6
- Fix the need to generate prices - pretty please with sugar on top. HOT 16
- When I run the command "trade.py import -P eddblink -O all", I get error messages ! HOT 9
- A General List of Potential Issues
- Fix warnings in deploy HOT 4
- Server hosting upgrade HOT 53
- Locale changes break on systems with certain locales, in general unnecessary
- Looks like `--progress` no longer works HOT 1
- Function/command "Cmdr Profile" generates an error HOT 4
- The search for specific goods generates an error ! Function "buy" HOT 10
- Again a problem with the command/function "Cmdr Profile" HOT 5
- The Culling: What's deprecated/discontinued?
- Enable Discussions tab in Github?
- PadSize argument parser is explicitly only allowing one character HOT 3
- Duplicate Rescue Ship "HR 1183/Arc's Faith" HOT 1
- The server seems to be no longer updating. HOT 11
- Could you add option to filter out Fleet Carriers HOT 1
- `trade.py trade` definitely does more work than it should HOT 7
- SQL error on first re-import of `eddblink` HOT 2
- Database / needed file size optimisations HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trade-dangerous.