# Path: snowballing/models.py
# class Place(object):
#     """Represent a publication Place
# 
#     It has the following attributes:
# 
#     * :attr:`~acronym` -- place acronym (e.g., 'IPAW')
# 
#       * Surround it with <>, if the place has no acronym or you do not know it
#         (e.g., '<ImaginaryAcronym>')
# 
#     * :attr:`~name` -- full name of the place (e.g., 'International Provenance
#       and Annotation Workshop')
# 
#     * :attr:`~type` -- place acronym (e.g., 'IPAW')
# 
#     Other attributes are optional and can be used to include extra information
#     about the place.
#     Note however that it has the following reversed attributes:
# 
#     * :meth:`~_draw` -- method that draws the place
# 
# 
#     Doctest:
# 
#     .. doctest::
# 
#         >>> ipaw = Place('IPAW',
#         ...              'International Provenance and Annotation Workshop',
#         ...              'conference')
#         >>> ipaw.acronym
#         'IPAW'
#         >>> ipaw.name
#         'International Provenance and Annotation Workshop'
#         >>> ipaw.type
#         'conference'
# 
#         Places are considered equal if they have the same name
#         >>> ipaw2 = Place('I', 'International Provenance and Annotation Workshop',
#         ...              'journal')
#         >>> ipaw == ipaw2
#         True
#     """
# 
#     def __init__(self, acronym, name="", *args, **kwargs):
#         if name == "":
#             name = acronym
# 
#         self.acronym = acronym
#         self.name = name
# 
#         if args:
#             self.type = args[0]
# 
#         for key, value in kwargs.items():
#             setattr(self, key, value)
# 
#     def __eq__(self, other):
#         if not other:
#             return False
#         return self.name == other.name
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return self.acronym
# 
#     def __hash__(self):
#         return hash(self.name)
# 
# DB = Database()


from .models import Place, DB
"""This module includes common places in the database and provides functions
for creating other places

It includes the following common places in the database:

* Book -- represents books
* Lang -- represents places in foreign language
* Patent -- represents patents
* Standard -- represents standards
* TechReport -- represents technical reports
* Thesis -- represents thesis
* Unpublished -- represents work that were not published
* Web -- represents websites

"""


def conference(acrom, name, **kwargs):
    """Create a place with 'Conference' type"""

# Path: snowballing/models.py
# class Place(object):
#     """Represent a publication Place
# 
#     It has the following attributes:
# 
#     * :attr:`~acronym` -- place acronym (e.g., 'IPAW')
# 
#       * Surround it with <>, if the place has no acronym or you do not know it
#         (e.g., '<ImaginaryAcronym>')
# 
#     * :attr:`~name` -- full name of the place (e.g., 'International Provenance
#       and Annotation Workshop')
# 
#     * :attr:`~type` -- place acronym (e.g., 'IPAW')
# 
#     Other attributes are optional and can be used to include extra information
#     about the place.
#     Note however that it has the following reversed attributes:
# 
#     * :meth:`~_draw` -- method that draws the place
# 
# 
#     Doctest:
# 
#     .. doctest::
# 
#         >>> ipaw = Place('IPAW',
#         ...              'International Provenance and Annotation Workshop',
#         ...              'conference')
#         >>> ipaw.acronym
#         'IPAW'
#         >>> ipaw.name
#         'International Provenance and Annotation Workshop'
#         >>> ipaw.type
#         'conference'
# 
#         Places are considered equal if they have the same name
#         >>> ipaw2 = Place('I', 'International Provenance and Annotation Workshop',
#         ...              'journal')
#         >>> ipaw == ipaw2
#         True
#     """
# 
#     def __init__(self, acronym, name="", *args, **kwargs):
#         if name == "":
#             name = acronym
# 
#         self.acronym = acronym
#         self.name = name
# 
#         if args:
#             self.type = args[0]
# 
#         for key, value in kwargs.items():
#             setattr(self, key, value)
# 
#     def __eq__(self, other):
#         if not other:
#             return False
#         return self.name == other.name
# 
#     def __str__(self):
#         return self.name
# 
#     def __repr__(self):
#         return self.acronym
# 
#     def __hash__(self):
#         return hash(self.name)
# 
# DB = Database()


# Path: snowballing/common_places.py
from .models import Place, DB

"""This module includes common places in the database and provides functions
for creating other places

It includes the following common places in the database:

* Book -- represents books
* Lang -- represents places in foreign language
* Patent -- represents patents
* Standard -- represents standards
* TechReport -- represents technical reports
* Thesis -- represents thesis
* Unpublished -- represents work that were not published
* Web -- represents websites

"""


def conference(acrom, name, **kwargs):
    """Create a place with 'Conference' type"""

    return DB(Place(acrom, name, "Conference", **kwargs))