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

Verbose and "dry-run" mode #8

Open
samatjain opened this issue May 8, 2014 · 3 comments
Open

Verbose and "dry-run" mode #8

samatjain opened this issue May 8, 2014 · 3 comments

Comments

@samatjain
Copy link

Dots should have a verbose mode that tells you all the files it is about to copy and what processing (substitutions, installation scripts, etc) are being performed.

Following that, it'd be nice to have a "dry-run" mode where it tells you what will be copied, but does not actually copied.

@evanpurkhiser
Copy link
Owner

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.

@samatjain
Copy link
Author

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?

@evanpurkhiser
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants