Giter Site home page Giter Site logo

Verbose and "dry-run" mode about dots HOT 3 OPEN

evanpurkhiser avatar evanpurkhiser commented on May 25, 2024
Verbose and "dry-run" mode

from dots.

Comments (3)

evanpurkhiser avatar evanpurkhiser commented on May 25, 2024

I like the idea of verbosity. I'd like to keep the UI logic out of the two classes. So I'm thinking some kind of notification/signaling/event manager object that can be signaled for something and then that object (or maybe, if being really generic, some kind of UI handler could subscribe to it) would trigger UI output.

dry run also sounds good also.

from dots.

samatjain avatar samatjain commented on May 25, 2024

An event system seems overkill… was there some framework like gevent/Qt/etc you had in mind or did you want to roll your own?

Given the nature of dots, will there ever be a need for multiple UIs?

from dots.

evanpurkhiser avatar evanpurkhiser commented on May 25, 2024

I wasn't thinking anything complicated, just something like

class NotificationManager(object):
    def __init__(self):
        listeners = {}

    def notify(self, event_name, *args, **kwargs):
        for subscriber in self.listeners:
            subscriber(*args, **kwargs)

    def subscribe(self, event_name, function):
        self.listeners[event_name].append(function)

And then setup a UI handler that subscribes to events or something along those lines.. Though maybe you're right. I just hate having to pass around a flag for verbosity.

from dots.

Related Issues (17)

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.