# Path: pokedex/db/tables.py
# class TableSuperclass(object):
# class TableMetaclass(DeclarativeMeta):
# class Language(TableBase):
# class Ability(TableBase):
# class AbilityChangelog(TableBase):
# class AbilityFlavorText(TableBase):
# class Berry(TableBase):
# class BerryFirmness(TableBase):
# class BerryFlavor(TableBase):
# class Characteristic(TableBase):
# class ConquestEpisode(TableBase):
# class ConquestEpisodeWarrior(TableBase):
# class ConquestKingdom(TableBase):
# class ConquestMaxLink(TableBase):
# class ConquestMoveData(TableBase):
# class ConquestMoveDisplacement(TableBase):
# class ConquestMoveEffect(TableBase):
# class ConquestMoveRange(TableBase):
# class ConquestPokemonAbility(TableBase):
# class ConquestPokemonEvolution(TableBase):
# class ConquestPokemonMove(TableBase):
# class ConquestPokemonStat(TableBase):
# class ConquestStat(TableBase):
# class ConquestTransformationPokemon(TableBase):
# class ConquestTransformationWarrior(TableBase):
# class ConquestWarrior(TableBase):
# class ConquestWarriorArchetype(TableBase):
# class ConquestWarriorRank(TableBase):
# class ConquestWarriorRankStatMap(TableBase):
# class ConquestWarriorSkill(TableBase):
# class ConquestWarriorSpecialty(TableBase):
# class ConquestWarriorStat(TableBase):
# class ConquestWarriorTransformation(TableBase):
# class ContestCombo(TableBase):
# class ContestEffect(TableBase):
# class ContestType(TableBase):
# class EggGroup(TableBase):
# class Encounter(TableBase):
# class EncounterCondition(TableBase):
# class EncounterConditionValue(TableBase):
# class EncounterConditionValueMap(TableBase):
# class EncounterMethod(TableBase):
# class EncounterSlot(TableBase):
# class EvolutionChain(TableBase):
# class EvolutionTrigger(TableBase):
# class Experience(TableBase):
# class Gender(TableBase):
# class Generation(TableBase):
# class GrowthRate(TableBase):
# class Item(TableBase):
# class ItemCategory(TableBase):
# class ItemFlag(TableBase):
# class ItemFlagMap(TableBase):
# class ItemFlavorText(TableBase):
# class ItemFlingEffect(TableBase):
# class ItemGameIndex(TableBase):
# class ItemPocket(TableBase):
# class Location(TableBase):
# class LocationArea(TableBase):
# class LocationAreaEncounterRate(TableBase):
# class LocationGameIndex(TableBase):
# class Machine(TableBase):
# class Move(TableBase):
# class MoveBattleStyle(TableBase):
# class MoveChangelog(TableBase):
# class MoveDamageClass(TableBase):
# class MoveEffect(TableBase):
# class MoveEffectChangelog(TableBase):
# class MoveFlag(TableBase):
# class MoveFlagMap(TableBase):
# class MoveFlavorText(TableBase):
# class MoveMeta(TableBase):
# class MoveMetaAilment(TableBase):
# class MoveMetaCategory(TableBase):
# class MoveMetaStatChange(TableBase):
# class MoveTarget(TableBase):
# class Nature(TableBase):
# class NatureBattleStylePreference(TableBase):
# class NaturePokeathlonStat(TableBase):
# class PalPark(TableBase):
# class PalParkArea(TableBase):
# class PokeathlonStat(TableBase):
# class Pokedex(TableBase):
# class PokedexVersionGroup(TableBase):
# class Pokemon(TableBase):
# class PokemonAbility(TableBase):
# class PokemonColor(TableBase):
# class PokemonDexNumber(TableBase):
# class PokemonEggGroup(TableBase):
# class PokemonEvolution(TableBase):
# class PokemonForm(TableBase):
# class PokemonFormGeneration(TableBase):
# class PokemonFormPokeathlonStat(TableBase):
# class PokemonGameIndex(TableBase):
# class PokemonHabitat(TableBase):
# class PokemonItem(TableBase):
# class PokemonMove(TableBase):
# class PokemonMoveMethod(TableBase):
# class PokemonShape(TableBase):
# class PokemonSpecies(TableBase):
# class PokemonSpeciesFlavorText(TableBase):
# class PokemonStat(TableBase):
# class PokemonType(TableBase):
# class Region(TableBase):
# class Stat(TableBase):
# class SuperContestCombo(TableBase):
# class SuperContestEffect(TableBase):
# class Type(TableBase):
# class TypeEfficacy(TableBase):
# class TypeGameIndex(TableBase):
# class Version(TableBase):
# class VersionGroup(TableBase):
# class VersionGroupPokemonMoveMethod(TableBase):
# class VersionGroupRegion(TableBase):
#     def __unicode__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(cls, name, bases, attrs):
#     def star_rating(self):
#     def appears_underground(self):
#     def is_hm(self):
#     def recoil(self):
#     def is_neutral(self):
#     def name(self):
#     def stat(self, stat_identifier):
#     def base_stat(self, stat_identifier, default=0):
#     def better_damage_class(self):
#     def name(self):
# 
# Path: pokedex/defaults.py
# def get_default_csv_dir():
#     return get_default_csv_dir_with_origin()[0]


