diff --git a/README.md b/README.md index 281a64c8..3fbe1eb7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Open source RPA platform (Coming soon Q2 2019) for Windows. Dependencies -* Python 3 x32 [psutil,pywinauto] +* Python 3 x32 [psutil, pywinauto, wmi] * Python 3 x64 * pywinauto (Windows GUI automation) * Semantic UI CSS framework diff --git a/WPy32-3720/python-3.7.2/Lib/__pycache__/argparse.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/__pycache__/argparse.cpython-37.pyc index ee252f63..07872e19 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/__pycache__/argparse.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/__pycache__/argparse.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/__pycache__/imp.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/__pycache__/imp.cpython-37.pyc index 507463b0..75e02a46 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/__pycache__/imp.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/__pycache__/imp.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/_msvccompiler.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/_msvccompiler.cpython-37.pyc index 2dbffa42..c9af515d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/_msvccompiler.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/_msvccompiler.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/ccompiler.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/ccompiler.cpython-37.pyc index fa1329ac..21d2a93f 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/ccompiler.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/ccompiler.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/filelist.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/filelist.cpython-37.pyc index ae7932d2..22af7bbf 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/filelist.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/filelist.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/msvc9compiler.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/msvc9compiler.cpython-37.pyc index f37d2461..7b86949d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/msvc9compiler.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/msvc9compiler.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/text_file.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/text_file.cpython-37.pyc index d293aebd..35173678 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/text_file.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/text_file.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/version.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/version.cpython-37.pyc index 36f90602..f22a6777 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/version.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/__pycache__/version.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/bdist.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/bdist.cpython-37.pyc index f30023cf..b8e74430 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/bdist.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/bdist.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_ext.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_ext.cpython-37.pyc index 7058523c..1fa22638 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_ext.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_ext.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_py.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_py.cpython-37.pyc index d8ce59da..21fcb27f 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_py.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_py.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_scripts.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_scripts.cpython-37.pyc index 6d3a6215..b6d38ad1 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_scripts.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/build_scripts.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_data.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_data.cpython-37.pyc new file mode 100644 index 00000000..f156c083 Binary files /dev/null and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_data.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_lib.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_lib.cpython-37.pyc index 90b73b68..ddf13f6b 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_lib.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_lib.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_scripts.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_scripts.cpython-37.pyc index 2e64347a..b3919d8a 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_scripts.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/install_scripts.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/sdist.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/sdist.cpython-37.pyc index c025212b..7f211a56 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/sdist.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/distutils/command/__pycache__/sdist.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/email/__pycache__/generator.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/email/__pycache__/generator.cpython-37.pyc index 0e8cb576..995d390b 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/email/__pycache__/generator.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/email/__pycache__/generator.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/encodings/__pycache__/ascii.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/encodings/__pycache__/ascii.cpython-37.pyc index f47cfea6..75a857aa 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/encodings/__pycache__/ascii.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/encodings/__pycache__/ascii.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/__init__.cpython-37.pyc index 7e977f29..c89a120b 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_matcher.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_matcher.cpython-37.pyc index 7dac7688..ee2f30e9 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_matcher.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_matcher.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_utils.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_utils.cpython-37.pyc index 59e2fdbd..b47c4ded 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_utils.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/btm_utils.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/fixer_util.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/fixer_util.cpython-37.pyc index 771d73fc..c6ea6ee8 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/fixer_util.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/fixer_util.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/patcomp.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/patcomp.cpython-37.pyc index 89e14f62..2a8184c3 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/patcomp.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/patcomp.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pygram.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pygram.cpython-37.pyc index 390d6f92..7ad7a064 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pygram.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pygram.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pytree.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pytree.cpython-37.pyc index 709b90e3..62e83b81 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pytree.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/pytree.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/refactor.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/refactor.cpython-37.pyc index 7ababb26..ee29ffb5 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/refactor.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/__pycache__/refactor.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-37.pyc index e5b9d6d7..63f63841 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/driver.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/driver.cpython-37.pyc index d57ec55e..dd67710b 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/driver.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/driver.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-37.pyc index 93363da8..a98e3042 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/grammar.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/literals.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/literals.cpython-37.pyc index d14941c9..e07aff48 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/literals.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/literals.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/parse.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/parse.cpython-37.pyc index 8935e5f9..050ef51e 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/parse.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/parse.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-37.pyc index 46448cfa..918a82d5 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/pgen.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/token.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/token.cpython-37.pyc index 15e2f635..e908a3ff 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/token.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/token.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-37.pyc index 3c5e4d21..4bd23ae7 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/lib2to3/pgen2/__pycache__/tokenize.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/INSTALLER b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/METADATA b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/METADATA new file mode 100644 index 00000000..8d4ee004 --- /dev/null +++ b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/METADATA @@ -0,0 +1,111 @@ +Metadata-Version: 2.1 +Name: WMI +Version: 1.4.9 +Summary: Windows Management Instrumentation +Home-page: http://timgolden.me.uk/python/wmi.html +Author: Tim Golden +Author-email: mail@timgolden.me.uk +License: http://www.opensource.org/licenses/mit-license.php +Platform: UNKNOWN + +***************** +Python WMI Module +***************** + +What is it? +=========== + +Windows Management Instrumentation (WMI) is Microsoft's implementation of +Web-Based Enterprise Management (WBEM), an industry initiative to provide +a Common Information Model (CIM) for pretty much any information about a +computer system. + +The Python WMI module is a lightweight wrapper on top of the pywin32 +extensions, and hides some of the messy plumbing needed to get Python to +talk to the WMI API. It's pure Python and should work with any version of +Python from 2.1 onwards (list comprehensions) and any recent version of +pywin32. + + +Where do I get it? +================== + +http://timgolden.me.uk/python/wmi/index.html + + +Copyright & License? +==================== + +(c) Tim Golden 5th June 2003 +Licensed under the (GPL-compatible) MIT License: +http://www.opensource.org/licenses/mit-license.php + + +How do I install it? +==================== + +When all's said and done, it's just a module. But for those +who like setup programs:: + + python setup.py install + +It's also pip/easy_install-able + + +How do I use it? +================ + +There's a tutorial here: http://timgolden.me.uk/python/wmi/tutorial.html, +and some examples at: http://timgolden.me.uk/python/wmi/cookbook.html +but as a quick taster, try this, to show all stopped services:: + + import wmi + + c = wmi.WMI () + for s in c.Win32_Service (): + if s.State == 'Stopped': + print s.Caption, s.State + + +Prerequisites +============= + +If you're running a recent Python (2.1+) on a recent Windows (2k, 2k3, XP) +and you have Mark Hammond's win32 extensions installed, you're probably +up-and-running already. Otherwise... + +Windows +------- +If you're running Win9x / NT4 you'll need to get WMI support +from Microsoft. Microsoft URLs change quite often, so I suggest you +do this: http://www.google.com/search?q=wmi+downloads + +Python +------ +http://www.python.org/ (just in case you didn't know) + +pywin32 (was win32all) +---------------------- +http://starship.python.net/crew/mhammond/win32/Downloads.html +Specifically, builds 154/155 fixed a problem which affected the WMI +moniker construction. You can still work without this fix, but some +more complex monikers will fail. + +makepy +------ +(NB my own experience over several systems is that this +step isn't necessary. However, if you have problems...) +You may have to compile makepy support for some typelibs. The following +are reported to be significant: + +Microsoft WMI Scripting Library +WMI ADSI Extension Type Library +WMICntl Type Library + +If you've not done this before, start the PythonWin environment, select +Tools > Com Makepy utility from the menu, select the library by name, and +click [OK]. + + + + diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/RECORD b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/RECORD new file mode 100644 index 00000000..f099f061 --- /dev/null +++ b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/RECORD @@ -0,0 +1,13 @@ +../../Scripts/__pycache__/wmiweb.cpython-37.pyc,, +../../Scripts/wmitest.cmd,sha256=JjlDZRwCycRD9qE1dEmL52eg3Z6B5bLOuVFSXNrCQzw,151 +../../Scripts/wmitest.master.ini,sha256=Ht1WvKoyp7pGeIjGVfO1u7Ss5JpIJ_Tin-qSsfERxDM,90 +../../Scripts/wmitest.py,sha256=Adt3ANu0VSoungX-jMuX8nU7ZEmsFTEKDHKt3C2uP-U,26526 +../../Scripts/wmiweb.py,sha256=G-g9dj9GulQwM9-zFFA-WSQZpuos0NtyEWdXBkVA0qQ,7457 +../../readme.txt,sha256=O86UyAwpG_AA9IeUGmL0WOvcK_VDvMMNiO2v0thezs4,2797 +WMI-1.4.9.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +WMI-1.4.9.dist-info/METADATA,sha256=HfBdxA2ePyrAFDYN7BC2vGQdgwn4vjQJVTCqNCLzjL0,2974 +WMI-1.4.9.dist-info/RECORD,, +WMI-1.4.9.dist-info/WHEEL,sha256=JtBte-IW7C3UcYx3ZpZORq-KtnjVj4xdM4AJCTZPivc,98 +WMI-1.4.9.dist-info/top_level.txt,sha256=3hWjpK7PXPlg0o1uW_JRIChr8XaoGcUjw09WzSsqCh8,4 +__pycache__/wmi.cpython-37.pyc,, +wmi.py,sha256=P48WjfanOsY88nF9RmEbn2RWyHWsj6Ct57MWgM5fQUI,48360 diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/WHEEL b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/WHEEL new file mode 100644 index 00000000..03075056 --- /dev/null +++ b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.1) +Root-Is-Purelib: true +Tag: cp37-none-any + diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/top_level.txt b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/top_level.txt new file mode 100644 index 00000000..2dbb9cd9 --- /dev/null +++ b/WPy32-3720/python-3.7.2/Lib/site-packages/WMI-1.4.9.dist-info/top_level.txt @@ -0,0 +1 @@ +wmi diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/pythoncom.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/pythoncom.cpython-37.pyc index f512d5a5..06deb983 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/pythoncom.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/pythoncom.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/wmi.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/wmi.cpython-37.pyc new file mode 100644 index 00000000..065931bb Binary files /dev/null and b/WPy32-3720/python-3.7.2/Lib/site-packages/__pycache__/wmi.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc index a18971fa..9acec30f 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc index 30b9f784..2510fe79 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc index 1b40725e..c83d20eb 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc index 9478ee86..7a78b371 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc index 67a11c46..8d653744 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc index 2e863749..0ad2a1dc 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc index feca55e2..c38979ae 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc index 84fafb6a..1a34f02c 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc index 3102018d..db8af1dd 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc index cdd33824..58f3fe6f 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc index 62cbe7ae..48e46d9d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc index 3ca738dc..0b5c9138 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc index 7aa749ba..98826b76 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc index 2c5ea4ed..eaa2152e 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc index 3ab8c210..833bcc3a 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc index 09994fd4..0d41e783 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc index 3f1b9388..d4a7f84c 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc index 7011be07..a2f40d1b 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/config.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/config.cpython-37.pyc index 5ec6de89..aed5db78 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/config.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/config.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/depends.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/depends.cpython-37.pyc index 8326354f..8dd1d096 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/depends.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/depends.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/dist.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/dist.cpython-37.pyc index 64feb59c..494dc965 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/dist.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/dist.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/extension.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/extension.cpython-37.pyc index 645ab8c1..29f5b855 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/extension.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/extension.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc index 4853675f..17e4ae9f 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glob.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glob.cpython-37.pyc index 2bf2edaf..09027020 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glob.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/glob.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc index 36424660..ad9224a6 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc index 9c06640c..91b9ee0d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc index 63c02cc6..7e665fb7 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc index 2b31d523..0182ea9d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc index be9b6bd9..d77f8cf2 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc index 54e54c0e..9c2237f4 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc index e12f406d..96bde842 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc index bc4dc12c..33a96fe4 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc index 7fb920fe..0dc7be8c 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc index 6f0c5cfd..6c06f012 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc index a11d0c54..db8aba63 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/version.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/version.cpython-37.pyc index f8bb00a3..dcec0d78 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/version.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/version.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc index 2a4bc3d6..72ee42f4 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc index 34c05d54..30c4d137 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc index 44c53da1..59fe7e24 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc index a89bc538..ed1dc01b 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc index b6c56da9..9274a2f0 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc index 62129e50..dfd07771 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc index 292184d2..a0717da2 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc index ac082a8e..7e83182a 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc index 192a389f..8bff9eba 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc index 6e41c419..36326e90 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc index 7c0d24e5..b71b27c6 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc index 85139aa9..1e321b19 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc index b5ae7a03..c167cc35 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc index 03eeaeb5..397a3e45 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc index d1a1c722..885e8812 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc index 776ed3b3..58b1a205 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc index f40893af..65c1e1c3 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc index 56d81897..67c31289 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc index 4272d112..755c7870 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc index 4961ffd7..45765de7 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc index bf8fae9e..b16e7e3a 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc index 5c38f9b3..c79ac52d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc index c45599ad..4a89dcb9 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc index 064dc9f3..944de804 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc index 95e4dce8..c1ac9594 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc index 5067a8d9..346d4b10 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/metadata.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/metadata.cpython-37.pyc index 05a4b04e..e6a40ad8 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/metadata.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/metadata.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc index 4e10730a..b246a147 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc index 4f24562f..57844ab7 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/util.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/util.cpython-37.pyc index 71ad4633..601cd80d 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/util.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/util.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc index 938022c9..864e1489 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc index 1c226cf8..f1dbf075 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/win32/lib/__pycache__/pywintypes.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/win32/lib/__pycache__/pywintypes.cpython-37.pyc index 9220c7ed..55f66188 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/win32/lib/__pycache__/pywintypes.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/win32/lib/__pycache__/pywintypes.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/win32com/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/win32com/__pycache__/__init__.cpython-37.pyc index b6fdb360..b276fcb2 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/win32com/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/win32com/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/win32comext/shell/__pycache__/__init__.cpython-37.pyc b/WPy32-3720/python-3.7.2/Lib/site-packages/win32comext/shell/__pycache__/__init__.cpython-37.pyc index 4c5176f3..70aeae29 100644 Binary files a/WPy32-3720/python-3.7.2/Lib/site-packages/win32comext/shell/__pycache__/__init__.cpython-37.pyc and b/WPy32-3720/python-3.7.2/Lib/site-packages/win32comext/shell/__pycache__/__init__.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Lib/site-packages/wmi.py b/WPy32-3720/python-3.7.2/Lib/site-packages/wmi.py new file mode 100644 index 00000000..c3dbfcbe --- /dev/null +++ b/WPy32-3720/python-3.7.2/Lib/site-packages/wmi.py @@ -0,0 +1,1441 @@ +""" +Windows Management Instrumentation (WMI) is Microsoft's answer to +the DMTF's Common Information Model. It allows you to query just +about any conceivable piece of information from any computer which +is running the necessary agent and over which have you the +necessary authority. + +Since the COM implementation doesn't give much away to Python +programmers, I've wrapped it in some lightweight classes with +some getattr / setattr magic to ease the way. In particular: + +* The :class:`_wmi_namespace` object itself will determine its classes + and allow you to return all instances of any of them by + using its name as an attribute:: + + disks = wmi.WMI ().Win32_LogicalDisk () + +* In addition, you can specify what would become the WHERE clause + as keyword parameters:: + + fixed_disks = wmi.WMI ().Win32_LogicalDisk (DriveType=3) + +* The objects returned by a WMI lookup are wrapped in a Python + class which determines their methods and classes and allows + you to access them as though they were Python classes. The + methods only allow named parameters:: + + for p in wmi.WMI ().Win32_Process (Name="notepad.exe"): + p.Terminate (Result=1) + +* Doing a print on one of the WMI objects will result in its + `GetObjectText\_` method being called, which usually produces + a meaningful printout of current values. + The repr of the object will include its full WMI path, + which lets you get directly to it if you need to. + +* You can get the associators and references of an object as + a list of python objects by calling the associators () and + references () methods on a WMI Python object:: + + for p in wmi.WMI ().Win32_Process (Name="notepad.exe"): + for r in p.references (): + print r + + .. note:: + Don't do this on a Win32_ComputerSystem object; it will + take all day and kill your machine! + + +* WMI classes (as opposed to instances) are first-class + objects, so you can get hold of a class, and call + its methods or set up a watch against it:: + + process = wmi.WMI ().Win32_Process + process.Create (CommandLine="notepad.exe") + +* To make it easier to use in embedded systems and py2exe-style + executable wrappers, the module will not force early Dispatch. + To do this, it uses a handy hack by Thomas Heller for easy access + to constants. + +Typical usage will be:: + + import wmi + + vodev1 = wmi.WMI ("vodev1") + for disk in vodev1.Win32_LogicalDisk (): + if disk.DriveType == 3: + space = 100 * long (disk.FreeSpace) / long (disk.Size) + print "%s has %d%% free" % (disk.Name, space) + +Many thanks, obviously to Mark Hammond for creating the win32all +extensions, but also to Alex Martelli and Roger Upole, whose +c.l.py postings pointed me in the right direction. +Thanks especially in release 1.2 to Paul Tiemann for his code +contributions and robust testing. +""" +__VERSION__ = __version__ = "1.4.9" + +_DEBUG = False + +import sys +import datetime +import re +import struct +import warnings + +from win32com.client import GetObject, Dispatch +import pywintypes + +def signed_to_unsigned (signed): + """Convert a (possibly signed) long to unsigned hex. Useful + when converting a COM error code to the more conventional + 8-digit hex:: + + print "%08X" % signed_to_unsigned (-2147023174) + """ + unsigned, = struct.unpack ("L", struct.pack ("l", signed)) + return unsigned + +class SelfDeprecatingDict (object): + """Provides for graceful degradation of objects which + are currently dictionaries (and therefore accessed via + `.keys`, `.items`, etc.) into lists. Wraps an existing + `dict` and allows it to be addressed as a `dict` or as a + `list` during an interregnum, issuing a `DeprecationWarning` + if accessed as a `dict`. + """ + + dict_only = set (dir (dict)).difference (dir (list)) + + def __init__ (self, dictlike): + self.dict = dict (dictlike) + self.list = list (self.dict) + + def __getattr__ (self, attribute): + if attribute in self.dict_only: + warnings.warn ("In future this will be a list and not a dictionary", DeprecationWarning) + return getattr (self.dict, attribute) + else: + return getattr (self.list, attribute) + + def __iter__ (self): + return iter (self.list) + + def __str__ (self): + return str (self.list) + + def __repr__ (self): + return repr (self.list) + + def __getitem__ (self, item): + try: + return self.list[item] + except TypeError: + return self.dict[item] + +class ProvideConstants (object): + """When called on a ``win32com.client.Dispatch`` object, + provides lazy access to constants defined in the typelib. + They can then be accessed as attributes of the :attr:`_constants` + property. (From Thomas Heller on c.l.py). + """ + def __init__(self, comobj): + comobj.__dict__["_constants"] = self + self.__typecomp = \ + comobj._oleobj_.GetTypeInfo().GetContainingTypeLib()[0].GetTypeComp() + + def __getattr__(self, name): + if name.startswith("__") and name.endswith("__"): + raise AttributeError (name) + result = self.__typecomp.Bind(name) + if not result[0]: + raise AttributeError (name) + return result[1].value + +obj = GetObject ("winmgmts:") +ProvideConstants (obj) + +wbemErrInvalidQuery = obj._constants.wbemErrInvalidQuery +wbemErrTimedout = obj._constants.wbemErrTimedout +wbemFlagReturnImmediately = obj._constants.wbemFlagReturnImmediately +wbemFlagForwardOnly = obj._constants.wbemFlagForwardOnly + +# +# Exceptions +# +class x_wmi (Exception): + """Ancestor of all wmi-related exceptions. Keeps track of + an info message and the underlying COM error if any, exposed + as the :attr:`com_error` attribute. + """ + def __init__ (self, info="", com_error=None): + self.info = info + self.com_error = com_error + + def __str__ (self): + return "" % ( + self.info or "Unexpected COM Error", + self.com_error or "(no underlying exception)" + ) + +class x_wmi_invalid_query (x_wmi): + "Raised when a WMI returns `wbemErrInvalidQuery`" + pass + +class x_wmi_timed_out (x_wmi): + "Raised when a watcher times out" + pass + +class x_wmi_no_namespace (x_wmi): + """Raised when an attempt is made to query or watch + from a class without a namespace. + """ + pass + +class x_access_denied (x_wmi): + "Raised when WMI raises 80070005" + pass + +class x_wmi_authentication (x_wmi): + "Raised when an invalid combination of authentication properties is attempted when connecting" + pass + +class x_wmi_uninitialised_thread (x_wmi): + """Raised when WMI returns 800401E4 on connection, usually + indicating that no COM threading model has been initialised + """ + pass + +WMI_EXCEPTIONS = { + signed_to_unsigned (wbemErrInvalidQuery) : x_wmi_invalid_query, + signed_to_unsigned (wbemErrTimedout) : x_wmi_timed_out, + 0x80070005 : x_access_denied, + 0x80041003 : x_access_denied, + 0x800401E4 : x_wmi_uninitialised_thread, +} + +def handle_com_error (err=None): + """Convenience wrapper for displaying all manner of COM errors. + Raises a :exc:`x_wmi` exception with more useful information attached + + :param err: The structure attached to a `pywintypes.com_error` + """ + if err is None: + _, err, _ = sys.exc_info () + hresult_code, hresult_name, additional_info, parameter_in_error = err.args + hresult_code = signed_to_unsigned (hresult_code) + exception_string = ["%s - %s" % (hex (hresult_code), hresult_name)] + scode = None + if additional_info: + wcode, source_of_error, error_description, whlp_file, whlp_context, scode = additional_info + scode = signed_to_unsigned (scode) + exception_string.append (" Error in: %s" % source_of_error) + exception_string.append (" %s - %s" % (hex (scode), (error_description or "").strip ())) + for error_code, klass in WMI_EXCEPTIONS.items (): + if error_code in (hresult_code, scode): + break + else: + klass = x_wmi + raise klass (com_error=err) + + +BASE = datetime.datetime (1601, 1, 1) +def from_1601 (ns100): + return BASE + datetime.timedelta (microseconds=int (ns100) / 10) + +def from_time (year=None, month=None, day=None, hours=None, minutes=None, seconds=None, microseconds=None, timezone=None): + """Convenience wrapper to take a series of date/time elements and return a WMI time + of the form `yyyymmddHHMMSS.mmmmmm+UUU`. All elements may be int, string or + omitted altogether. If omitted, they will be replaced in the output string + by a series of stars of the appropriate length. + + :param year: The year element of the date/time + :param month: The month element of the date/time + :param day: The day element of the date/time + :param hours: The hours element of the date/time + :param minutes: The minutes element of the date/time + :param seconds: The seconds element of the date/time + :param microseconds: The microseconds element of the date/time + :param timezone: The timeezone element of the date/time + + :returns: A WMI datetime string of the form: `yyyymmddHHMMSS.mmmmmm+UUU` + """ + def str_or_stars (i, length): + if i is None: + return "*" * length + else: + return str (i).rjust (length, "0") + + wmi_time = "" + wmi_time += str_or_stars (year, 4) + wmi_time += str_or_stars (month, 2) + wmi_time += str_or_stars (day, 2) + wmi_time += str_or_stars (hours, 2) + wmi_time += str_or_stars (minutes, 2) + wmi_time += str_or_stars (seconds, 2) + wmi_time += "." + wmi_time += str_or_stars (microseconds, 6) + if timezone >= 0: + wmi_time += "+" + else: + wmi_time += "-" + timezone = abs (timezone) + wmi_time += str_or_stars (timezone, 3) + + return wmi_time + +def to_time (wmi_time): + """Convenience wrapper to take a WMI datetime string of the form + yyyymmddHHMMSS.mmmmmm+UUU and return a 9-tuple containing the + individual elements, or None where string contains placeholder + stars. + + :param wmi_time: The WMI datetime string in `yyyymmddHHMMSS.mmmmmm+UUU` format + + :returns: A 9-tuple of (year, month, day, hours, minutes, seconds, microseconds, timezone) + """ + def int_or_none (s, start, end): + try: + return int (s[start:end]) + except ValueError: + return None + + year = int_or_none (wmi_time, 0, 4) + month = int_or_none (wmi_time, 4, 6) + day = int_or_none (wmi_time, 6, 8) + hours = int_or_none (wmi_time, 8, 10) + minutes = int_or_none (wmi_time, 10, 12) + seconds = int_or_none (wmi_time, 12, 14) + microseconds = int_or_none (wmi_time, 15, 21) + timezone = wmi_time[22:] + if timezone == "***": + timezone = None + + return year, month, day, hours, minutes, seconds, microseconds, timezone + +def _set (obj, attribute, value): + """Helper function to add an attribute directly into the instance + dictionary, bypassing possible `__getattr__` calls + + :param obj: Any python object + :param attribute: String containing attribute name + :param value: Any python object + """ + obj.__dict__[attribute] = value + +class _wmi_method: + """A currying sort of wrapper around a WMI method name. It + abstract's the method's parameters and can be called like + a normal Python object passing in the parameter values. + + Output parameters are returned from the call as a tuple. + In addition, the docstring is set up as the method's + signature, including an indication as to whether any + given parameter is expecting an array, and what + special privileges are required to call the method. + """ + + def __init__ (self, ole_object, method_name): + """ + :param ole_object: The WMI class/instance whose method is to be called + :param method_name: The name of the method to be called + """ + try: + self.ole_object = Dispatch (ole_object) + self.method = ole_object.Methods_ (method_name) + self.qualifiers = {} + for q in self.method.Qualifiers_: + self.qualifiers[q.Name] = q.Value + self.provenance = "\n".join (self.qualifiers.get ("MappingStrings", [])) + + self.in_parameters = self.method.InParameters + self.out_parameters = self.method.OutParameters + if self.in_parameters is None: + self.in_parameter_names = [] + else: + self.in_parameter_names = [(i.Name, i.IsArray) for i in self.in_parameters.Properties_] + if self.out_parameters is None: + self.out_parameter_names = [] + else: + self.out_parameter_names = [(i.Name, i.IsArray) for i in self.out_parameters.Properties_] + + doc = "%s (%s) => (%s)" % ( + method_name, + ", ".join ([name + ("", "[]")[is_array] for (name, is_array) in self.in_parameter_names]), + ", ".join ([name + ("", "[]")[is_array] for (name, is_array) in self.out_parameter_names]) + ) + privileges = self.qualifiers.get ("Privileges", []) + if privileges: + doc += " | Needs: " + ", ".join (privileges) + self.__doc__ = doc + except pywintypes.com_error: + handle_com_error () + + def __call__ (self, *args, **kwargs): + """Execute the call to a WMI method, returning + a tuple (even if is of only one value) containing + the out and return parameters. + """ + try: + if self.in_parameters: + parameter_names = {} + for name, is_array in self.in_parameter_names: + parameter_names[name] = is_array + + parameters = self.in_parameters + + # + # Check positional parameters first + # + for n_arg in range (len (args)): + arg = args[n_arg] + parameter = parameters.Properties_[n_arg] + if parameter.IsArray: + try: list (arg) + except TypeError: raise TypeError ("parameter %d must be iterable" % n_arg) + parameter.Value = arg + + # + # If any keyword param supersedes a positional one, + # it'll simply overwrite it. + # + for k, v in kwargs.items (): + is_array = parameter_names.get (k) + if is_array is None: + raise AttributeError ("%s is not a valid parameter for %s" % (k, self.__doc__)) + else: + if is_array: + try: list (v) + except TypeError: raise TypeError ("%s must be iterable" % k) + parameters.Properties_ (k).Value = v + + result = self.ole_object.ExecMethod_ (self.method.Name, self.in_parameters) + else: + result = self.ole_object.ExecMethod_ (self.method.Name) + + results = [] + for name, is_array in self.out_parameter_names: + value = result.Properties_ (name).Value + if is_array: + # + # Thanks to Jonas Bjering for bug report and patch + # + results.append (list (value or [])) + else: + results.append (value) + return tuple (results) + + except pywintypes.com_error: + handle_com_error () + + def __repr__ (self): + return "" % self.__doc__ + +class _wmi_property (object): + + def __init__ (self, property): + self.property = property + self.name = property.Name + self.value = property.Value + self.qualifiers = dict ((q.Name, q.Value) for q in property.Qualifiers_) + self.type = self.qualifiers.get ("CIMTYPE", None) + + def set (self, value): + self.property.Value = value + + def __repr__ (self): + return "" % self.name + + def __getattr__ (self, attr): + return getattr (self.property, attr) + +# +# class _wmi_object +# +class _wmi_object: + """The heart of the WMI module: wraps the objects returned by COM + ISWbemObject interface and provide readier access to their properties + and methods resulting in a more Pythonic interface. Not usually + instantiated directly, rather as a result of calling a :class:`_wmi_class` + on the parent :class:`_wmi_namespace`. + + If you get hold of a WMI-related COM object from some other + source than this module, you can wrap it in one of these objects + to get the benefits of the module:: + + import win32com.client + import wmi + + wmiobj = win32com.client.GetObject ("winmgmts:Win32_LogicalDisk.DeviceID='C:'") + c_drive = wmi._wmi_object (wmiobj) + print c_drive + """ + + def __init__ (self, ole_object, instance_of=None, fields=[], property_map={}): + try: + _set (self, "ole_object", ole_object) + _set (self, "id", ole_object.Path_.DisplayName.lower ()) + _set (self, "_instance_of", instance_of) + _set (self, "properties", {}) + _set (self, "methods", {}) + _set (self, "property_map", property_map) + _set (self, "_associated_classes", None) + _set (self, "_keys", None) + + if fields: + for field in fields: + self.properties[field] = None + else: + for p in ole_object.Properties_: + self.properties[p.Name] = None + + for m in ole_object.Methods_: + self.methods[m.Name] = None + + _set (self, "_properties", self.properties.keys ()) + _set (self, "_methods", self.methods.keys ()) + _set (self, "qualifiers", dict ((q.Name, q.Value) for q in self.ole_object.Qualifiers_)) + + except pywintypes.com_error: + handle_com_error () + + def __lt__ (self, other): + return self.id < other.id + + def __str__ (self): + """For a call to print [object] return the OLE description + of the properties / values of the object + """ + try: + return self.ole_object.GetObjectText_ () + except pywintypes.com_error: + handle_com_error () + + def __repr__ (self): + """ + Indicate both the fact that this is a wrapped WMI object + and the WMI object's own identifying class. + """ + try: + return "<%s: %s>" % (self.__class__.__name__, self.Path_.Path.encode ("ascii", "backslashreplace")) + except pywintypes.com_error: + handle_com_error () + + def _cached_properties (self, attribute): + if self.properties[attribute] is None: + self.properties[attribute] = _wmi_property (self.ole_object.Properties_ (attribute)) + return self.properties[attribute] + + def _cached_methods (self, attribute): + if self.methods[attribute] is None: + self.methods[attribute] = _wmi_method (self.ole_object, attribute) + return self.methods[attribute] + + def __getattr__ (self, attribute): + """ + Attempt to pass attribute calls to the proxied COM object. + If the attribute is recognised as a property, return its value; + if it is recognised as a method, return a method wrapper which + can then be called with parameters; otherwise pass the lookup + on to the underlying object. + """ + try: + if attribute in self.properties: + property = self._cached_properties (attribute) + factory = self.property_map.get (attribute, self.property_map.get (property.type, lambda x: x)) + value = factory (property.value) + # + # If this is an association, certain of its properties + # are actually the paths to the aspects of the association, + # so translate them automatically into WMI objects. + # + if property.type.startswith ("ref:"): + return WMI (moniker=value) + else: + return value + elif attribute in self.methods: + return self._cached_methods (attribute) + else: + return getattr (self.ole_object, attribute) + except pywintypes.com_error: + handle_com_error () + + def __setattr__ (self, attribute, value): + """If the attribute to be set is valid for the proxied + COM object, set that objects's parameter value; if not, + raise an exception. + """ + try: + if attribute in self.properties: + self._cached_properties (attribute).set (value) + if self.ole_object.Path_.Path: + self.ole_object.Put_ () + else: + raise AttributeError (attribute) + except pywintypes.com_error: + handle_com_error () + + def __eq__ (self, other): + return self.id == other.id + + def __hash__ (self): + return hash (self.id) + + def _getAttributeNames (self): + """Return list of methods/properties for IPython completion""" + attribs = [str (x) for x in self.methods.keys ()] + attribs.extend ([str (x) for x in self.properties.keys ()]) + return attribs + + def _get_keys (self): + """A WMI object is uniquely defined by a set of properties + which constitute its keys. Lazily retrieves the keys for this + instance or class. + + :returns: list of key property names + """ + # NB You can get the keys of an instance more directly, via + # Path\_.Keys but this doesn't apply to classes. The technique + # here appears to work for both. + if self._keys is None: + _set (self, "_keys", []) + for property in self.ole_object.Properties_: + for qualifier in property.Qualifiers_: + if qualifier.Name == "key" and qualifier.Value: + self._keys.append (property.Name) + return self._keys + keys = property (_get_keys) + + def wmi_property (self, property_name): + """Return the cached object representing one property + of this object + """ + return _wmi_property (self.ole_object.Properties_ (property_name)) + + def put (self): + """Push all outstanding property updates back to the + WMI database. + """ + self.ole_object.Put_ () + + def set (self, **kwargs): + """Set several properties of the underlying object + at one go. This is particularly useful in combination + with the new () method below. However, an instance + which has been spawned in this way won't have enough + information to write pack, so only try if the + instance has a path. + """ + if kwargs: + try: + for attribute, value in kwargs.items (): + if attribute in self.properties: + self._cached_properties (attribute).set (value) + else: + raise AttributeError (attribute) + # + # Only try to write the attributes + # back if the object exists. + # + if self.ole_object.Path_.Path: + self.ole_object.Put_ () + except pywintypes.com_error: + handle_com_error () + + def path (self): + """Return the WMI URI to this object. Can be used to + determine the path relative to the parent namespace:: + + pp0 = wmi.WMI ().Win32_ParallelPort ()[0] + print pp0.path ().RelPath + + .. Do more with this + """ + try: + return self.ole_object.Path_ + except pywintypes.com_error: + handle_com_error () + + def derivation (self): + """Return a tuple representing the object derivation for + this object, with the most specific object first:: + + pp0 = wmi.WMI ().Win32_ParallelPort ()[0] + print ' <- '.join (pp0.derivation ()) + """ + try: + return self.ole_object.Derivation_ + except pywintypes.com_error: + handle_com_error () + + def _cached_associated_classes (self): + if self._associated_classes is None: + if isinstance (self, _wmi_class): + params = {'bSchemaOnly' : True} + else: + params = {'bClassesOnly' : True} + try: + associated_classes = dict ( + (assoc.Path_.Class, _wmi_class (self._namespace, assoc)) for + assoc in self.ole_object.Associators_ (**params) + ) + _set (self, "_associated_classes", associated_classes) + except pywintypes.com_error: + handle_com_error () + + return self._associated_classes + associated_classes = property (_cached_associated_classes) + + def associators (self, wmi_association_class="", wmi_result_class=""): + """Return a list of objects related to this one, optionally limited + either by association class (ie the name of the class which relates + them) or by result class (ie the name of the class which would be + retrieved):: + + c = wmi.WMI () + pp = c.Win32_ParallelPort ()[0] + + for i in pp.associators (wmi_association_class="Win32_PortResource"): + print i + + for i in pp.associators (wmi_result_class="Win32_PnPEntity"): + print i + """ + try: + return [ + _wmi_object (i) for i in \ + self.ole_object.Associators_ ( + strAssocClass=wmi_association_class, + strResultClass=wmi_result_class + ) + ] + except pywintypes.com_error: + handle_com_error () + + def references (self, wmi_class=""): + """Return a list of associations involving this object, optionally + limited by the result class (the name of the association class). + + NB Associations are treated specially; although WMI only returns + the string corresponding to the instance of each associated object, + this module will automatically convert that to the object itself:: + + c = wmi.WMI () + sp = c.Win32_SerialPort ()[0] + + for i in sp.references (): + print i + + for i in sp.references (wmi_class="Win32_SerialPortSetting"): + print i + """ + # + # FIXME: Allow an actual class to be passed in, using + # its .Path_.RelPath property to determine the string + # + try: + return [_wmi_object (i) for i in self.ole_object.References_ (strResultClass=wmi_class)] + except pywintypes.com_error: + handle_com_error () + +# +# class _wmi_event +# +class _wmi_event (_wmi_object): + """Slight extension of the _wmi_object class to allow + objects which are the result of events firing to return + extra information such as the type of event. + """ + event_type_re = re.compile ("__Instance(Creation|Modification|Deletion)Event") + def __init__ (self, event, event_info, fields=[]): + _wmi_object.__init__ (self, event, fields=fields) + _set (self, "event_type", None) + _set (self, "timestamp", None) + _set (self, "previous", None) + + if event_info: + event_type = self.event_type_re.match (event_info.Path_.Class).group (1).lower () + _set (self, "event_type", event_type) + if hasattr (event_info, "TIME_CREATED"): + _set (self, "timestamp", from_1601 (event_info.TIME_CREATED)) + if hasattr (event_info, "PreviousInstance"): + _set (self, "previous", event_info.PreviousInstance) + +# +# class _wmi_class +# +class _wmi_class (_wmi_object): + """Currying class to assist in issuing queries against + a WMI namespace. The idea is that when someone issues + an otherwise unknown method against the WMI object, if + it matches a known WMI class a query object will be + returned which may then be called with one or more params + which will form the WHERE clause:: + + c = wmi.WMI () + c_drives = c.Win32_LogicalDisk (Name='C:') + """ + def __init__ (self, namespace, wmi_class): + _wmi_object.__init__ (self, wmi_class) + _set (self, "_class_name", wmi_class.Path_.Class) + if namespace: + _set (self, "_namespace", namespace) + else: + class_moniker = wmi_class.Path_.DisplayName + winmgmts, namespace_moniker, class_name = class_moniker.split (":") + namespace = _wmi_namespace (GetObject (winmgmts + ":" + namespace_moniker), False) + _set (self, "_namespace", namespace) + + def __getattr__ (self, attribute): + try: + if attribute in self.properties: + return _wmi_property (self.Properties_ (attribute)) + else: + return _wmi_object.__getattr__ (self, attribute) + except pywintypes.com_error: + handle_com_error () + + + def query (self, fields=[], **where_clause): + """Make it slightly easier to query against the class, + by calling the namespace's query with the class preset. + Won't work if the class has been instantiated directly. + """ + # + # FIXME: Not clear if this can ever happen + # + if self._namespace is None: + raise x_wmi_no_namespace ("You cannot query directly from a WMI class") + + try: + field_list = ", ".join (fields) or "*" + wql = "SELECT " + field_list + " FROM " + self._class_name + if where_clause: + wql += " WHERE " + " AND ". join (["%s = %r" % (k, str (v)) for k, v in where_clause.items ()]) + return self._namespace.query (wql, self, fields) + except pywintypes.com_error: + handle_com_error () + + __call__ = query + + def watch_for ( + self, + notification_type="operation", + delay_secs=1, + fields=[], + **where_clause + ): + if self._namespace is None: + raise x_wmi_no_namespace ("You cannot watch directly from a WMI class") + + valid_notification_types = ("operation", "creation", "deletion", "modification") + if notification_type.lower () not in valid_notification_types: + raise x_wmi ("notification_type must be one of %s" % ", ".join (valid_notification_types)) + + return self._namespace.watch_for ( + notification_type=notification_type, + wmi_class=self, + delay_secs=delay_secs, + fields=fields, + **where_clause + ) + + def instances (self): + """Return a list of instances of the WMI class + """ + try: + return [_wmi_object (instance, self) for instance in self.Instances_ ()] + except pywintypes.com_error: + handle_com_error () + + def new (self, **kwargs): + """This is the equivalent to the raw-WMI SpawnInstance\_ + method. Note that there are relatively few uses for + this, certainly fewer than you might imagine. Most + classes which need to create a new *real* instance + of themselves, eg Win32_Process, offer a .Create + method. SpawnInstance\_ is generally reserved for + instances which are passed as parameters to such + `.Create` methods, a common example being the + `Win32_SecurityDescriptor`, passed to `Win32_Share.Create` + and other instances which need security. + + The example here is `Win32_ProcessStartup`, which + controls the shown/hidden state etc. of a new + `Win32_Process` instance:: + + import win32con + import wmi + c = wmi.WMI () + startup = c.Win32_ProcessStartup.new (ShowWindow=win32con.SW_SHOWMINIMIZED) + pid, retval = c.Win32_Process.Create ( + CommandLine="notepad.exe", + ProcessStartupInformation=startup + ) + + .. warning:: + previous versions of this docstring illustrated using this function + to create a new process. This is *not* a good example of its use; + it is better handled with something like the example above. + """ + try: + obj = _wmi_object (self.SpawnInstance_ (), self) + obj.set (**kwargs) + return obj + except pywintypes.com_error: + handle_com_error () + +# +# class _wmi_result +# +class _wmi_result: + """Simple, data only result for targeted WMI queries which request + data only result classes via fetch_as_classes. + """ + def __init__(self, obj, attributes): + if attributes: + for attr in attributes: + self.__dict__[attr] = obj.Properties_ (attr).Value + else: + for p in obj.Properties_: + attr = p.Name + self.__dict__[attr] = obj.Properties_(attr).Value + +# +# class WMI +# +class _wmi_namespace: + """A WMI root of a computer system. The classes attribute holds a list + of the classes on offer. This means you can explore a bit with + things like this:: + + c = wmi.WMI () + for i in c.classes: + if "user" in i.lower (): + print i + """ + def __init__ (self, namespace, find_classes): + _set (self, "_namespace", namespace) + # + # wmi attribute preserved for backwards compatibility + # + _set (self, "wmi", namespace) + + self._classes = None + self._classes_map = {} + # + # Pick up the list of classes under this namespace + # so that they can be queried, and used as though + # properties of the namespace by means of the __getattr__ + # hook below. + # If the namespace does not support SubclassesOf, carry on + # regardless + # + if find_classes: + _ = self.classes + + def __repr__ (self): + return "<_wmi_namespace: %s>" % self.wmi + + def __str__ (self): + return repr (self) + + def _get_classes (self): + if self._classes is None: + self._classes = self.subclasses_of () + return SelfDeprecatingDict (dict.fromkeys (self._classes)) + classes = property (_get_classes) + + def get (self, moniker): + try: + return _wmi_object (self.wmi.Get (moniker)) + except pywintypes.com_error: + handle_com_error () + + def handle (self): + """The raw OLE object representing the WMI namespace""" + return self._namespace + + def subclasses_of (self, root="", regex=r".*"): + try: + SubclassesOf = self._namespace.SubclassesOf + except AttributeError: + return set () + else: + return set ( + c.Path_.Class + for c in SubclassesOf (root) + if re.match (regex, c.Path_.Class) + ) + + def instances (self, class_name): + """Return a list of instances of the WMI class. This is + (probably) equivalent to querying with no qualifiers:: + + wmi.WMI ().instances ("Win32_LogicalDisk") + # should be the same as + wmi.WMI ().Win32_LogicalDisk () + """ + try: + return [_wmi_object (obj) for obj in self._namespace.InstancesOf (class_name)] + except pywintypes.com_error: + handle_com_error () + + def new (self, wmi_class, **kwargs): + """This is now implemented by a call to :meth:`_wmi_class.new`""" + return getattr (self, wmi_class).new (**kwargs) + + new_instance_of = new + + def _raw_query (self, wql): + """Execute a WQL query and return its raw results. Use the flags + recommended by Microsoft to achieve a read-only, semi-synchronous + query where the time is taken while looping through. + NB Backslashes need to be doubled up. + """ + flags = wbemFlagReturnImmediately | wbemFlagForwardOnly + wql = wql.replace ("\\", "\\\\") + try: + return self._namespace.ExecQuery (strQuery=wql, iFlags=flags) + except pywintypes.com_error: + handle_com_error () + + def query (self, wql, instance_of=None, fields=[]): + """Perform an arbitrary query against a WMI object, and return + a list of _wmi_object representations of the results. + """ + return [ _wmi_object (obj, instance_of, fields) for obj in self._raw_query(wql) ] + + def fetch_as_classes (self, wmi_classname, fields=(), **where_clause): + """Build and execute a wql query to fetch the specified list of fields from + the specified wmi_classname + where_clause, then return the results as + a list of simple class instances with attributes matching field_list. + + If fields is left empty, select * and pre-load all class attributes for + each class returned. + """ + wql = "SELECT %s FROM %s" % (fields and ", ".join (fields) or "*", wmi_classname) + if where_clause: + wql += " WHERE " + " AND ".join (["%s = '%s'" % (k, v) for k, v in where_clause.items()]) + return [_wmi_result (obj, fields) for obj in self._raw_query(wql)] + + def fetch_as_lists (self, wmi_classname, fields, **where_clause): + """Build and execute a wql query to fetch the specified list of fields from + the specified wmi_classname + where_clause, then return the results as + a list of lists whose values correspond to field_list. + """ + wql = "SELECT %s FROM %s" % (", ".join (fields), wmi_classname) + if where_clause: + wql += " WHERE " + " AND ".join (["%s = '%s'" % (k, v) for k, v in where_clause.items()]) + results = [] + for obj in self._raw_query(wql): + results.append ([obj.Properties_ (field).Value for field in fields]) + return results + + def watch_for ( + self, + raw_wql=None, + notification_type="operation", + wmi_class=None, + delay_secs=1, + fields=[], + **where_clause + ): + """Set up an event tracker on a WMI event. This function + returns an wmi_watcher which can be called to get the + next event:: + + c = wmi.WMI () + + raw_wql = "SELECT * FROM __InstanceCreationEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_Process'" + watcher = c.watch_for (raw_wql=raw_wql) + while 1: + process_created = watcher () + print process_created.Name + + # or + + watcher = c.watch_for ( + notification_type="Creation", + wmi_class="Win32_Process", + delay_secs=2, + Name='calc.exe' + ) + calc_created = watcher () + + Now supports timeout on the call to watcher:: + + import pythoncom + import wmi + c = wmi.WMI (privileges=["Security"]) + watcher1 = c.watch_for ( + notification_type="Creation", + wmi_class="Win32_NTLogEvent", + Type="error" + ) + watcher2 = c.watch_for ( + notification_type="Creation", + wmi_class="Win32_NTLogEvent", + Type="warning" + ) + + while 1: + try: + error_log = watcher1 (500) + except wmi.x_wmi_timed_out: + pythoncom.PumpWaitingMessages () + else: + print error_log + + try: + warning_log = watcher2 (500) + except wmi.x_wmi_timed_out: + pythoncom.PumpWaitingMessages () + else: + print warning_log + """ + if isinstance (wmi_class, _wmi_class): + class_name = wmi_class._class_name + else: + class_name = wmi_class + wmi_class = getattr (self, class_name) + is_extrinsic = "__ExtrinsicEvent" in wmi_class.derivation () + if raw_wql: + wql = raw_wql + else: + fields = set (['TargetInstance'] + (fields or ["*"])) + field_list = ", ".join (fields) + if is_extrinsic: + if where_clause: + where = " WHERE " + " AND ".join (["%s = '%s'" % (k, v) for k, v in where_clause.items ()]) + else: + where = "" + wql = "SELECT " + field_list + " FROM " + class_name + where + else: + if where_clause: + where = " AND " + " AND ".join (["TargetInstance.%s = '%s'" % (k, v) for k, v in where_clause.items ()]) + else: + where = "" + wql = \ + "SELECT %s FROM __Instance%sEvent WITHIN %d WHERE TargetInstance ISA '%s' %s" % \ + (field_list, notification_type, delay_secs, class_name, where) + + try: + return _wmi_watcher ( + self._namespace.ExecNotificationQuery (wql), + is_extrinsic=is_extrinsic, + fields=fields + ) + except pywintypes.com_error: + handle_com_error () + + def __getattr__ (self, attribute): + """Offer WMI classes as simple attributes. Pass through any untrapped + unattribute to the underlying OLE object. This means that new or + unmapped functionality is still available to the module user. + """ + # + # Don't try to match against known classes as was previously + # done since the list may not have been requested + # (find_classes=False). + # + try: + return self._cached_classes (attribute) + except pywintypes.com_error: + return getattr (self._namespace, attribute) + + def _cached_classes (self, class_name): + """Standard caching helper which keeps track of classes + already retrieved by name and returns the existing object + if found. If this is the first retrieval, store it and + pass it back + """ + if class_name not in self._classes_map: + self._classes_map[class_name] = _wmi_class (self, self._namespace.Get (class_name)) + return self._classes_map[class_name] + + def _getAttributeNames (self): + """Return list of classes for IPython completion engine""" + return [x for x in self.classes if not x.startswith ('__')] + +# +# class _wmi_watcher +# +class _wmi_watcher: + """Helper class for WMI.watch_for below (qv)""" + + _event_property_map = { + "TargetInstance" : _wmi_object, + "PreviousInstance" : _wmi_object + } + def __init__ (self, wmi_event, is_extrinsic, fields=[]): + self.wmi_event = wmi_event + self.is_extrinsic = is_extrinsic + self.fields = fields + + def __call__ (self, timeout_ms=-1): + """When called, return the instance which caused the event. Supports + timeout in milliseconds (defaulting to infinite). If the watcher + times out, :exc:`x_wmi_timed_out` is raised. This makes it easy to support + watching for multiple objects. + """ + try: + event = self.wmi_event.NextEvent (timeout_ms) + if self.is_extrinsic: + return _wmi_event (event, None, self.fields) + else: + return _wmi_event ( + event.Properties_ ("TargetInstance").Value, + _wmi_object (event, property_map=self._event_property_map), + self.fields + ) + except pywintypes.com_error: + handle_com_error () + +PROTOCOL = "winmgmts:" +def connect ( + computer="", + impersonation_level="", + authentication_level="", + authority="", + privileges="", + moniker="", + wmi=None, + namespace="", + suffix="", + user="", + password="", + find_classes=False, + debug=False +): + """The WMI constructor can either take a ready-made moniker or as many + parts of one as are necessary. Eg:: + + c = wmi.WMI (moniker="winmgmts:{impersonationLevel=Delegate}//remote") + # or + c = wmi.WMI (computer="remote", privileges=["!RemoteShutdown", "Security"]) + + I daren't link to a Microsoft URL; they change so often. Try Googling for + WMI construct moniker and see what it comes back with. + + For complete control, a named argument "wmi" can be supplied, which + should be a SWbemServices object, which you create yourself. Eg:: + + loc = win32com.client.Dispatch("WbemScripting.SWbemLocator") + svc = loc.ConnectServer(...) + c = wmi.WMI(wmi=svc) + + This is the only way of connecting to a remote computer with a different + username, as the moniker syntax does not allow specification of a user + name. + + If the `wmi` parameter is supplied, all other parameters are ignored. + """ + global _DEBUG + _DEBUG = debug + + try: + try: + if wmi: + obj = wmi + + elif moniker: + if not moniker.startswith (PROTOCOL): + moniker = PROTOCOL + moniker + obj = GetObject (moniker) + + else: + if user: + if privileges or suffix: + raise x_wmi_authentication ("You can't specify privileges or a suffix as well as a username") + elif computer in (None, '', '.'): + raise x_wmi_authentication ("You can only specify user/password for a remote connection") + else: + obj = connect_server ( + server=computer, + namespace=namespace, + user=user, + password=password, + authority=authority, + impersonation_level=impersonation_level, + authentication_level=authentication_level + ) + + else: + moniker = construct_moniker ( + computer=computer, + impersonation_level=impersonation_level, + authentication_level=authentication_level, + authority=authority, + privileges=privileges, + namespace=namespace, + suffix=suffix + ) + obj = GetObject (moniker) + + wmi_type = get_wmi_type (obj) + + if wmi_type == "namespace": + return _wmi_namespace (obj, find_classes) + elif wmi_type == "class": + return _wmi_class (None, obj) + elif wmi_type == "instance": + return _wmi_object (obj) + else: + raise x_wmi ("Unknown moniker type") + + except pywintypes.com_error: + handle_com_error () + + except x_wmi_uninitialised_thread: + raise x_wmi_uninitialised_thread ("WMI returned a syntax error: you're probably running inside a thread without first calling pythoncom.CoInitialize[Ex]") + +WMI = connect + +def construct_moniker ( + computer=None, + impersonation_level=None, + authentication_level=None, + authority=None, + privileges=None, + namespace=None, + suffix=None +): + security = [] + if impersonation_level: security.append ("impersonationLevel=%s" % impersonation_level) + if authentication_level: security.append ("authenticationLevel=%s" % authentication_level) + # + # Use of the authority descriptor is invalid on the local machine + # + if authority and computer: security.append ("authority=%s" % authority) + if privileges: security.append ("(%s)" % ", ".join (privileges)) + + moniker = [PROTOCOL] + if security: moniker.append ("{%s}!" % ",".join (security)) + if computer: moniker.append ("//%s/" % computer) + if namespace: + parts = re.split (r"[/\\]", namespace) + if parts[0] != 'root': + parts.insert (0, "root") + moniker.append ("/".join (parts)) + if suffix: moniker.append (":%s" % suffix) + return "".join (moniker) + +def get_wmi_type (obj): + try: + path = obj.Path_ + except AttributeError: + return "namespace" + else: + if path.IsClass: + return "class" + else: + return "instance" + +def connect_server ( + server, + namespace = "", + user = "", + password = "", + locale = "", + authority = "", + impersonation_level="", + authentication_level="", + security_flags = 0x80, + named_value_set = None +): + """Return a remote server running WMI + + :param server: name of the server + :param namespace: namespace to connect to - defaults to whatever's defined as default + :param user: username to connect as, either local or domain (dom\\name or user@domain for XP) + :param password: leave blank to use current context + :param locale: desired locale in form MS_XXXX (eg MS_409 for Am En) + :param authority: either "Kerberos:" or an NT domain. Not needed if included in user + :param impersonation_level: valid WMI impersonation level + :param security_flags: if 0, connect will wait forever; if 0x80, connect will timeout at 2 mins + :param named_value_set: typically empty, otherwise a context-specific `SWbemNamedValueSet` + + Example:: + + remote_connetion = wmi.connect_server ( + server="remote_machine", user="myname", password="mypassword" + ) + c = wmi.WMI (wmi=remote_connection) + """ + # + # Thanks to Matt Mercer for example code to set + # impersonation & authentication on ConnectServer + # + if impersonation_level: + try: + impersonation = getattr (obj._constants, "wbemImpersonationLevel%s" % impersonation_level.title ()) + except AttributeError: + raise x_wmi_authentication ("No such impersonation level: %s" % impersonation_level) + else: + impersonation = None + + if authentication_level: + try: + authentication = getattr (obj._constants, "wbemAuthenticationLevel%s" % authentication_level.title ()) + except AttributeError: + raise x_wmi_authentication ("No such impersonation level: %s" % impersonation_level) + else: + authentication = None + + server = Dispatch ("WbemScripting.SWbemLocator").\ + ConnectServer ( + server, + namespace, + user, + password, + locale, + authority, + security_flags, + named_value_set + ) + if impersonation: + server.Security_.ImpersonationLevel = impersonation + if authentication: + server.Security_.AuthenticationLevel = authentication + return server + +def Registry ( + computer=None, + impersonation_level="Impersonate", + authentication_level="Default", + authority=None, + privileges=None, + moniker=None +): + + warnings.warn ("This function can be implemented using wmi.WMI (namespace='DEFAULT').StdRegProv", DeprecationWarning) + if not moniker: + moniker = construct_moniker ( + computer=computer, + impersonation_level=impersonation_level, + authentication_level=authentication_level, + authority=authority, + privileges=privileges, + namespace="default", + suffix="StdRegProv" + ) + + try: + return _wmi_object (GetObject (moniker)) + + except pywintypes.com_error: + handle_com_error () + +# +# Typical use test +# +if __name__ == '__main__': + system = WMI () + for my_computer in system.Win32_ComputerSystem (): + print ("Disks on", my_computer.Name) + for disk in system.Win32_LogicalDisk (): + print (disk.Caption, disk.Description, disk.ProviderName or "") + diff --git a/WPy32-3720/python-3.7.2/Scripts/__pycache__/wmiweb.cpython-37.pyc b/WPy32-3720/python-3.7.2/Scripts/__pycache__/wmiweb.cpython-37.pyc new file mode 100644 index 00000000..7737255c Binary files /dev/null and b/WPy32-3720/python-3.7.2/Scripts/__pycache__/wmiweb.cpython-37.pyc differ diff --git a/WPy32-3720/python-3.7.2/Scripts/wmitest.cmd b/WPy32-3720/python-3.7.2/Scripts/wmitest.cmd new file mode 100644 index 00000000..a6537b6a --- /dev/null +++ b/WPy32-3720/python-3.7.2/Scripts/wmitest.cmd @@ -0,0 +1,3 @@ +@echo off +for /l %%n in (24,1,31) do if exist c:\python%%n\python.exe (echo. & echo python%%n & c:\python%%n\python.exe -W ignore wmitest.py) +pause diff --git a/WPy32-3720/python-3.7.2/Scripts/wmitest.master.ini b/WPy32-3720/python-3.7.2/Scripts/wmitest.master.ini new file mode 100644 index 00000000..cff2740b --- /dev/null +++ b/WPy32-3720/python-3.7.2/Scripts/wmitest.master.ini @@ -0,0 +1,5 @@ +[settings] +; domain= +; machine= +; user= +; password= diff --git a/WPy32-3720/python-3.7.2/Scripts/wmitest.py b/WPy32-3720/python-3.7.2/Scripts/wmitest.py new file mode 100644 index 00000000..490029d1 --- /dev/null +++ b/WPy32-3720/python-3.7.2/Scripts/wmitest.py @@ -0,0 +1,714 @@ +"""Unit tests for WMI modules + +Some tests are optional, since they rely on remote machines and +usernames / passwords. To enable these, copy wmitest.master.ini +to wmitest.ini and set the parameters you have available. + +The watcher tests spawn temporary processes and temporary +logical drives. These may get left behind. +""" + +# +# TODO: +# - Test for negative timezone +# - Test for share name with embedded single quote +# + +import os, sys +import datetime +try: + import ConfigParser +except ImportError: + import configparser as ConfigParser +import operator +try: + import Queue +except ImportError: + import queue as Queue +try: + next +except NameError: + def next (iterator): return iterator.next () +import subprocess +import tempfile +import threading +import time +import unittest +import warnings + +import pythoncom +import win32api +import win32con +import win32file + +import wmi + +ini = ConfigParser.SafeConfigParser () +ini.read (["wmitest.master.ini", "wmitest.ini"]) +settings = {} +if ini.has_section ("settings"): + settings.update (ini.items ("settings")) +excludes = [i.strip () for i in settings.get ("excludes", "").split (",")] + +COMPUTERS = [None, "."] +if "machine" in settings: + COMPUTERS.append (settings['machine']) +IMPERSONATION_LEVELS = [None, "identify", "impersonate", "delegate"] +AUTHENTICATION_LEVELS = [None, "default", "none", "connect", "call", "pkt", "pktintegrity", "pktprivacy"] +AUTHORITIES = [None] +if set (["domain", "machine"]) <= set (settings): + #~ AUTHORITIES.append ("kerberos:%s" % settings['domain']) + AUTHORITIES.append ("ntlmdomain:%s" % settings['domain']) +PRIVILEGES = [None, ['security', '!shutdown']] +NAMESPACES = [None, "root/cimv2", "default"] + +class TestBasicConnections (unittest.TestCase): + + def test_basic_connection (self): + "Check that a standard connection works" + self.assert_ (wmi.WMI ()) + + def test_remote_connection (self): + "Check that a remote connection works, if specified" + if "machine" in settings: + self.assert_ (wmi.WMI (settings['machine'])) + else: + warnings.warn ("Skipping test_remote_connection") + + def test_simple_moniker (self): + "Check that a simple moniker works" + self.assert_ (wmi.WMI (moniker="winmgmts:")) + + def test_moniker_with_class (self): + "Check that specifying a class in moniker works" + c0 = wmi.WMI ().Win32_ComputerSystem + c1 = wmi.WMI (moniker="winmgmts:Win32_ComputerSystem") + self.assert_ (c0 == c1) + + def test_moniker_with_instance (self): + "Check that specifying an instance in the moniker works" + for c0 in wmi.WMI ().Win32_ComputerSystem (): + break + c1 = wmi.WMI (moniker='winmgmts:Win32_ComputerSystem.Name="%s"' % c0.Name) + self.assert_ (c0 == c1) + + def test_impersonation_levels (self): + "Check that specifying an impersonation level works" + for impersonation in IMPERSONATION_LEVELS: + self.assert_ (wmi.WMI (impersonation_level=impersonation)) + + def test_authentication_levels (self): + "Check that specifying an authentication level works" + for authentication in AUTHENTICATION_LEVELS: + try: + c = wmi.WMI (authentication_level=authentication) + except wmi.x_access_denied: + warnings.warn ("Access denied for authentication level %s" % authentication) + else: + self.assert_ (c) + + def test_authority (self): + "Check that specifying an authority works" + for authority in AUTHORITIES: + self.assert_ (wmi.WMI (authority=authority)) + + def test_privileges (self): + "Check that specifying privileges works" + for privileges in PRIVILEGES: + self.assert_ (wmi.WMI (privileges=privileges)) + + def test_namespace (self): + "Check that specifying a namespace works" + for namespace in NAMESPACES: + self.assert_ (wmi.WMI (namespace=namespace)) + + def test_suffix (self): + "Check that a suffix returns the class of that name" + self.assert_ (wmi.WMI (namespace="DEFAULT", suffix="StdRegProv") == wmi.WMI (namespace="DEFAULT").StdRegProv) + + def test_user_password (self): + "Check that username & password are passed through for a remote connection" + if set (["machine", "user", "password"]) <= set (settings): + self.assert_ (wmi.WMI (computer=settings['machine'], user=settings['user'], password=settings['password'])) + else: + warnings.warn ("Skipping test_user_password because no machine, user or password") + + def test_too_much_authentication (self): + "Check that user/password plus privs / suffix raises exception" + self.assertRaises (wmi.x_wmi_authentication, wmi.WMI, computer='***', user="***", password="***", privileges=["***"]) + self.assertRaises (wmi.x_wmi_authentication, wmi.WMI, computer='***', user="***", password="***", suffix="***") + + def test_user_password_with_impersonation_level (self): + "Check that an impersonation level works with a username / password" + if not (set (["machine", "user", "password"]) <= set (settings)): + warnings.warn ("Skipping test_user_password_with_impersonation_level because no machine, user or password") + else: + self.assert_ ( + wmi.WMI ( + computer=settings['machine'], + user=settings['user'], + password=settings['password'], + impersonation_level="impersonate" + ) + ) + + def test_user_password_with_invalid_impersonation_level (self): + "Check that an impersonation level works with a username / password" + if not (set (["machine", "user", "password"]) <= set (settings)): + warnings.warn ("Skipping test_user_password_with_invalid_impersonation_level because no machine, user or password") + else: + self.assertRaises ( + wmi.x_wmi_authentication, + wmi.WMI, + computer=settings['machine'], + user=settings['user'], + password=settings['password'], + impersonation_level="***" + ) + + def test_user_password_with_authentication_level (self): + "Check that an invalid impersonation level raises x_wmi_authentication" + if not (set (["machine", "user", "password"]) <= set (settings)): + warnings.warn ("Skipping test_user_password_with_authentication_level because no machine, user or password") + else: + self.assert_ ( + wmi.WMI ( + computer=settings['machine'], + user=settings['user'], + password=settings['password'], + authentication_level="pktIntegrity" + ) + ) + + def test_user_password_with_invalid_authentication_level (self): + "Check that an invalid authentication level raises x_wmi_authentication" + if not (set (["machine", "user", "password"]) <= set (settings)): + warnings.warn ("Skipping test_user_password_with_invalid_authentication_level because no machine, user or password") + else: + self.assertRaises ( + wmi.x_wmi_authentication, + wmi.WMI, + computer=settings['machine'], + user=settings['user'], + password=settings['password'], + authentication_level="***" + ) + + def test_local_user_password (self): + "Check that user/password for local connection raises exception" + self.assertRaises (wmi.x_wmi_authentication, wmi.WMI, user="***", password="***") + + def test_find_classes (self): + "Check ability to switch class scan on and off" + self.assert_ (wmi.WMI (find_classes=True)._classes) + self.assertFalse (wmi.WMI (find_classes=False)._classes) + + def test_find_classes_false (self): + "By default, don't scan for classes but load them on demand" + self.assertFalse (wmi.WMI ()._classes) + self.assert_ (wmi.WMI ().classes) + + def test_classes_acts_as_list (self): + self.assert_ (wmi.WMI ().classes.index) + + def test_classes_acts_as_dict (self): + self.assert_ (wmi.WMI ().classes.keys) + +class TestThreadedConnection (unittest.TestCase): + + + def test_initialised_thread (self): + """A WMI connection in a thread which has been initialised for COM + should succeed. + """ + def f (q): + pythoncom.CoInitialize () + try: + try: + wmi.WMI () + except: + q.put (False) + else: + q.put (True) + finally: + pythoncom.CoUninitialize () + + q = Queue.Queue () + threading.Thread (target=f, args=(q,)).start () + self.assert_ (q.get ()) + + def test_uninitialised_thread (self): + """A WMI connection in a thread which has not been initialised + for COM should fail with a wmi-specific exception. + """ + def f (q): + try: + wmi.WMI () + except wmi.x_wmi_uninitialised_thread: + q.put (True) + except: + q.put (False) + else: + q.put (False) + + q = Queue.Queue () + threading.Thread (target=f, args=(q,)).start () + self.assert_ (q.get ()) + +class TestMoniker (unittest.TestCase): + + def test_moniker (self): + """Look at all possible options for moniker construction and pass + them through to a WMI connector + """ + for computer in COMPUTERS: + if computer in (None, "."): + local_authorities = [None] + else: + local_authorities = AUTHORITIES + for impersonation_level in IMPERSONATION_LEVELS: + for authentication_level in AUTHENTICATION_LEVELS: + for authority in local_authorities: + for privileges in PRIVILEGES: + for namespace in NAMESPACES: + moniker = wmi.construct_moniker ( + computer=computer, + impersonation_level=impersonation_level, + authority=authority, + privileges=privileges, + namespace=namespace + ) + self.assert_ (wmi.WMI (moniker=moniker), "Moniker failed: %s" % moniker) + + def test_moniker_root_namespace (self): + "Check that namespace is prefixed by root if needed" + self.assertEquals (wmi.construct_moniker (namespace="default"), "winmgmts:root/default") + self.assertEquals (wmi.construct_moniker (namespace="root/default"), "winmgmts:root/default") + +class TestFunctions (unittest.TestCase): + + times = [ + ((2000, 1, 1), "20000101******.******+***"), + ((2000, 1, 1, 10, 0, 0), "20000101100000.******+***"), + ((2000, 1, 1, 10, 0, 0, 100), "20000101100000.000100+***"), + ((2000, 1, 1, 10, 0, 0, 100, "GMT"), "20000101100000.000100+GMT") + ] + + def test_signed_to_unsigned (self): + tests = [ + (0, 0), + (-1, 0xffffffff), + (+1, 1), + (0x7fffffff, 0x7fffffff), + (-0x7fffffff, 0x80000001) + ] + for signed, unsigned in tests: + self.assertEquals (wmi.signed_to_unsigned (signed), unsigned) + + def test_from_1601 (self): + "Check conversion from 100-ns intervals since 1601 (!)" + self.assertEquals (wmi.from_1601 (0), datetime.datetime (1601, 1, 1)) + self.assertEquals (wmi.from_1601 (24 * 60 * 60 * 10 * 1000 * 1000), datetime.datetime (1601, 1, 2)) + + def test_from_time (self): + "Check conversion from time-tuple to time-string" + for t, s in self.times: + self.assertEquals (wmi.from_time (*t), s) + + def test_to_time (self): + "Check conversion from time-string to time-tuple" + for t, s in self.times: + t = tuple (list (t) + ([None] * 8))[:8] + self.assertEquals (wmi.to_time (s), t) + + def test_get_wmi_type (self): + "Check that namespace, class & instance are identified correctly" + self.assertEquals (wmi.get_wmi_type (wmi.WMI ()), "namespace") + self.assertEquals (wmi.get_wmi_type (wmi.WMI ().Win32_ComputerSystem), "class") + for i in wmi.WMI ().Win32_ComputerSystem (): + self.assertEquals (wmi.get_wmi_type (i), "instance") + + def test_registry (self): + """Convenience Registry function is identical to picking + the StdRegProv class out of the DEFAULT namespace""" + self.assertEquals (wmi.Registry (), wmi.WMI (namespace="DEFAULT").StdRegProv) + +class TestWMI (unittest.TestCase): + + def setUp (self): + self.connection = wmi.WMI (namespace="root/cimv2", find_classes=False) + self.logical_disks = set (self.connection.Win32_LogicalDisk ()) + +class TestNamespace (TestWMI): + + def test_subclasses_of_simple (self): + self.assert_ ("Win32_ComputerSystem" in self.connection.subclasses_of ()) + + def test_subclasses_of_subtree (self): + self.assert_ ("Win32_Desktop" in self.connection.subclasses_of ("CIM_Setting")) + + def test_subclasses_of_pattern (self): + self.assert_ (set (["Win32_LogicalDisk", "Win32_MappedLogicalDisk"]) <= set (self.connection.subclasses_of ("CIM_LogicalDevice", "Win32_.*Disk"))) + + def test_instances (self): + self.assertEquals (self.logical_disks, set (self.connection.instances ("Win32_LogicalDisk"))) + + def test_new (self): + "Check this is an alias for the new method of the equivalent class" + self.assertEquals (self.connection.new ("Win32_Process")._instance_of, self.connection.Win32_Process) + + def test_query (self): + self.assertEquals (self.logical_disks, set (self.connection.query ("SELECT * FROM Win32_LogicalDisk"))) + + def test_ipython_attributes_with_find_classes (self): + connection = wmi.WMI (find_classes=True) + self.assertEquals (sorted (connection._getAttributeNames ()), sorted (i for i in connection.classes if not i.startswith ("__"))) + + def test_getattr (self): + "Check that WMI classes are returned by attribute access on their namespace" + connection = wmi.WMI (find_classes=True) + for c in list (connection.classes)[:5]: + wmi_class = getattr (connection, c) + self.assert_ (isinstance (wmi_class, wmi._wmi_class)) + self.assertEquals (wmi_class._class_name, c) + + def test_watch_for (self): + """Check that the watch_for method returns a watcher. The watcher itself + will be tested elsewhere. + """ + watcher = self.connection.watch_for ( + wmi_class="Win32_Process" + ) + self.assert_ (isinstance (watcher, wmi._wmi_watcher)) + +class TestClass (TestWMI): + + def test_class_from_namespace (self): + self.assert_ (self.connection.Win32_ComputerSystem._namespace is self.connection) + + def test_class_without_namespace (self): + wmi_class = wmi.GetObject ("winmgmts:Win32_ComputerSystem") + self.assert_ (wmi._wmi_class (None, wmi_class)._namespace) + + def test_query (self): + self.assertEquals ( + set (self.connection.Win32_ComputerSystem.query ()), + set (self.connection.query ("SELECT * FROM Win32_ComputerSystem")) + ) + + def test_query_with_where (self): + this_drive = os.getcwd ()[:2] + for drive in self.connection.Win32_LogicalDisk (Name=this_drive): + self.assertEquals (drive.Name, this_drive) + + def test_query_with_fields (self): + this_drive = os.getcwd ()[:2] + properties = set (["MediaType"]) + self.assert_ ("Name" not in properties) + for drive in self.connection.Win32_LogicalDisk (properties, Name=this_drive): + self.assertEquals (set (drive.properties), set (properties)) + self.assert_ (drive.MediaType) + self.assertRaises (AttributeError, getattr, drive, "Name") + + def test_watch_for (self): + """Check that the watch_for method returns a watcher. The watcher itself + will be tested elsewhere. + """ + watcher = self.connection.Win32_Process.watch_for () + self.assert_ (isinstance (watcher, wmi._wmi_watcher)) + + def test_instances (self): + self.assertEquals ( + set (self.connection.Win32_LogicalDisk ()), + set (self.connection.Win32_LogicalDisk.instances ()) + ) + + def test_new (self): + process = self.connection.Win32_Process.new () + self.assertEquals (wmi.get_wmi_type (process), "instance") + self.assertEquals (process._instance_of, self.connection.Win32_process) + + +class TestWatcher (TestWMI): + + def new_letter (self): + return \ + set ("%s:" % chr (i) for i in range (ord ('A'), 1 + ord ('Z'))).\ + difference (d.DeviceID for d in self.connection.Win32_LogicalDisk ()).\ + pop () + + @staticmethod + def create (new_letter): + print "about to create drive with letter", new_letter + here = os.path.dirname (os.path.abspath (__file__)) + win32file.DefineDosDevice (0, new_letter, here) + try: + # + # This sleep is needed for the WMI pollster to react + # + time.sleep (2) + finally: + win32file.DefineDosDevice (2, new_letter, here) + + def test_creation (self): + try: + new_letter = self.new_letter () + except KeyError: + warnings.warn ("Unable to find a spare drive letter to map.") + return + + watcher = self.connection.Win32_LogicalDisk.watch_for ( + notification_type="Creation", + DeviceID=new_letter + ) + t = threading.Timer (2, self.create, (new_letter,)) + t.start () + found_disk = watcher (timeout_ms=20000) + self.assert_ (isinstance (found_disk, wmi._wmi_object)) + self.assertEqual (found_disk.Caption, new_letter) + t.join () + + def test_event_with_no_params (self): + try: + new_letter = self.new_letter () + except KeyError: + warnings.warn ("Unable to find a spare drive letter to map.") + return + + watcher = self.connection.Win32_LogicalDisk.watch_for () + t = threading.Timer (2, self.create, (new_letter,)) + t.start () + found_disk = watcher (timeout_ms=20000) + self.assert_ (isinstance (found_disk, wmi._wmi_object)) + self.assertEqual (found_disk.Caption, new_letter) + t.join () + + def test_valid_notification_types (self): + for notification_type in ['operation', 'modification', 'creation', 'deletion']: + self.assert_ (self.connection.Win32_LogicalDisk.watch_for (notification_type=notification_type)) + + def test_invalid_notification_types (self): + self.assertRaises (wmi.x_wmi, self.connection.Win32_LogicalDisk.watch_for, notification_type="***") + + + def do_not_test_extrinsic_event (self): + + # + # This doesn't seem implementable at the moment + # as a test. I can't find a reproducible extrinsic + # event except for Win32_DeviceChangeEvent and that + # one would require someone to, eg, plug in / unplug + # a USB stick. + # + # It looks as though Win32_ProcessStartTrace should work + # and it does on my laptop; just not on my desktop. + # + + def _create (queue): + queue.put (subprocess.Popen ([sys.executable, "-c", "import time; time.sleep (10)"])) + + watcher = self.connection.Win32_ProcessStartTrace.watch_for ( + fields=["*"]##, + #~ ProcessName=os.path.basename (sys.executable) + ) + q = Queue.Queue () + t = threading.Timer (2, _create, (q,)) + try: + t.start () + found_process = watcher (timeout_ms=20000) + spawned_process = q.get_nowait () + self.assert_ (isinstance (found_process, wmi._wmi_event)) + self.assertEqual (int (found_process.ProcessID), spawned_process.pid) + finally: + t.cancel () + +class TestMethods (TestWMI): + + def test_exists (self): + "Check that a well-known method is available by attribute" + self.assert_ (self.connection.Win32_Process.Create) + + def test_params (self): + "Check that the names and arrayness of params are picked up when not arrays" + self.assertEquals ( + [(n, False) for n in ["CommandLine", "CurrentDirectory", "ProcessStartupInformation"]], + self.connection.Win32_Process.Create.in_parameter_names + ) + self.assertEquals ( + [("ProcessId", False), ("ReturnValue", False)], + self.connection.Win32_Process.Create.out_parameter_names + ) + + def test_positional_params (self): + dir = tempfile.mkdtemp () + filename = "abc.txt" + contents = str (datetime.datetime.now ()) + handle, result = self.connection.Win32_Process.Create ( + "cmd /c echo %s > %s" % (contents, filename), + dir, + self.connection.Win32_ProcessStartup.new (ShowWindow=0) + ) + time.sleep (0.5) + self.assertEqual (open (os.path.join (dir, filename)).read (), contents + " \n") + + def test_named_params (self): + dir = tempfile.mkdtemp () + filename = "abc.txt" + contents = str (datetime.datetime.now ()) + handle, result = self.connection.Win32_Process.Create ( + ProcessStartupInformation=self.connection.Win32_ProcessStartup.new (ShowWindow=0), + CurrentDirectory=dir, + CommandLine="cmd /c echo %s > %s" % (contents, filename) + ) + time.sleep (0.5) + self.assertEqual (open (os.path.join (dir, filename)).read (), contents + " \n") + + def test_in_params_with_array (self): + "Check that the names and arrayness of params are picked up when arrays" + self.assertEquals ( + [("DNSServerSearchOrder", True)], + self.connection.Win32_NetworkAdapterConfiguration.SetDNSServerSearchOrder.in_parameter_names + ) + + def test_instance_methods_are_distinct (self): + """Check that the methods of difference instances of a class are distinct. + This caused a problem when calling .Terminate on one process killed another. + """ + methods = [d.Reset for d in self.logical_disks] + for i in range (len (methods)-1): + self.assertNotEqual (methods[i], methods[i+1]) + + def test_call_from_class (self): + "Check that a method can be called from a class" + self.assert_ (self.connection.Win32_Process.Create ( + CommandLine=sys.executable + " -c pass", + ProcessStartupInformation=self.connection.Win32_ProcessStartup.new (ShowWindow=0) + )) + + def test_call_from_instance (self): + "Check that a method can be called from an instance" + handle, _ = self.connection.Win32_Process.Create ( + CommandLine=sys.executable, + ProcessStartupInformation=self.connection.Win32_ProcessStartup.new (ShowWindow=0) + ) + result = 1 + for p in self.connection.Win32_Process (Handle=handle): + result, = p.Terminate () + self.assertEqual (result, 0) + +class TestProperties (TestWMI): + + def test_access (self): + "Check that all properties are available as attributes" + for d in self.logical_disks: + break + for p in d.ole_object.Properties_: + self.assertEqual (p.Value, getattr (d, p.Name)) + + def test_attribute_passthrough (self): + "Check that unknown attributes are passed through to the underlying object" + for d in self.logical_disks: + break + # + # Can't rely on the COM Objects testing identical or equal; + # have to check their values and their emptiness. + # + self.assert_ (d.Properties_) + self.assert_ (d.ole_object.Properties_) + self.assertEqual ( + [p.Value for p in d.Properties_], + [p.Value for p in d.ole_object.Properties_] + ) + + def test_settable (self): + "Check that a writeable property can be written" + name = str (time.time ()).split (".")[0] + old_value = "***" + new_value = "!!!" + username = win32api.GetUserNameEx (win32con.NameSamCompatible) + self.assert_ (not self.connection.Win32_Environment (Name=name, UserName=username)) + self.connection.Win32_Environment.new (Name=name, UserName=username, VariableValue=old_value).put () + for envvar in self.connection.Win32_Environment (Name=name, UserName=username): + self.assertEqual (envvar.VariableValue, old_value) + envvar.VariableValue = new_value + try: + for envvar in self.connection.Win32_Environment (Name=name, UserName=username): + self.assertEqual (envvar.VariableValue, new_value) + finally: + for envvar in self.connection.Win32_Environment (Name=name, UserName=username): + envvar.VariableValue = None + +class TestInstances (TestWMI): + + def test_hashable (self): + "Ensure instances are hashable so can be used in a set/dict" + self.assert_ (dict.fromkeys (self.logical_disks)) + + def test_equalable (self): + "Ensure instances compare equal" + self.assertEqual (self.logical_disks, self.logical_disks) + + def test_sortable (self): + "Ensure instances sort by full path/key" + self.assertEqual ( + sorted (self.logical_disks), + sorted (self.logical_disks, key=operator.attrgetter ("DeviceID")) + ) + + def test_references (self): + "Ensure that associations are special-cased to return wrapped objects" + for d in self.logical_disks: + break + for r in d.references ("Win32_LogicalDiskRootDirectory"): + self.assert_ (r.is_association) + self.assertEqual (r.GroupComponent, d) + self.assert_ (isinstance (r.GroupComponent, wmi._wmi_object)) + self.assert_ (isinstance (r.PartComponent, wmi._wmi_object)) + + def test_associators (self): + "Ensure that associators are returned by association / result" + for d in self.logical_disks: + if d.DeviceID == os.path.abspath (__file__)[:2]: + break + else: + raise RuntimeError ("Unable to find the logical drive corresponding to this file") + root_dir = d.associators (wmi_association_class="Win32_LogicalDiskRootDirectory")[0] + self.assertEqual (root_dir.Name.lower (), d.Name.lower () + "\\".lower ()) + root_dir = d.associators (wmi_result_class="Win32_Directory")[0] + self.assertEqual (root_dir.Name.lower (), d.Name.lower () + "\\") + + def test_derivation (self): + "Check that derivation mimics WMI-provided Derivation_ property" + for d in self.logical_disks: + break + self.assertEqual (d.derivation (), d.ole_object.Derivation_) + + def test_keys (self): + "Check that the readonly keys property returns the keys for an object" + self.assertEqual (self.connection.Win32_LogicalDisk.keys, ['DeviceID']) + self.assertEqual (next (iter (self.logical_disks)).keys, ['DeviceID']) + +class TestInstanceCreation (TestWMI): + + def test_create_instance (self): + self.assert_ (isinstance (self.connection.Win32_ProcessStartup.new (ShowWindow=2), wmi._wmi_object)) + +class TestAssociations (TestWMI): + + def test_all_properties_available (self): + # + # An association can contain not only the associated + # classes but also extra information as well. Ensure + # that both types of data are correctly handled. + # + for q in self.connection.Win32_DiskQuota (): + for p in q.properties: + try: + getattr (q, p) + except wmi.x_wmi: + assert False, "Error getting %s from %s" % (p, q) + else: + assert True + +if __name__ == '__main__': + unittest.main () diff --git a/WPy32-3720/python-3.7.2/Scripts/wmiweb.py b/WPy32-3720/python-3.7.2/Scripts/wmiweb.py new file mode 100644 index 00000000..d23e60ab --- /dev/null +++ b/WPy32-3720/python-3.7.2/Scripts/wmiweb.py @@ -0,0 +1,239 @@ +from cgi import escape +import threading +try: + from urllib import quote +except ImportError: + from urllib.parse import quote +from wsgiref.simple_server import make_server +from wsgiref.util import request_uri, application_uri, shift_path_info + +import wmi + +try: + unicode +except NameError: + unicode = str + +doc = [] + +def link (text, computer, namespace=None, wmi_class=None): + link = '' + escape (text) + '' + +def start_doc (title): + doc[:] = [] + doc.append (""" + + + %(title)s + + + + """ % locals ()) + +def finish_doc (): + doc.append (""" + + + """ % locals ()) + +def doc_table (items, n_cols=3): + n_rows, n_spare_cols = divmod (len (items), n_cols) + doc.append ('') + + for n_row in range (n_rows): + doc.append ("") + for n_col in range (n_cols): + doc.append ("" % items[n_cols * n_col + n_row]) + doc.append ("") + + if n_spare_cols: + doc.append ("") + for n_col in reversed (range (n_spare_cols)): + doc.append ("" % items[len (items) - 1 - n_col]) + doc.append ("") + + doc.append ("
  • %s
  • %s
  • ") + +def doc_breadcrumbs (computer, namespace, wmi_class=None): + doc.append ('') + +def doc_wmi_class (computer, namespace, wmi_class, wmi_connection): + start_doc ("WMI: Class %(wmi_class)s in namespace %(namespace)s on %(computer)s" % locals ()) + doc_breadcrumbs (computer, namespace, wmi_class) + doc.append ("

    %(wmi_class)s

    " % locals ()) + klass = getattr (wmi_connection, wmi_class) + + doc.append ("
    ") + doc.append ("

    Ancestors

    ") + ancestors = klass.derivation () + if ancestors: + doc.append (" : ".join (link (ancestor, computer, namespace, ancestor) for ancestor in reversed (ancestors))) + else: + doc.append ("

    No ancestors

    ") + + doc.append ("
    ") + doc.append ("

    Children

    ") + children = sorted (c.Path_.Class for c in klass._namespace.SubclassesOf (wmi_class)) + if children: + doc.append ('
      ') + for child in children: + doc.append ('
    • %s
    • ' % link (child, computer, namespace, child)) + doc.append ('
    ') + else: + doc.append ('

    No children

    ') + + doc.append ("
    ") + doc.append ("

    Associated classes

    ") + associations = sorted (klass.associated_classes) + if associations: + doc.append ("
      ") + for association in associations: + doc.append ('
    • %s
    • ' % link (association, computer, namespace, association)) + doc.append ("
    ") + else: + doc.append ("

    No associated classes

    ") + + doc.append ("
    ") + doc.append ("

    Properties

    ") + properties = sorted (klass._properties) + n_properties = len (properties) + if n_properties == 0: + doc.append ("

    No properties

    ") + if 1 <= n_properties <= 10: + doc_table (properties, 1) + elif 10 < n_properties <= 20: + doc_table (properties, 2) + elif 20 < n_properties <= 30: + doc_table (properties, 3) + else: + doc_table (properties, 4) + + doc.append ("
    ") + doc.append ("

    Keys

    ") + keys = sorted (klass.keys) + if keys: + doc.append ("
      ") + for key in keys: + doc.append ("
    • %s
    • " % key) + doc.append ("
    ") + else: + doc.append ("

    No keys

    ") + + doc.append ("
    ") + doc.append ("

    Methods

    ") + methods = sorted (klass._methods) + if methods: + doc.append ("
      ") + for m in methods: + doc.append ('
    • %s
      %s
    • ' % (m, escape (str (getattr (klass, m))))) + doc.append ("
    ") + else: + doc.append ("

    No methods

    ") + + doc.append ("
    ") + doc.append ("

    Qualifiers

    ") + qualifiers = sorted (klass.qualifiers.items ()) + if qualifiers: + doc.append ("
      ") + for q in qualifiers: + doc.append ("
    • %s: %s
    • " % q) + doc.append ("
    ") + else: + doc.append ("

    No qualifiers

    ") + + finish_doc () + +def doc_namespace (computer, namespace, wmi_connection): + start_doc ("WMI: Namespace %(namespace)s on %(computer)s" % locals ()) + doc_breadcrumbs (computer, namespace) + + namespaces = namespace.split ("\\") + namespace_links = [] + for i, n in enumerate (namespaces): + namespace_links.append (link (n, computer, "\\".join (namespaces[:i+1]))) + doc.append ("

    %s

    " % "\\".join (namespace_links)) + + doc.append ("
    ") + subnamespaces = sorted (wmi_connection.__NAMESPACE ()) + doc.append ("

    Namespaces:

    ") + if subnamespaces: + doc.append ("
      ") + for subnamespace in subnamespaces: + name = subnamespace.Name + doc.append ('
    • %s
    • ' % link (name, computer, namespace + "\\" + name)) + doc.append ("
    ") + else: + doc.append ("

    No namespaces

    ") + + doc.append ("
    ") + subclasses = sorted (wmi_connection.classes) + doc.append ("

    Classes:

    ") + if subclasses: + doc.append ("
      ") + for subclass in subclasses: + doc.append ('
    • %s
    • ' % link (subclass, computer, namespace, subclass)) + doc.append ("
    ") + else: + doc.append ("

    No classes

    ") + + finish_doc () + +def handle_namespace (environ, computer, namespace): + if not namespace: + wmi_connection = wmi.WMI (computer, namespace="root/cimv2") + for setting in wmi_connection.Win32_WMISetting (): + namespace=setting.ASPScriptDefaultNamespace + break + + wmi_connection = wmi.WMI (computer, namespace=namespace, find_classes=True) + wmi_class = shift_path_info (environ) + if wmi_class: + doc_wmi_class (computer, namespace, wmi_class, wmi_connection) + else: + doc_namespace (computer, namespace, wmi_connection) + +def handle_computer (environ, computer): + handle_namespace (environ, computer, shift_path_info (environ)) + +def app (environ, start_response): + computer = shift_path_info (environ) + if computer == "favicon.ico": + start_response ("404 Not Found", [("Content-Type", "text/plain")]) + return [] + elif computer: + start_response ("200 OK", [("Content-Type", "text/html; charset=utf-8")]) + handle_computer (environ, computer) + return (unicode (d).encode ("utf8") + unicode ("\n").encode ("utf8") for d in doc) + else: + start_response ("301 Moved Permanently", [("Location", "/localhost"), ("Content-Type", "text/plain")]) + return ["Redirected to /localhost"] + +PORT = 8010 + +def run_browser (): + import os + os.startfile ("http://localhost:%d" % PORT) + +if __name__ == '__main__': + threading.Timer (3.0, run_browser).start () + httpd = make_server ('', PORT, app) + try: + httpd.serve_forever () + except KeyboardInterrupt: + print ("Shutting down gracefully...") diff --git a/WPy32-3720/python-3.7.2/readme.txt b/WPy32-3720/python-3.7.2/readme.txt new file mode 100644 index 00000000..fd8be650 --- /dev/null +++ b/WPy32-3720/python-3.7.2/readme.txt @@ -0,0 +1,99 @@ +***************** +Python WMI Module +***************** + +What is it? +=========== + +Windows Management Instrumentation (WMI) is Microsoft's implementation of +Web-Based Enterprise Management (WBEM), an industry initiative to provide +a Common Information Model (CIM) for pretty much any information about a +computer system. + +The Python WMI module is a lightweight wrapper on top of the pywin32 +extensions, and hides some of the messy plumbing needed to get Python to +talk to the WMI API. It's pure Python and should work with any version of +Python from 2.1 onwards (list comprehensions) and any recent version of +pywin32. + + +Where do I get it? +================== + +http://timgolden.me.uk/python/wmi/index.html + + +Copyright & License? +==================== + +(c) Tim Golden 5th June 2003 +Licensed under the (GPL-compatible) MIT License: +http://www.opensource.org/licenses/mit-license.php + + +How do I install it? +==================== + +When all's said and done, it's just a module. But for those +who like setup programs:: + + python setup.py install + +It's also pip/easy_install-able + + +How do I use it? +================ + +There's a tutorial here: http://timgolden.me.uk/python/wmi/tutorial.html, +and some examples at: http://timgolden.me.uk/python/wmi/cookbook.html +but as a quick taster, try this, to show all stopped services:: + + import wmi + + c = wmi.WMI () + for s in c.Win32_Service (): + if s.State == 'Stopped': + print s.Caption, s.State + + +Prerequisites +============= + +If you're running a recent Python (2.1+) on a recent Windows (2k, 2k3, XP) +and you have Mark Hammond's win32 extensions installed, you're probably +up-and-running already. Otherwise... + +Windows +------- +If you're running Win9x / NT4 you'll need to get WMI support +from Microsoft. Microsoft URLs change quite often, so I suggest you +do this: http://www.google.com/search?q=wmi+downloads + +Python +------ +http://www.python.org/ (just in case you didn't know) + +pywin32 (was win32all) +---------------------- +http://starship.python.net/crew/mhammond/win32/Downloads.html +Specifically, builds 154/155 fixed a problem which affected the WMI +moniker construction. You can still work without this fix, but some +more complex monikers will fail. + +makepy +------ +(NB my own experience over several systems is that this +step isn't necessary. However, if you have problems...) +You may have to compile makepy support for some typelibs. The following +are reported to be significant: + +Microsoft WMI Scripting Library +WMI ADSI Extension Type Library +WMICntl Type Library + +If you've not done this before, start the PythonWin environment, select +Tools > Com Makepy utility from the menu, select the library by name, and +click [OK]. + +