Closed MarkAusten closed 6 years ago
Interestingly, it's supposed to already correctly space the columns.
longestNamed = max(results.rows,
key=lambda row: len(row.system.name()))
longestNameLen = len(longestNamed.system.name())
rowFmt = RowFormat()
if cmdenv.detail:
rowFmt.addColumn("Action", '<', 6, key=lambda row: row.action)
rowFmt.addColumn("System", '<', longestNameLen,
key=lambda row: row.system.name())
Basically, it's setting the width of the column to be as wide as the station with the longest name. Or at least it should be. Not sure yet why it isn't.
Ah. Nevermind. That's for the Systems. Stations is hard-coded to a width of 32.
Okay, so, the longest named Sstem/Station is Pleiades Sector AB-W b2-4/Noctrach-Ihazevich Research Facility
at 62 characters, and formatting for that length is ugly:
Trade-Dangerous>trade.py nav "Shinrarta Dezhra" "Kulici" -S
System JumpLy
/ Station StnLs Age/days Mkt BMk Shp Out Arm Ref Rep Pad Plt
---------------------------------------------------------------------------------------------------------------------------
Shinrarta Dezhra 0.00
/ Shinrarta Dezhra/Jameson Memorial 323 0.82 Yes No Yes Yes Yes Yes Yes Lrg No
/ Shinrarta Dezhra/Gallun's Inheritance 1.48K 1.94 Yes No No Yes Yes Yes No Lrg Yes
/ Shinrarta Dezhra/Puleston Arsenal 3.86K 0.62 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Shinrarta Dezhra/Neumann Camp 3.82K 0.71 Yes Yes No Yes Yes Yes No Lrg Yes
/ Shinrarta Dezhra/Jameson Base 40 - No No No Yes Yes Yes Yes Lrg Yes
Skeggiko O 12.23
/ Skeggiko O/Kuo Terminal 75 1.01 Yes No Yes Yes Yes Yes Yes Lrg No
/ Skeggiko O/Crown Horizons 41K 16.82 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Skeggiko O/Hewish's Inheritance 38K 11.06 Yes No No Yes Yes Yes Yes Lrg Yes
/ Skeggiko O/Bean Arsenal 39K 6.74 Yes Yes Yes Yes Yes Yes Yes Lrg Yes
/ Skeggiko O/Cabot's Inheritance 38K - No No No Yes Yes Yes Yes Lrg Yes
LFT 568 28.59
/ LFT 568/Ramaswamy Outpost 1.38K 2.80 Yes Yes No Yes No Yes Yes Med No
Muth 29.46
/ Muth/Gutierrez Hub 884 1.01 Yes No Yes Yes Yes Yes Yes Lrg No
/ Muth/Al-Khowarizmi Keep 4.57K 0.67 Yes Yes No Yes Yes Yes Yes Lrg Yes
Findalibila 17.63
/ Findalibila/Grassmann Station 20 1.19 Yes No Yes Yes Yes Yes Yes Lrg No
/ Findalibila/Tasman Dock 67 14.86 Yes No No No No Yes Yes Med No
/ Findalibila/Zajdel Holdings 20 4.08 Yes No No Yes Yes Yes Yes Lrg Yes
StKM 1-442 17.16
/ StKM 1-442/Leavitt Orbital 4.42K 8.37 Yes No No Yes Yes Yes Yes Med No
/ StKM 1-442/Toll Relay 4.42K 1.33 Yes Yes No Yes Yes Yes Yes Lrg Yes
Kondadora 26.70
/ Kondadora/Rennie Enterprise 12 1.49 Yes Yes Yes Yes Yes Yes Yes Lrg No
/ Kondadora/Smith Station 21 16.68 Yes No No Yes Yes Yes No Med No
/ Kondadora/Nikolayev Station 37 2.58 Yes Yes No No No Yes No Med No
/ Kondadora/Haignere Installation 12 4.82 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Kondadora/Harding Base 710 14.97 Yes Yes No Yes Yes Yes Yes Lrg Yes
Kulici 22.95
/ Kulici/Araki Vision 16 0.49 Yes Yes Yes Yes Yes Yes Yes Lrg No
/ Kulici/Angstrom Hub 23 0.50 Yes No No Yes Yes Yes Yes Med No
/ Kulici/Mayer Hub 40 1.71 Yes Yes No Yes No Yes Yes Med No
/ Kulici/Thornycroft Settlement 16 2.86 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Kulici/Vance Survey 2.31K - No No No Yes Yes Yes Yes Lrg Yes
So definitely going to look into removing the redundant system name.
So, that certainly looks better:
Trade-Dangerous>trade.py nav "Shinrarta Dezhra" "Kulici" -S
System JumpLy
/ Station StnLs Age/days Mkt BMk Shp Out Arm Ref Rep Pad Plt
--------------------------------------------------------------------------------------------------
Shinrarta Dezhra 0.00
/ Jameson Memorial 323 0.82 Yes No Yes Yes Yes Yes Yes Lrg No
/ Gallun's Inheritance 1.48K 1.95 Yes No No Yes Yes Yes No Lrg Yes
/ Puleston Arsenal 3.86K 0.63 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Neumann Camp 3.82K 0.71 Yes Yes No Yes Yes Yes No Lrg Yes
/ Jameson Base 40 - No No No Yes Yes Yes Yes Lrg Yes
Skeggiko O 12.23
/ Kuo Terminal 75 1.02 Yes No Yes Yes Yes Yes Yes Lrg No
/ Crown Horizons 41K 16.82 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Hewish's Inheritance 38K 11.06 Yes No No Yes Yes Yes Yes Lrg Yes
/ Bean Arsenal 39K 6.74 Yes Yes Yes Yes Yes Yes Yes Lrg Yes
/ Cabot's Inheritance 38K - No No No Yes Yes Yes Yes Lrg Yes
LFT 568 28.59
/ Ramaswamy Outpost 1.38K 2.80 Yes Yes No Yes No Yes Yes Med No
Muth 29.46
/ Gutierrez Hub 884 1.01 Yes No Yes Yes Yes Yes Yes Lrg No
/ Al-Khowarizmi Keep 4.57K 0.67 Yes Yes No Yes Yes Yes Yes Lrg Yes
Findalibila 17.63
/ Grassmann Station 20 1.20 Yes No Yes Yes Yes Yes Yes Lrg No
/ Tasman Dock 67 14.86 Yes No No No No Yes Yes Med No
/ Zajdel Holdings 20 4.08 Yes No No Yes Yes Yes Yes Lrg Yes
StKM 1-442 17.16
/ Leavitt Orbital 4.42K 8.37 Yes No No Yes Yes Yes Yes Med No
/ Toll Relay 4.42K 1.33 Yes Yes No Yes Yes Yes Yes Lrg Yes
Kondadora 26.70
/ Rennie Enterprise 12 1.49 Yes Yes Yes Yes Yes Yes Yes Lrg No
/ Smith Station 21 16.68 Yes No No Yes Yes Yes No Med No
/ Nikolayev Station 37 2.59 Yes Yes No No No Yes No Med No
/ Haignere Installation 12 4.82 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Harding Base 710 14.97 Yes Yes No Yes Yes Yes Yes Lrg Yes
Kulici 22.95
/ Araki Vision 16 0.49 Yes Yes Yes Yes Yes Yes Yes Lrg No
/ Angstrom Hub 23 0.50 Yes No No Yes Yes Yes Yes Med No
/ Mayer Hub 40 1.71 Yes Yes No Yes No Yes Yes Med No
/ Thornycroft Settlement 16 2.87 Yes Yes No Yes Yes Yes Yes Lrg Yes
/ Vance Survey 2.31K - No No No Yes Yes Yes Yes Lrg Yes
That is definitely much better. Thanks.
Minor (very minor) issue with the layout of a navigation command when including stations.
Alignment issues with "Shinrarta Dezhra/Gallum's Inheritance" as the name it too long for the layout as shown on the attached screen shot.
Running a query on the latest TD database gives a max system name length of 30 (Thor's Helmet Sector FB-X c1-5) and station name of 37 (Hipparque - Cartographers' University) ignoring the ones that are to be deleted. So the space for the station name probably needs to be expanded to allow a total name length of 5 + 30 + 1 + 37 + 1 or 73 which will probably overflow everything.
Alternatively remove the redundant system name before each station name.