Python library for handling UNC mounting on Windows. -
To install:
$ pip install win_unc
Full documentation is available at covenanteyes.github.com/py_win_unc.
Below is a simple example:
from win_unc import UncDirectoryMount, UncDirectory, DiskDrive conn = UncDirectoryMount(UncDirectory(r'\\home\shared'), DiskDrive('Z:')) conn.mount() print 'Drive connected:', conn.is_mounted() conn.unmount()
You can also provide credentials like this:
from win_unc import UncCredentials unc = UncDirectory(r'\\home\shared', UncCredentials('user', 'pwd')) conn = UncDirectoryMount(unc, DiskDrive('Z:'))
Or just connect the path without mounting it:
from win_unc import UncDirectoryConnection conn = UncDirectoryConnection(r'\\home\shared') conn.connect()
To run the unit tests, do the following:
$ python test/run_tests.py
For all the tests to run, you must perform them on a Windows machine:
> python test\run_tests.py
This package is released under the MIT License. (See LICENSE.txt.)