gauteh / lieer

Fast email-fetching and sending and two-way tag synchronization between notmuch and GMail
http://lieer.gaute.vetsj.com
Other
494 stars 60 forks source link

Add verbose option to sync #248

Closed kode54 closed 10 months ago

kode54 commented 11 months ago

Fixes f7c3f594ee4a04c8289e8431df9d2e5470affc56 which broke sync:

Traceback (most recent call last):
  File "/usr/bin/gmi", line 24, in <module>
    g.main ()
  File "/usr/lib/python3.11/site-packages/lieer/gmailieer.py", line 236, in main
    args.func (args)
  File "/usr/lib/python3.11/site-packages/lieer/gmailieer.py", line 307, in sync
    self.setup (args, args.dry_run, True)
  File "/usr/lib/python3.11/site-packages/lieer/gmailieer.py", line 281, in setup
    self.verbose          = args.verbose
                            ^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'verbose'
kode54 commented 11 months ago

Oops, looks like the other modes also needed the exception fallback, because the base config model doesn't define the verbose flag.

gauteh commented 11 months ago

Thank you, so this is not ready to merge yet?

@digitalsignalperson did you test the different gmi subcommands?

digitalsignalperson commented 11 months ago

Oops admittedly I did not test sync with verbose mode, only push and pull. I'm only at the point of manually doing deliberate pushes and pulls and making sure I understand how everything changes on both sides (hence adding the verbose mode to help with this), so I haven't used the sync command ever yet! Sorry I guess I broke sync!

gauteh commented 11 months ago

👍 Maybe we can find a way to do this in the unit tests eventually.

digitalsignalperson commented 11 months ago

Hmm, I guess the intention is that gmi pull --verbose and gmi sync --verbose would both set self.verbose = to True. Oh and I see that's what the PR does. Great!

kode54 commented 11 months ago

The exception I added in the second commit will set self.verbose to False for all modes which do not have the verbose option defined in their option model. Unless it would be preferred to move the verbose option to the common model? Does it even affect any of the other operations?

I was experiencing the exception error on the gmi set method as well, which was why I decided to add a generic catch-all.

gauteh commented 11 months ago

It is better to add verbose to the common options than using exceptions for this.

jonrubens commented 10 months ago

I get this error on gmi init account

gauteh commented 10 months ago

https://github.com/gauteh/lieer/issues/250 this should be updated to add the verbose option to the common namespace (and remove the specific ones).

gauteh commented 10 months ago

Fixed through #252.