import pywikibot

myLang = "en"
family = "liquipedia"
from pywikibot import family
from pywikibot.tools import deprecated


class Family(family.Family):
    def __init__(self):
        family.Family.__init__(self)
        self.name = 'liquipedia'
        self.langs = {
            'commons': 'liquipedia.net',
            'counterstrike': 'liquipedia.net',
            'dota2': 'liquipedia.net',
            'hearthstone': 'liquipedia.net',
            'heroes': 'liquipedia.net',
            'overwatch': 'liquipedia.net',
            'smash': 'liquipedia.net',
            'staff': 'liquipedia.net',
            'starcraft': 'liquipedia.net',
            'starcraft2': 'liquipedia.net',
            'warcraft': 'liquipedia.net',
            'fighters': 'liquipedia.net',
            'rocketleague': 'liquipedia.net',
            'clashroyale': 'liquipedia.net',
            'crossfire': 'liquipedia.net',
            'trackmania': 'liquipedia.net',
            'battlerite': 'liquipedia.net',
            'diabotical': 'liquipedia.net',
            'teamfortress': 'liquipedia.net',
            'leagueoflegends': 'liquipedia.net',
            'worldofwarcraft': 'liquipedia.net',
            'fifa': 'liquipedia.net',
            'pokemon': 'liquipedia.net',
            'projectx': 'liquipedia.net',
            'quake': 'liquipedia.net',
            'rainbowsix': 'liquipedia.net',
            'pubg': 'liquipedia.net',
            'artifact': 'liquipedia.net',
            'paladins': 'liquipedia.net',
            'battalion': 'liquipedia.net',
            'fortnite': 'liquipedia.net',
            'arenaofvalor': 'liquipedia.net',
            'focommons': 'wiki.liquipedia.space',
            'fodota2': 'wiki.liquipedia.space',
            'fooverwatch': 'wiki.liquipedia.space',
            'fostarcraft': 'wiki.liquipedia.space',
            'fostarcraft2': 'wiki.liquipedia.space',
            'fowarcraft': 'wiki.liquipedia.space',
            'fts': 'fonttax.wiki.tldev.eu',
        }

    def scriptpath(self, code):
        return {
            'commons': '/commons',
            'counterstrike': '/counterstrike',
            'dota2': '/dota2',
            'hearthstone': '/hearthstone',
            'heroes': '/heroes',
            'overwatch': '/overwatch',
            'smash': '/smash',
            'staff': '/staff',
            'starcraft': '/starcraft',
            'starcraft2': '/starcraft2',
            'warcraft': '/warcraft',
            'fighters': '/fighters',
            'rocketleague': '/rocketleague',
            'clashroyale': '/clashroyale',
            'crossfire': '/crossfire',
            'trackmania': '/trackmania',
            'battlerite': '/battlerite',
            'diabotical': '/diabotical',
            'teamfortress': '/teamfortress',
            'leagueoflegends': '/leagueoflegends',
            'worldofwarcraft': '/worldofwarcraft',
            'fifa': '/fifa',
            'pokemon': '/pokemon',
            'projectx': '/projectx',
            'quake': '/quake',
            'rainbowsix': '/rainbowsix',
            'pubg': '/pubg',
            'artifact': '/artifact',
            'paladins': '/paladins',
            'battalion': '/battalion',
            'fortnite': '/fortnite',
            'arenaofvalor': '/arenaofvalor',
            'focommons': '/commons',
            'fodota2': '/dota2',
            'fooverwatch': '/overwatch',
            'fostarcraft': '/starcraft',
            'fostarcraft2': '/starcraft2',
            'fowarcraft': '/warcraft',
            'fts': '/teamfortress',
        }[code]

    @deprecated('APISite.version()')
    def version(self, code):
        return {
            'commons': u'1.28.3',
            'counterstrike': u'1.28.3',
            'dota2': u'1.28.3',
            'hearthstone': u'1.28.3',
            'heroes': u'1.28.3',
            'overwatch': u'1.28.3',
            'smash': u'1.28.3',
            'staff': u'1.28.3',
            'starcraft': u'1.28.3',
            'starcraft2': u'1.28.3',
            'warcraft': u'1.28.3',
            'fighters': u'1.28.3',
            'rocketleague': u'1.28.3',
            'clashroyale': u'1.28.3',
            'crossfire': u'1.28.3',
            'trackmania': u'1.28.3',
            'battlerite': u'1.28.3',
            'diabotical': u'1.28.3',
            'teamfortress': u'1.28.3',
            'leagueoflegends': u'1.28.3',
            'worldofwarcraft': u'1.28.3',
            'fifa': u'1.28.3',
            'pokemon': u'1.28.3',
            'projectx': u'1.28.3',
            'quake': u'1.28.3',
            'rainbowsix': u'1.28.3',
            'pubg': u'1.28.3',
            'artifact': '1.28.3',
            'paladins': '1.28.3',
            'battalion': '1.28.3',
            'fortnite': '1.28.3',
            'arenaofvalor': '1.28.3',
            'focommons': u'1.28.3',
            'fodota2': u'1.28.3',
            'fooverwatch': u'1.28.3',
            'fostarcraft': u'1.28.3',
            'fostarcraft2': u'1.28.3',
            'fowarcraft': u'1.28.3',
            'fts': u'1.28.3',
        }[code]

    def protocol(self, code):
        return {
            'commons': u'https',
            'counterstrike': u'https',
            'dota2': u'https',
            'hearthstone': u'https',
            'heroes': u'https',
            'overwatch': u'https',
            'smash': u'https',
            'staff': u'https',
            'starcraft': u'https',
            'starcraft2': u'https',
            'warcraft': u'https',
            'fighters': u'https',
            'rocketleague': u'https',
            'clashroyale': u'https',
            'crossfire': u'https',
            'trackmania': u'https',
            'battlerite': u'https',
            'diabotical': u'https',
            'teamfortress': u'https',
            'leagueoflegends': u'https',
            'worldofwarcraft': u'https',
            'fifa': u'https',
            'pokemon': u'https',
            'projectx': u'https',
            'quake': u'https',
            'rainbowsix': u'https',
            'pubg': u'https',
            'artifact': 'https',
            'paladins': 'https',
            'battalion': 'https',
            'fortnite': 'https',
            'arenaofvalor': 'https',
            'focommons': u'https',
            'fodota2': u'https',
            'fooverwatch': u'https',
            'fostarcraft': u'https',
            'fostarcraft2': u'https',
            'fowarcraft': u'https',
            'fts': u'http',
        }[code]

    def isPublic(self):
        return False
    
