From 0741936ff63a85a54eecff754174dd440c676a8a Mon Sep 17 00:00:00 2001 From: somePythonProgrammer <74598401+somePythonProgrammer@users.noreply.github.com> Date: Sun, 15 May 2022 21:20:21 +0530 Subject: [PATCH] .. --- PyTaskbar/ProgressAPI.py | 72 ------------------------------------ PyTaskbar/TaskbarLib.tlb | Bin 6832 -> 0 bytes PyTaskbar/__init__.py | 1 - PyTaskbarProgress/readme.md | 1 + docs.md | 32 ++++++++-------- setup.py | 12 +++--- 6 files changed, 23 insertions(+), 95 deletions(-) delete mode 100644 PyTaskbar/ProgressAPI.py delete mode 100644 PyTaskbar/TaskbarLib.tlb delete mode 100644 PyTaskbar/__init__.py create mode 100644 PyTaskbarProgress/readme.md diff --git a/PyTaskbar/ProgressAPI.py b/PyTaskbar/ProgressAPI.py deleted file mode 100644 index 97cd6c3..0000000 --- a/PyTaskbar/ProgressAPI.py +++ /dev/null @@ -1,72 +0,0 @@ -import ctypes - -import comtypes.client as cc -import sys -import warnings - - -parent_dir = __file__.rsplit("\\", 1)[0] -sys.path.append(parent_dir) -cc.GetModule("./TaskbarLib.tlb") - -import comtypes.gen.TaskbarLib as tbl -from comtypes.gen import _683BF642_E9CA_4124_BE43_67065B2FA653_0_1_0 -taskbar = cc.CreateObject( - "{56FDF344-FD6D-11d0-958A-006097C9A090}", - interface=tbl.ITaskbarList3) - -hWnd = ctypes.windll.kernel32.GetConsoleWindow() -taskbar.ActivateTab(hWnd) - -class Progress(object): - def __init__(self,hwnd=hWnd): - super().__init__() - self.initialised = False - self.state = None - self.win = hwnd - - def init(self): - self.thisWindow = self.win - taskbar.ActivateTab(self.win) - taskbar.HrInit() - self.state = 'normal' - self.progress = 0 - self.initialised = True - - def setState(self,value): - if not self.initialised == False: - if value == 'normal': - taskbar.SetProgressState(self.thisWindow,0) - self.state = 'normal' - - elif value == 'warning': - taskbar.SetProgressState(self.thisWindow,10) - self.state = 'warning' - - elif value == 'error': - taskbar.SetProgressState(self.thisWindow,15) - self.state = 'error' - - elif value == 'loading': - taskbar.SetProgressState(self.thisWindow,-15) - self.state = 'loading' - - elif value == 'done': - ctypes.windll.user32.FlashWindow(self.thisWindow,True) - self.state = 'done' - - else: - warnings.warn('Invalid Argument {} .Please selece one from (normal,warning,error,loading,done).'.format(value)) - - else: - warnings.warn('Please initialise the object (method:Progress.initialise())') - - def setProgress(self,value:int): - if not self.initialised == False: - taskbar.setProgressValue(self.thisWindow,value,100) - - elif value>100 or value<0: - warnings.warn('Invalid Argument {} .Please selece one from (<100,>0).'.fromat(value)) - - else: - warnings.warn('Please initialise the object (method:Progress.initialise())') diff --git a/PyTaskbar/TaskbarLib.tlb b/PyTaskbar/TaskbarLib.tlb deleted file mode 100644 index 93eb0ae0669eb831bbd3b4f37959956ebb16d747..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6832 zcmb7IeQaCR6+cd#*!gI1n*`df47<&s5*@g00GDNxlQ?O-J6{(vTDllnfAnmJvFoq^HZBp1YQE9BJ#-RKC?t9mM zagvQ)>AZXIxxe#q&pr3Pci+gwV7yLT!qVhcmGq*rI3jImUqP`(L`KorTW|Hq-;Aao zR0cV5Y4p#7c0ti&p!Y#{)``3b@>cpB2F@ZpXyuXGG5hQO-(K`LeSr*-Q zwzt{&tN=D<$M!}!+o?I#^=PfKDy>s?>-0J{T*z?FgL}AMniQIT_yZn!Q70p~)iqz8 zz1r^%8>IVGrrWfk+nRrUz$?iu>{+F1LvyONmVNtw*cgY1&MnFW0!{1Kume&xQStBM zf3ZQ`+82tleM6vGo>_Aq>)Y_#$y2L~I@gMoKhPq}|EG;sd#OIIjXFGKHFfe;thevtx=0*KL~!`rO(X&;@z&^m-^=#@4orjiH~fc@sp)L9J%Ay z8^8CK$mOM;ceVV?I{frH{Jy_`cwphfUu``4h$NqU?IfqFd|}OUPCaEXjXDWB8vS(g z_8&dn_iS#tA-B_}Uj9d-ue59{J*XKjizH{78*{zPriiIAhMX zvn<0) zG2R23hy24fmS_BVPz3&J*=G6e(Ri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