import binascii
import csv
import io
import os
import re
import six
from collections import defaultdict
from six.moves import zip
from pokedex.db import tables
from pokedex.defaults import get_default_csv_dir
            string = string[:15] + u'"...'
        template = u'<Message from {self.origin} for {self.cls}.{self.colname}:{self.id} -- {string}>'
        return template.format(self=self, string=string)

    def __str__(self):
        if six.PY2:
            return six.text_type(self).encode('utf8')
        else:
            return type(self).__unicode__(self)

    def __repr__(self):
        return str(self)

class Translations(object):
    """Data and opertaions specific to a location on disk (and a source language)
    """
    def __init__(self, source_lang=default_source_lang, csv_directory=None, translation_directory=None):
        if csv_directory is None:
            csv_directory = get_default_csv_dir()

        if translation_directory is None:
            translation_directory = os.path.join(csv_directory, 'translations')

        self.source_lang = default_source_lang
        self.csv_directory = csv_directory
        self.translation_directory = translation_directory

        self.language_ids = {}
        self.language_identifiers = {}
        self.official_langs = []

# Path: pokedex/db/tables.py
# class TableSuperclass(object):
# class TableMetaclass(DeclarativeMeta):
# class Language(TableBase):
# class Ability(TableBase):
# class AbilityChangelog(TableBase):
# class AbilityFlavorText(TableBase):
# class Berry(TableBase):
# class BerryFirmness(TableBase):
# class BerryFlavor(TableBase):
# class Characteristic(TableBase):
# class ConquestEpisode(TableBase):
# class ConquestEpisodeWarrior(TableBase):
# class ConquestKingdom(TableBase):
# class ConquestMaxLink(TableBase):
# class ConquestMoveData(TableBase):
# class ConquestMoveDisplacement(TableBase):
# class ConquestMoveEffect(TableBase):
# class ConquestMoveRange(TableBase):
# class ConquestPokemonAbility(TableBase):
# class ConquestPokemonEvolution(TableBase):
# class ConquestPokemonMove(TableBase):
# class ConquestPokemonStat(TableBase):
# class ConquestStat(TableBase):
# class ConquestTransformationPokemon(TableBase):
# class ConquestTransformationWarrior(TableBase):
# class ConquestWarrior(TableBase):
# class ConquestWarriorArchetype(TableBase):
# class ConquestWarriorRank(TableBase):
# class ConquestWarriorRankStatMap(TableBase):
# class ConquestWarriorSkill(TableBase):
# class ConquestWarriorSpecialty(TableBase):
# class ConquestWarriorStat(TableBase):
# class ConquestWarriorTransformation(TableBase):
# class ContestCombo(TableBase):
# class ContestEffect(TableBase):
# class ContestType(TableBase):
# class EggGroup(TableBase):
# class Encounter(TableBase):
# class EncounterCondition(TableBase):
# class EncounterConditionValue(TableBase):
# class EncounterConditionValueMap(TableBase):
# class EncounterMethod(TableBase):
# class EncounterSlot(TableBase):
# class EvolutionChain(TableBase):
# class EvolutionTrigger(TableBase):
# class Experience(TableBase):
# class Gender(TableBase):
# class Generation(TableBase):
# class GrowthRate(TableBase):
# class Item(TableBase):
# class ItemCategory(TableBase):
# class ItemFlag(TableBase):
# class ItemFlagMap(TableBase):
# class ItemFlavorText(TableBase):
# class ItemFlingEffect(TableBase):
# class ItemGameIndex(TableBase):
# class ItemPocket(TableBase):
# class Location(TableBase):
# class LocationArea(TableBase):
# class LocationAreaEncounterRate(TableBase):
# class LocationGameIndex(TableBase):
# class Machine(TableBase):
# class Move(TableBase):
# class MoveBattleStyle(TableBase):
# class MoveChangelog(TableBase):
# class MoveDamageClass(TableBase):
# class MoveEffect(TableBase):
# class MoveEffectChangelog(TableBase):
# class MoveFlag(TableBase):
# class MoveFlagMap(TableBase):
# class MoveFlavorText(TableBase):
# class MoveMeta(TableBase):
# class MoveMetaAilment(TableBase):
# class MoveMetaCategory(TableBase):
# class MoveMetaStatChange(TableBase):
# class MoveTarget(TableBase):
# class Nature(TableBase):
# class NatureBattleStylePreference(TableBase):
# class NaturePokeathlonStat(TableBase):
# class PalPark(TableBase):
# class PalParkArea(TableBase):
# class PokeathlonStat(TableBase):
# class Pokedex(TableBase):
# class PokedexVersionGroup(TableBase):
# class Pokemon(TableBase):
# class PokemonAbility(TableBase):
# class PokemonColor(TableBase):
# class PokemonDexNumber(TableBase):
# class PokemonEggGroup(TableBase):
# class PokemonEvolution(TableBase):
# class PokemonForm(TableBase):
# class PokemonFormGeneration(TableBase):
# class PokemonFormPokeathlonStat(TableBase):
# class PokemonGameIndex(TableBase):
# class PokemonHabitat(TableBase):
# class PokemonItem(TableBase):
# class PokemonMove(TableBase):
# class PokemonMoveMethod(TableBase):
# class PokemonShape(TableBase):
# class PokemonSpecies(TableBase):
# class PokemonSpeciesFlavorText(TableBase):
# class PokemonStat(TableBase):
# class PokemonType(TableBase):
# class Region(TableBase):
# class Stat(TableBase):
# class SuperContestCombo(TableBase):
# class SuperContestEffect(TableBase):
# class Type(TableBase):
# class TypeEfficacy(TableBase):
# class TypeGameIndex(TableBase):
# class Version(TableBase):
# class VersionGroup(TableBase):
# class VersionGroupPokemonMoveMethod(TableBase):
# class VersionGroupRegion(TableBase):
#     def __unicode__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(cls, name, bases, attrs):
#     def star_rating(self):
#     def appears_underground(self):
#     def is_hm(self):
#     def recoil(self):
#     def is_neutral(self):
#     def name(self):
#     def stat(self, stat_identifier):
#     def base_stat(self, stat_identifier, default=0):
#     def better_damage_class(self):
#     def name(self):
# 
# Path: pokedex/defaults.py
# def get_default_csv_dir():
#     return get_default_csv_dir_with_origin()[0]


# Path: pokedex/db/translations.py
import binascii
import csv
import io
import os
import re
import six
from collections import defaultdict
from six.moves import zip
from pokedex.db import tables
from pokedex.defaults import get_default_csv_dir

            string = string[:15] + u'"...'
        template = u'<Message from {self.origin} for {self.cls}.{self.colname}:{self.id} -- {string}>'
        return template.format(self=self, string=string)

    def __str__(self):
        if six.PY2:
            return six.text_type(self).encode('utf8')
        else:
            return type(self).__unicode__(self)

    def __repr__(self):
        return str(self)

class Translations(object):
    """Data and opertaions specific to a location on disk (and a source language)
    """
    def __init__(self, source_lang=default_source_lang, csv_directory=None, translation_directory=None):
        if csv_directory is None:
            csv_directory = get_default_csv_dir()

        if translation_directory is None:
            translation_directory = os.path.join(csv_directory, 'translations')

        self.source_lang = default_source_lang
        self.csv_directory = csv_directory
        self.translation_directory = translation_directory

        self.language_ids = {}
        self.language_identifiers = {}
        self.official_langs = []

        for row in self.reader_for_class(tables.Language, reader_class=csv.DictReader):