site = pywikibot.Site('test', 'starcraft2')
---------------------------------------------------------------------------
UnknownFamily                             Traceback (most recent call last)
<ipython-input-19-d78f3753640d> in <module>()
    182         return False
    183 
--> 184 site = pywikibot.Site('test', 'starcraft2')

/srv/paws/pwb/pywikibot/__init__.py in Site(code, fam, user, sysop, interface, url)
   1242 
   1243         if not isinstance(fam, Family):
-> 1244             fam = Family.load(fam)
   1245 
   1246     interface = interface or fam.interface(code)

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1738                              cls, depth)
   1739                     del __kw[old_arg]
-> 1740             return obj(*__args, **__kw)
   1741 
   1742         if not __debug__:

/srv/paws/pwb/pywikibot/family.py in load(fam)
    987                 return Family._families[fam]
    988         else:
--> 989             raise UnknownFamily('Family %s does not exist' % fam)
    990 
    991         try:

UnknownFamily: Family starcraft2 does not exist
 
---------------------------------------------------------------------------
UnknownFamily                             Traceback (most recent call last)
<ipython-input-18-44b315cdc119> in <module>()
----> 1 site = pywikibot.Site('test', 'starcraft2')

/srv/paws/pwb/pywikibot/__init__.py in Site(code, fam, user, sysop, interface, url)
   1242 
   1243         if not isinstance(fam, Family):
-> 1244             fam = Family.load(fam)
   1245 
   1246     interface = interface or fam.interface(code)

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1738                              cls, depth)
   1739                     del __kw[old_arg]
-> 1740             return obj(*__args, **__kw)
   1741 
   1742         if not __debug__:

/srv/paws/pwb/pywikibot/family.py in load(fam)
    987                 return Family._families[fam]
    988         else:
--> 989             raise UnknownFamily('Family %s does not exist' % fam)
    990 
    991         try:

UnknownFamily: Family starcraft2 does not exist