Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging a dataset from the GUI missing #191

Closed
mtelewa opened this issue Aug 30, 2022 · 4 comments
Closed

Tagging a dataset from the GUI missing #191

mtelewa opened this issue Aug 30, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mtelewa
Copy link

mtelewa commented Aug 30, 2022

No description provided.

@jotelha jotelha added the enhancement New feature or request label Sep 16, 2022
@jotelha jotelha added this to the 0.7.0 milestone Sep 30, 2024
@jotelha
Copy link
Member

jotelha commented Oct 31, 2024

In the code of the GUI, we have to embed this

In [1]: import dtool_lookup_api.synchronous as dl

In [2]: dl.get_tags("s3://test-bucket/1a1f9fad-8589-413e-9602-5bbd66bfe675")
Out[2]: ['another-tag', 'test']

@jotelha
Copy link
Member

jotelha commented Oct 31, 2024

Look at dataset model in code

async def get_readme(self):
if 'readme_content' in self._dataset_info:
logger.debug("README.yml cached.")
return self._dataset_info['readme_content']
logger.debug("README.yml queried from lookup server.")
async with ConfigurationBasedLookupClient() as lookup:
self._dataset_info['readme_content'] = await lookup.get_readme(self.uri)
return self._dataset_info['readme_content']
async def get_manifest(self):
# ATTENTION HERE: will try to get data from lookup server for proto datasets without following check
if not self.is_frozen:
return dict()
if 'manifest' in self._dataset_info:
return self._dataset_info['manifest']
async with ConfigurationBasedLookupClient() as lookup:
manifest_dict = await lookup.get_manifest(self.uri)
self._dataset_info['manifest'] = _mangle_lookup_manifest(manifest_dict)
return self._dataset_info['manifest']

and implement get_tags as method of model in similar fashion.

@jotelha
Copy link
Member

jotelha commented Oct 31, 2024

Add labels dynamically like this:

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

class MainWindow(Gtk.Window):
    def __init__(self):
        super().__init__(title="Dynamic GTK3 Example")
        self.set_border_width(10)

        # Set up a vertical box to hold the widgets
        self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
        self.add(self.box)

        # Create a button that will add labels dynamically
        self.button = Gtk.Button(label="Add Label")
        self.button.connect("clicked", self.on_button_clicked)
        self.box.pack_start(self.button, True, True, 0)

    def on_button_clicked(self, widget):
        # Create a new label and add it to the box
        label = Gtk.Label(label="New Dynamic Label")
        self.box.pack_start(label, True, True, 0)
        self.show_all()  # Refresh the window to show the new label

# Initialize and run the GTK application
win = MainWindow()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()

@jotelha
Copy link
Member

jotelha commented Nov 26, 2024

Done with #362

@jotelha jotelha closed this as completed Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants