 for the Universal App
  Platform features in Thresold.  These types are imported into the Foundation
  schema and included in products that support UAP.

  !!!WARNING!!!

  Don't make any changes to this schema.  Changes will affect a wide range of
  partners and can potentially break product and test code, as well as existing
  .appx packages and manifests.  Please contact 'manifest' alias if you need to
  request any addition or modification.

@@END_SDKSPLIT -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://schemas.microsoft.com/appx/manifest/uap/thresholdpreview"
           xmlns="http://schemas.microsoft.com/appx/manifest/uap/thresholdpreview"
           xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/thresholdpreview"
           xmlns:t="http://schemas.microsoft.com/appx/manifest/types"
           xmlns:m="http://schemas.microsoft.com/appx/2010/manifest"
           >

  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/types"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/2010/manifest"/>

  <xs:element name="SupportedUsers" type="t:ST_SupportedUsers"/>

  <xs:element name="Extension" substitutionGroup="m:ApplicationExtensionChoice">
    <xs:complexType>
      <xs:choice minOccurs="0">
        <xs:element name="WebAccountProvider" type="CT_WebAccountProvider"/>
        <xs:element name="DialProtocol" type="CT_DialProtocol"/>
        <xs:element name="AppService" type="CT_AppService"/>
      </xs:choice>
      <xs:attribute name="Category" type="t:ST_ApplicationExtensionCategory_Uap" use="required"/>
      <xs:attributeGroup ref="m:ExtensionBaseAttributes"/>
    </xs:complexType>
  </xs:element>
  
  <xs:complexType name="CT_WebAccountProvider">
    <xs:sequence>
      <xs:element name="ManagedUrls" type="CT_ManagedUrls" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="Url" type="t:ST_WebAccountProviderUrl" use="required"/>
    <xs:attribute name="BackgroundEntryPoint" type="t:ST_EntryPoint" use="required"/>
  </xs:complexType>

  <xs:complexType name="CT_ManagedUrls">
    <xs:sequence>
      <xs:element name="Url" type="t:ST_WebAccountProviderUrl"  minOccurs="1" maxOccurs="200"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="CT_DialProtocol">
    <xs:attribute name="Name" type="t:ST_DialProtocol" use="required"/>
  </xs:complexType>
  
  <xs:complexType name="CT_AppService">
    <xs:attribute name="Name" type="t:ST_AppServiceName" use="required"/>
  </xs:complexType>

  <xs:simpleType name="ST_BackgroundTasks_2015_Uap">
    <xs:restriction base="xs:string">
      <xs:enumeration value="vpnClient"/>
      <xs:enumeration value="phoneCall"/>
      <xs:enumeration value="mediaProcessing"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="Task" substitutionGroup="m:TaskChoice">
    <xs:complexType>
      <xs:attribute name="Type" type="ST_BackgroundTasks_2015_Uap" use="required"/>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="ST_Capability_2015_Uap">
    <xs:restriction base="xs:string">
      <xs:enumeration value="phoneCall"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="Capability" substitutionGroup="m:CapabilityChoice">
    <xs:complexType>
      <xs:attribute name="Name" type="ST_Capability_2015_Uap" use="required"/>
    </xs:complexType>
  </xs:element>

</xs:schema>
﻿<?xml version="1.0" encoding="utf-8"?>
<!-- @@BEGIN_SDKSPLIT

  THRESHOLD UAP MANIFEST SCHEMA

  This is the Schema that defines elements and attributes for the Universal App
  Platform features in Thresold.  These types are imported into the Foundation
  schema and included in products that support UAP.

  !!!WARNING!!!

  Don't make any changes to this schema.  Changes will affect a wide range of
  partners and can potentially break product and test code, as well as existing
  .appx packages and manifests.  Please contact 'manifest' alias if you need to
  request any addition or modification.

@@END_SDKSPLIT -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://schemas.microsoft.com/appx/manifest/uap/windows10"
           xmlns="http://schemas.microsoft.com/appx/manifest/uap/windows10"
           xmlns:t="http://schemas.microsoft.com/appx/manifest/types"
           xmlns:f="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
           xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
           xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
           xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
           xmlns:uap8="http://schemas.microsoft.com/appx/manifest/uap/windows10/8"
           xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10"
           xmlns:rescap3="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/3"
           xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2"
           xmlns:desktop3="http://schemas.microsoft.com/appx/manifest/desktop/windows10/3"
           xmlns:desktop5="http://schemas.microsoft.com/appx/manifest/desktop/windows10/5"
           xmlns:previewappcompat="http://schemas.microsoft.com/appx/manifest/preview/windows10/msixappcompatsupport"
           >

  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/types"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/foundation/windows10"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/uap/windows10/8"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/uap/windows10/10"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/3"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/desktop/windows10/3"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/desktop/windows10/5"/>
  <xs:import namespace="http://schemas.microsoft.com/appx/manifest/preview/windows10/msixappcompatsupport"/>

  <xs:attribute name="Scale" type="t:ST_Scale_All"/>
  <xs:attribute name="DXFeatureLevel" type="t:ST_DXFeatureLevel"/>

  <xs:element name="SupportedUsers" type="t:ST_SupportedUsers"/>

  <xs:element name="Capability" substitutionGroup="f:CapabilityChoice">
    <xs:complexType>
      <xs:attribute name="Name" type="t:ST_Capability_Uap" use="required"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="VisualElements" type="CT_VisualElements" substitutionGroup="f:VisualElementsChoice">
    <xs:unique name="InitialRotationPreference_Name">
      <xs:selector xpath="uap:InitialRotationPreference/uap:Rotation"/>
      <xs:field xpath="@Preference"/>
    </xs:unique>
  </xs:element>

  <xs:complexType name="CT_VisualElements">
    <xs:all>
      <xs:element name="DefaultTile" type="CT_DefaultTile" minOccurs="0"/>
      <xs:element name="LockScreen" type="t:CT_LockScreen" minOccurs="0"/>
      <xs:element name="SplashScreen" type="CT_SplashScreen" minOccurs="0"/>
      <xs:element name="InitialRotationPreference" type="CT_InitialRotationPreference" minOccurs="0"/>
    </xs:all>
    <xs:attribute name="DisplayName" type="t:ST_DisplayName" use="required"/>
    <xs:attribute name="Description" type="t:ST_Description" use="required"/>
    <xs:attribute name="BackgroundColor" type="t:ST_Color" use="required"/>
    <xs:attribute name="Square150x150Logo" type="t:ST_ImageFile" use="required"/>
    <xs:attribute name="Square44x44Logo" type="t:ST_ImageFile" use="required"/>
    <xs:attribute name="AppListEntry" type="t:ST_AppListEntry" use="optional"/>
  </xs:complexType>

  <xs:complexType name="CT_DefaultTile">
    <xs:all>
      <xs:element name="TileUpdate" type="t:CT_TileUpdate" minOccurs="0"/>
      <xs:element name="ShowNameOnTiles" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ShowOn" maxOccurs="4">
              <xs:complexType>
                <xs:attribute name="Tile" type="t:ST_ShowNameSize" use="required"/>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
        <xs:unique name="ShowOn_Tile">
          <xs:selector xpath="uap:ShowOn"/>
          <xs:field xpath="@Tile"/>
        </xs:unique>
      </xs:element>
      <xs:element ref="HoloContentChoice" minOccurs="0"/>
      <xs:element ref="uap5:MixedRealityModel" minOccurs="0"/>
    </xs:all>
    <xs:attribute name="Wide310x150Logo" type="t:ST_ImageFile" use="optional"/>
    <xs:attribute name="Square310x310Logo" type="t:ST_ImageFile" use="optional"/>
    <xs:attribute name="Square71x71Logo" type="t:ST_ImageFile" use="optional"/>
    <xs:attribute name="ShortName" type="t:ST_ShortDisplayName" use="optional"/>
  </xs:complexType>

  <xs:complexType name="CT_SplashScreen">
    <xs:complexContent>
      <xs:extension base="t:CT_SplashScreen">
        <xs:attributeGroup ref="uap5:SplashScreenAttributes"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="HoloContentChoice" abstract="true"/>

  <xs:complexType name="CT_InitialRotationPreference">
    <xs:sequence>
      <xs:element name="Rotation" maxOccurs="4" type="t:CT_Rotation"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="ApplicationContentUriRules">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Rule" maxOccurs="100">
          <xs:complexType>
            <xs:attribute name="Type" type="t:ST_RuleType" use="required"/>
            <xs:attribute name="Match" type="t:ST_URI" use="required"/>
            <xs:attribute name="WindowsRuntimeAccess" type="t:ST_ApplicationContentUriRunTimeAccess_Uap" use="optional"/>
            <xs:attributeGroup ref="uap5:ContentUriRuleAttributes"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="Extension" substitutionGroup="f:ApplicationExtensionChoice">
    <xs:complexType>
      <xs:choice minOccurs="0">
        <xs:element ref="FileTypeAssociationChoice"/>
        <xs:element ref="ProtocolChoice"/>
        <xs:element ref="AppServiceChoice"/>
        <xs:element name="AutoPlayContent" type="CT_AutoPlayContent"/>
        <xs:element name="AutoPlayDevice" type="CT_AutoPlayDevice"/>
        <xs:element name="ShareTarget" type="CT_ShareTarget"/>
        <xs:element name="FileOpenPicker" type="CT_FilePicker"/>
        <xs:element name="FileSavePicker" type="CT_FilePicker"/>
        <xs:element name="AppointmentsProvider" type="CT_AppointmentsProvider"/>
        <xs:element name="WebAccountProvider" type="CT_WebAccountProvider"/>
        <xs:element name="DialProtocol" type="CT_DialProtocol"/>
        <xs:element name="MediaPlayback" type="CT_MediaPlayback"/>
        <xs:element name="VoipCall" type="CT_VoipCall"/>
      </xs:choice>
      <xs:attribute name="Category" type="t:ST_ApplicationExtensionCategory_Uap" use="required"/>
      <xs:attributeGroup ref="t:ExtensionBaseAttributes"/>
      <xs:attributeGroup ref="uap10:TrustLevelGroup"/>
    </xs:complexType>
    <xs:unique name="AppointmentsProvider_Verb">
      <xs:selector xpath="uap:AppointmentsProvider/uap:AppointmentsProviderLaunchActions/uap:LaunchAction"/>
      <xs:field xpath="@Verb"/>
    </xs:unique>
  </xs:element>

  <xs:element name="FileTypeAssociationChoice" abstract="true"/>
  <xs:element name="FileTypeAssociation" substitutionGroup="FileTypeAssociationChoice" type="CT_FileTypeAssociation"/>

  <xs:element name="ProtocolChoice" abstract="true"/>
  <xs:element name="Protocol" substitutionGroup="ProtocolChoice" type="CT_Protocol"/>

  <xs:element name="AppServiceChoice" abstract="true"/>
  <xs:element name="AppService" substitutionGroup="AppServiceChoice" type="CT_AppService"/>
  
  <xs:complexType name="CT_FileTypeAssociation">
    <xs:all>
      <xs:element name="DisplayName" type="t:ST_DisplayName" minOccurs="0"/>
      <xs:element name="Logo" type="t:ST_ImageFile" minOccurs="0"/>
      <xs:element name="InfoTip" type="t:ST_FTAInfoTip" minOccurs="0"/>
      <xs:element name="EditFlags" minOccurs="0">
        <xs:complexType>
          <xs:attribute name="OpenIsSafe" type="xs:boolean" use="optional"/>
          <xs:attribute name="AlwaysUnsafe" type="xs:boolean" use="optional"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="SupportedFileTypes" type="CT_FTASupportedFileTypes"/>
      <xs:element ref="FileTypeAssociationSupportedVerbsChoice" minOccurs="0"/>
      <xs:element ref="uap4:KindMap" minOccurs="0"/>
      <xs:element """
This code wraps the vendored appdirs module to so the return values are
compatible for the current pip code base.

The intention is to rewrite current usages gradually, keeping the tests pass,
and eventually drop this after all usages are changed.
"""

from __future__ import absolute_import

import os

from pip._vendor import appdirs as _appdirs

from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from typing import List


def user_cache_dir(appname):
    # type: (str) -> str
    return _appdirs.user_cache_dir(appname, appauthor=False)


def user_config_dir(appname, roaming=True):
    # type: (str, bool) -> str
    path = _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming)
    if _appdirs.system == "darwin" and not os.path.isdir(path):
        path = os.path.expanduser('~/.config/')
        if appname:
            path = os.path.join(path, appname)
    return path


# for the discussion regarding site_config_dir locations
# see <https://github.com/pypa/pip/issues/1733>
def site_config_dirs(appname):
    # type: (str) -> List[str]
    dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True)
    if _appdirs.system not in ["win32", "darwin"]:
        # always look in /etc directly as well
        return dirval.split(os.pathsep) + ['/etc']
    return [dirval]
