dotfiles/config/typescript

112 KiB

Script started on 2019-04-25 21:52:12+02:00 [TERM="rxvt-unicode-256color" TTY="/dev/pts/8" COLUMNS="191" LINES="54"] Re"M en il ed fmbsyncrc") # TODO Better, ro =" 5 eaMe n l/ d imbsyncrc") # TODO Better " og "F 6 ades e /s b gmbsyncrc") # TODO Better"- gr Fe 7 d ss el su by /mbsyncrc") # TODO Better--
[2 q[2 q mel  buffers
1 #!/usr/bin/env python3
1
2 """
3 Meh mail client
4 A dumb Python scripts that leverages notmuch, mbsync, and msmtp
5 to become a fully-functional extremly-opinonated mail client.
6 """
7
8 # TODO Features
9 # TODO Implement initial command set
10 # TODO Lockfiles for write operations on mail files (mbsync, tags→maildir operations)
11 # TODO OPTI Lockfile per account and process everything in parallel (if implemented, this
12 # should be optional since while it may speed up the mail fetching process, its multi-threading
13 # nature would cause a lot of cache flushes and be not very efficient on battery)
14 # TODO Handle true character width
15 # TODO IMAP IDLE watches?
16 # TODO GPG
17 # TODO (only then) Refactor
18 # TODO OOP-based
19 # TODO Merge file with melConf
20
21 # DEBUG Small perf profiler
22 import time "R=" pe ai le nmbsyncrc") # TODO Betterh, Pr p= 4
23 perf_dict = dict()
24 perf_last = time.perf_counter()
25 def perfstep(name):
26 t = time.perf_counter()
27 global perf_last
28 global perf_dict
29 diff = t - perf_last
30 if name not in perf_dict:
31 perf_dict[name] = 0
32 perf_dict[name] += diff
33 perf_last = time.perf_counter()
34
35
36 import notmuch
37 import logging
38 import coloredlogs
39 import colorama
40 import datetime
41 import os
42 import progressbar
43 import argparse
44 import configparser
45 import base64
46 import shutil
47 import argparse
48 import xdg.BaseDirectory
3 #21ort sys
4 Meh m1 A dumb Python scripts that leverages notmuch, mbsync, and msm2 to become a fully-functional extremly-opinonated m3456 # TODO Implement initial comm 7 # TODO Lockfiles for write operations on mail files (mbsync, tags→m 8 # TODO OPTI Lockfile per account and process everything in parallel (if implem 9 # should be optional since while it may speed up the mail fetching process, its m012 # TODO IM3456 # TODO Merge file with m1718 # DEBUG Sm19 import tim01 perf_last = tim2 def perfstep(nam3 t = tim45627 if nam28 perf_dict[nam29 perf_dict[nam0 perf_last = tim123 import notm4 im5 im6 import coloram37 import datetim38 im39 im0 im1 im2 im3 im4 im5 im6 im47 im4b4 #!/us3 2 """
1 Meh m ="p= op ma ll ombsyncrc") # TODO Betterth wP lp 3
10 #!/usr/bin/env python3 9 8 """ 7 Meh mail client m7 # TODO OPTI Lockfile per account and process everything in parallel (if implem8 # should be optional since while it may speed up the mail fetching process, its m 9 #0 #1 # TODO IM2 #3 #4 #5 # TODO Merge file with m6 7 # DEBUG Sm8 import tim19 perf_0 perf_last = tim1 def perfstep(nam2 t = tim3 g4 g5 d6 if nam7 perf_dict[nam8 perf_dict[nam29 perf_last = tim0 1 2 import notm3 impor4 impor5 import coloram6 import datetim7 impor8 impor39 impor0 impor1 impor2 impor3 impor4 impor5 impor6 impor5/608  : 5ssr/bin/env python3 mail client mb Python scripts that leverages notmuch, mbsecome a fully-functional extremly-opinonate # TODO Implement initial command set # TODO Lockfiles for write operations on mail files (mbs# TODO OPTI Lockfile per account and proces# should be optional since while it may spe# nature would cause a lot of cache flushes# TODO Handle true character width # TODO IMAP IDLE watches? # TODO GPG # TODO OOP-based # TODO Merge file with melConf BUG Small perf profiler rt time _dict = dict() _last = time.perf_counter() perfstep(name): t = time.perf_counter() global perf_last global perf_dict diff = t - perf_last if name not in perf_dict: perf_dict[name] = 0 perf_dict[name] += diff perf_last = time.perf_counter() rt notmuch rt logging rt coloredlogs rt colorama rt datetime rt os rt progressbar rt argparse rt configparser rt base64 rt shutil rt argparse rt xdg.BaseDirectory rt sys rt subprocess 47yyynnnccc
6 A dumb Python scripts that leverages notmuch, mbsync, and 5 to become a fully-functional extremly-opinonated mail clie4 """ 2 # TODO Features 1 # TODO Implement initial command set
25 # move dest msg...[36X24 ## Read message[39X23 [44X22 [44X21 # read msg [--html] [--plain] [--browser][18X20 def func_read(args):[37X19 apply_msgs_input(args.message, read_msg)[10X18 parserRead = subparsers.add_parser("read", help="Read message")17 parserRead.add_argument('message', nargs=1, help="Messages")16 parserRead.set_defaults(func=func_read)[15XO (only then) Refactor 8 # TODO OOP-based 9 # TODO Merge file with melConf 0 1 # DEBUG Small perf profiler 2 import time 3 perf_dict = dict() 14 perf_last = time.perf_counter() 15 def perfstep(name): 16 t = time.perf_counter() 17 global perf_last 18 global perf_dict 19 diff = t - perf_last 0 if name not in perf_dict: 1 perf_dict[name] = 0 2 perf_dict[name] += diff 3 perf_last = time.perf_counter() 24 25 26 import notmuch 27 import logging 28 import coloredlogs 29 import colorama 0 import datetime 1 import os 2 import progressbar 3 import argparse 34 import configparser 35 import base64 36 import shutil 37 import argparse 38 import xdg.BaseDirectory 39 import sys 0 import subprocess 1% ☰ 11/608  : 58n
15 [75X14 [79X13 # attach msg [id] [--save] (list if no id, xdg-open else)[38X12 ## Redaction[69X11 # new account[41X10 # reply msg [--all][35X9 ## Folder management[34X8 # tree [folder][39X7 # mkdir folder[40X6 # rmdir folder (prevent if folder isn't empty (mail/subfolder)) 5 # (yeah that should do)[31X 4 ## Meta [44X 3 # setup (interactive thing maybe)[21X 2 [44X 1 [44X
9 # move des8 ## Read me7 [5X6 [5X5 # read msg4 def func_r23 apply_22 parserRead21 parserRead20 parserRead9 [5X8 [5X7 # attach m6 ## Redacti5 # new acco4 # reply ms13 ## Folder 12 # tree [fo11 # mkdir fo10 # rmdir fo9 # (yeah th8 ## Meta 7 # setup (i6 [5X5 [5Xw mails[33X 9 notmuch_new()[37X10 [44X11 # Notify[42X12 notify_all()[38X13 [44X14 # Tag new mails[35X15 applyMsgs('tag:unprocessed', retag_msg, showProgress=True, write=True)16 [44X17 parserFetch = subparsers.add_parser("fetch", help="Fetch mail, tag them, and run notifications")18 parserFetch.set_defaults(func=func_fetch)[13X19 [44X20 [44X21 ## Debug [44X22 # debug (various)[37X23 def func_expose(args):[32X24 # And leave the door open[25X25 def expose_msg(a):[32X func_read()  python utf-8[unix] 87% ☰ 531/608  : 14n
4 # fet3 def func_f# Fetc1 log.in
535 1 cmd = 2 subpro3 [5X4 # Inde5 notmuc 6 [5X 7 # Noti 8 notify 9 [5X0 # Tag 1 applyM2 [5X3 parserFetc4 parserFetc5 [5X16 [5X17 ## Debug 18 # debug (v19 def func_e0 # And 1 def ex func_fetch()  python utf-8[unix] 87% ☰ 535/608  : 9E ve dest msg... ead message ad msg [--html] func_read(args):apply_msgs_inputerRead = subparserRead.add_argumerRead.set_defau tach msg [id] [-edaction w account ply msg [--all] older managementee [folder] dir folder dir folder (preveah that should eta tup (interactive tch (mbsync, notfunc_fetch(args)# Fetch mails log.info("Fetchicmd = ["mbsync",subprocess.run(c # Index new mailnotmuch_new() # Notify notify_all() # Tag new mails applyMsgs('tag:u erFetch = subparerFetch.set_defa ebug bug (various) func_expose(args# And leave the def expose_msg(a24E [-: t(asermenult --s t ven do e t tmu): ing, "cmd ls unp rseaul s): doa):6E --plain] [--browser] args.message, read_msg) rs.add_parser("read", help="Read ment('message', nargs=1, help="Messagts(func=func_read) save] (list if no id, xdg-open else nt if folder isn't empty (mail/subfo) thing maybe) uch new, retag, notify; called by g g mails") ("~/.mbsyncrc")"--config", mbsyncConfigPath, "--ald) processed', retag_msg, showProgress ers.add_parser("fetch", help="Fetchlts(func=func_fetch) : oor open : 60b meag se bf g ("~/.mbsyncrc")al ss ch 59b [8X [8X [8X [8X [8X [8X [8Xp="Read mlp="Messa [8X [8X [8X-open els [8X [8X [8X [8X [8X [8X(mail/sub [8X [8X [8X [8X [8Xalled by [8X [8X [8Xath, "--a [8X [8X [8X [8X [8X [8X [8X [8X [8XowProgres [8Xelp="Fetc [8X [8X [8X [8X [8X [8X [8X [8X1i [6 q
 

 

 

 

 

 

 

 

 

 

 
INSERT mel func_fetch()  python utf-8[unix] 87% ☰ 535/608  : 51 mel+ p=lp -o (m al cmbsyncrc") # TODO Betterat ow el [+] func_fetch()  python utf-8[unix] 87% ☰ 535/608  : 52
 

 

 

 

 

 

 

 

 

 

COMMAND mel[2 qm
/ NORMAL mel python utf-8[unix] 0% ☰ 1/608  : 1 /