1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

[2262] SLEF to this var

This commit is contained in:
David Sangrey 2024-06-18 22:02:41 -04:00
parent d478a68bc6
commit 0cc35db96b
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC
2 changed files with 15 additions and 1 deletions

View File

@ -107,6 +107,7 @@ class This:
self.fleet: list[dict[str, Any]] | None = None
self.shipswap: bool = False # just swapped ship
self.on_foot = False
self.SLEF: str | None = None
self.timer_run = True
@ -1504,7 +1505,10 @@ def make_slef(entry) -> None:
'Modules': entry['Modules'],
})
initial_dict.update({'data': data_dict})
json.dump(initial_dict, open('inara.json', 'w'), indent=4)
output = json.dumps(initial_dict, indent=4)
this.SLEF = str(output)
print('set output')
print(type(this.SLEF))
return None

View File

@ -194,6 +194,11 @@ class HyperlinkLabel(tk.Label or ttk.Label): # type: ignore
menu.add_command(label=tr.tl('Copy'), command=self.copy) # As in Copy and Paste
if self.name == 'ship':
# TODO: Get SLEF from Inara
# print(self.SLEF)
# menu.add_command(label=tr.tl('Copy INARA SLEF'), command=lambda: self.copy_slef(self), state=tk.DISABLED)
# menu.entryconfigure(1, state=self.SLEF and tk.NORMAL or tk.DISABLED)
menu.add_separator()
for url in plug.provides('shipyard_url'):
menu.add_command(
@ -224,3 +229,8 @@ class HyperlinkLabel(tk.Label or ttk.Label): # type: ignore
"""Copy the current text to the clipboard."""
self.clipboard_clear()
self.clipboard_append(self['text'])
# def copy_slef(self, this) -> None:
# """Copy the current text to the clipboard."""
# self.clipboard_clear()
# self.clipboard_append(this.SLEF)