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 93eb0ae..0000000 Binary files a/PyTaskbar/TaskbarLib.tlb and /dev/null differ diff --git a/PyTaskbar/__init__.py b/PyTaskbar/__init__.py deleted file mode 100644 index bd894b1..0000000 --- a/PyTaskbar/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .ProgressAPI import Progress diff --git a/PyTaskbarProgress/readme.md b/PyTaskbarProgress/readme.md new file mode 100644 index 0000000..c84e1b2 --- /dev/null +++ b/PyTaskbarProgress/readme.md @@ -0,0 +1 @@ +# The main library! diff --git a/docs.md b/docs.md index cb148fa..6f670d9 100644 --- a/docs.md +++ b/docs.md @@ -23,28 +23,28 @@ Unfortunately, I did not upload this to Pypi, so you cannot install it with pip. ### To install with wheel: -1.Download wheel from this distribution:[LINK](https://github.com/somePythonProgrammer/PyTaskbar/releases/tag/0.0.1). +1. Download wheel from this distribution:[LINK](https://github.com/somePythonProgrammer/PyTaskbar/releases/tag/0.0.1). -2.Do "pip install path-to-wheel.whl" +2. Do "pip install path-to-wheel.whl" -3.Try out the [example](#docs_example) now! +3. Try out the [example](#docs_example) now! ### To install manually: -1.Download wheel from this distribution:[LINK](https://github.com/somePythonProgrammer/PyTaskbar/releases/tag/0.0.1). +1. Download wheel from this distribution:[LINK](https://github.com/somePythonProgrammer/PyTaskbar/releases/tag/0.0.1). -2.Once you have downloaded it, unzip the downloaded file. +2. Once you have downloaded it, unzip the downloaded file. -3.Go to file explorer and get to the directory where you have cloned or unzipped the repository. +3. Go to file explorer and get to the directory where you have cloned or unzipped the repository. -4.type 'cmd' in the place where you see the path. +4. type 'cmd' in the place where you see the path. ![image](https://user-images.githubusercontent.com/74598401/119104885-69c01e80-ba3a-11eb-9c24-45eaf4bab5bf.png) -5.hit enter. +5. hit enter. -6.type 'python install.py' and hit enter. +6. type 'python install.py' and hit enter. -8.Try out the [example](#docs_example) now! +8. Try out the [example](#docs_example) now! ##### [back to top](#index) ##### [API docs](#main_object) @@ -54,9 +54,9 @@ Unfortunately, I did not upload this to Pypi, so you cannot install it with pip. ## Example: import time - import PyTaskbar + import PyTaskbarProgress - prog = PyTaskbar.Progress() + prog = PyTaskbarProgress.Progress() prog.init() prog.setState('loading') @@ -114,10 +114,10 @@ Unfortunately, I did not upload this to Pypi, so you cannot install it with pip. ##### [back to top](#index) ##### [back to API docs](#main_object) - import tbprog + import PyTaskbarProgress import time - progress = Progress() + progress = PyTaskbarProgress.Progress() progress.init() #taskbar icon becoms green, or starts to display a loading animation @@ -145,10 +145,10 @@ Unfortunately, I did not upload this to Pypi, so you cannot install it with pip. ##### [back to top](#index) ##### [back to API docs](#main_object) - import tbprog + import PyTaskbarProgress import time - progress = Progress() + progress = PyTaskbarProgress.Progress() progress.init() for i in range(100): diff --git a/setup.py b/setup.py index e4fd542..e27a1ce 100644 --- a/setup.py +++ b/setup.py @@ -2,21 +2,21 @@ import sys import shutil -# Copy the PyTaskbar/TaskbarLib.tlb file to the dist folder +# Copy the PyTaskbarProgress/TaskbarLib.tlb file to the dist folder def copy_tlb(dst): - shutil.copy("PyTaskbar\\TaskbarLib.tlb", dst) + shutil.copy("PyTaskbarProgress\\TaskbarLib.tlb", dst) sitepackages_path = sys.prefix + '\\Lib\\site-packages' -libpath = sitepackages_path + '\\PyTaskbar\\TaskbarLib.tlb'.replace('\\', '/') +libpath = sitepackages_path + '\\PyTaskbarProgress\\TaskbarLib.tlb'.replace('\\', '/') setuptools.setup( - name='PyTaskbar', + name='PyTaskbarProgress', version='0.0.1', author='somePythonProgrammer', description='The ultimate taskbar progress python package!', - packages = setuptools.find_packages(include=['PyTaskbar']), - package_dir={'PyTaskbar': 'PyTaskbar'}, + packages = setuptools.find_packages(include=['PyTaskbarProgress']), + package_dir={'PyTaskbarProgress': 'PyTaskbarProgress'}, classifiers = [ 'License :: OSI Approved :: MIT License', 'Operating System :: Microsoft :: Windows :: Windows 10',