
__version__ = '$Id$'

from pywikibot import family

# The wikidata family


class Family(family.WikimediaFamily):
    def __init__(self):
        super(Family, self).__init__()
        self.name = 'wikidata'
        self.langs = {
            'wikidata': 'www.wikidata.org',
            'repo': 'wikidata-test-repo.wikimedia.de',
            'client': 'wikidata-test-client.wikimedia.de',
            'test': 'test.wikidata.org',
        }

    def scriptpath(self, code):
        if code == 'client':
            return ''
        return super(Family, self).scriptpath(code)

    def shared_data_repository(self, code, transcluded=False):
        """Always return a repository tupe. This enables testing whether
        the site opject is the repository itself, see Site.is_data_repository()

        """
        if transcluded:
            return (None, None)
        else:
            if code == 'wikidata':
                return ('wikidata', 'wikidata')
            elif code == 'test':
                return ('test', 'wikidata')
            else:
                return ('repo', 'wikidata')

    def globes(self, code):
        """Supported globes for Coordinate datatype"""
        return {'earth': 'http://www.wikidata.org/entity/Q2'}


__version__ = '$Id$'

from pywikibot import family

# The wikidata family


class Family(family.WikimediaFamily):
    def __init__(self):
        super(Family, self).__init__()
        self.name = 'wikidata'
        self.langs = {
            'wikidata': 'www.wikidata.org',
            'repo': 'wikidata-test-repo.wikimedia.de',
            'client': 'wikidata-test-client.wikimedia.de',
            'test': 'test.wikidata.org',
        }

    def scriptpath(self, code):
        if code == 'client':
            return ''
        return super(Family, self).scriptpath(code)

    def shared_data_repository(self, code, transcluded=False):
        """Always return a repository tupe. This enables testing whether
        the site opject is the repository itself, see Site.is_data_repository()

        """
        if transcluded:
            return (None, None)
        else:
            if code == 'wikidata':
                return ('wikidata', 'wikidata')
            elif code == 'test':
                return ('test', 'wikidata')
            else:
                return ('repo', 'wikidata')

    def globes(self, code):
        """Supported globes for Coordinate datatype"""
        return {'earth': 'http://www.wikidata.org/entity/Q2',
                'moon': 'http://www.wikidata.org/entity/Q405'}

Add moon (Q405) to the list of globes
Add moon (Q405) to the list of globes

Change-Id: I2dd9f87fcb1d748bff94328575f8439dc36035e3

  
  __version__ = '$Id$'
  
  from pywikibot import family
  
  # The wikidata family
  
  
  class Family(family.WikimediaFamily):
      def __init__(self):
          super(Family, self).__init__()
          self.name = 'wikidata'
          self.langs = {
              'wikidata': 'www.wikidata.org',
              'repo': 'wikidata-test-repo.wikimedia.de',
              'client': 'wikidata-test-client.wikimedia.de',
              'test': 'test.wikidata.org',
          }
  
      def scriptpath(self, code):
          if code == 'client':
              return ''
          return super(Family, self).scriptpath(code)
  
      def shared_data_repository(self, code, transcluded=False):
          """Always return a repository tupe. This enables testing whether
          the site opject is the repository itself, see Site.is_data_repository()
  
          """
          if transcluded:
              return (None, None)
          else:
              if code == 'wikidata':
                  return ('wikidata', 'wikidata')
              elif code == 'test':
                  return ('test', 'wikidata')
              else:
                  return ('repo', 'wikidata')
  
      def globes(self, code):
          """Supported globes for Coordinate datatype"""
-         return {'earth': 'http://www.wikidata.org/entity/Q2'}
+         return {'earth': 'http://www.wikidata.org/entity/Q2',
+                 'moon': 'http://www.wikidata.org/entity/Q405'}
  
Add moon (Q405) to the list of globes
## Code Before:

__version__ = '$Id$'

from pywikibot import family

# The wikidata family


class Family(family.WikimediaFamily):
    def __init__(self):
        super(Family, self).__init__()
        self.name = 'wikidata'
        self.langs = {
            'wikidata': 'www.wikidata.org',
            'repo': 'wikidata-test-repo.wikimedia.de',
            'client': 'wikidata-test-client.wikimedia.de',
            'test': 'test.wikidata.org',
        }

    def scriptpath(self, code):
        if code == 'client':
            return ''
        return super(Family, self).scriptpath(code)

    def shared_data_repository(self, code, transcluded=False):
        """Always return a repository tupe. This enables testing whether
        the site opject is the repository itself, see Site.is_data_repository()

        """
        if transcluded:
            return (None, None)
        else:
            if code == 'wikidata':
                return ('wikidata', 'wikidata')
            elif code == 'test':
                return ('test', 'wikidata')
            else:
                return ('repo', 'wikidata')

    def globes(self, code):
        """Supported globes for Coordinate datatype"""
        return {'earth': 'http://www.wikidata.org/entity/Q2'}

## Instruction:
Add moon (Q405) to the list of globes
## Code After:

__version__ = '$Id$'

from pywikibot import family

# The wikidata family


class Family(family.WikimediaFamily):
    def __init__(self):
        super(Family, self).__init__()
        self.name = 'wikidata'
        self.langs = {
            'wikidata': 'www.wikidata.org',
            'repo': 'wikidata-test-repo.wikimedia.de',
            'client': 'wikidata-test-client.wikimedia.de',
            'test': 'test.wikidata.org',
        }

    def scriptpath(self, code):
        if code == 'client':
            return ''
        return super(Family, self).scriptpath(code)

    def shared_data_repository(self, code, transcluded=False):
        """Always return a repository tupe. This enables testing whether
        the site opject is the repository itself, see Site.is_data_repository()

        """
        if transcluded:
            return (None, None)
        else:
            if code == 'wikidata':
                return ('wikidata', 'wikidata')
            elif code == 'test':
                return ('test', 'wikidata')
            else:
                return ('repo', 'wikidata')

    def globes(self, code):
        """Supported globes for Coordinate datatype"""
        return {'earth': 'http://www.wikidata.org/entity/Q2',
                'moon': 'http://www.wikidata.org/entity/Q405'}
