dots icon indicating copy to clipboard operation
dots copied to clipboard

Verbose and "dry-run" mode

Open samatjain opened this issue 10 years ago • 3 comments

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.

samatjain avatar May 08 '14 19:05 samatjain

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.

evanpurkhiser avatar May 08 '14 19:05 evanpurkhiser

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?

samatjain avatar May 09 '14 00:05 samatjain

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.

evanpurkhiser avatar May 09 '14 04:05 evanpurkhiser