add jaraco to test sym links on Windows. Fixes #894

This commit is contained in:
clinton-hall 2015-12-19 11:29:22 +10:30
commit 52cc753881
50 changed files with 3862 additions and 7 deletions

View file

@ -0,0 +1,28 @@
"""
API hooks for network stuff.
"""
__all__ = ('AddConnection')
from jaraco.windows.error import WindowsError
from .api import net
def AddConnection(remote_name, type=net.RESOURCETYPE_ANY, local_name=None,
provider_name=None, user=None, password=None, flags=0):
resource = net.NETRESOURCE(
type=type,
remote_name=remote_name,
local_name=local_name,
provider_name=provider_name,
# WNetAddConnection2 ignores the other members of NETRESOURCE
)
result = net.WNetAddConnection2(
resource,
password,
user,
flags,
)
if result != 0:
raise WindowsError(result)