Compare commits

..

5 Commits

Author SHA1 Message Date
Andreas Zweili b207707fa3 I think this branch is newer. 2016-06-28 22:15:09 +02:00
Andreas Zweili 76769c2279 removing pet_variables because they're not needed anymore 2015-08-31 21:33:08 +02:00
Andreas Zweili be0e7e0bf4 enabling threading
fixing the deacrese_stats method
2015-08-31 21:31:44 +02:00
Andreas Zweili 3cb88fe198 some first changes to make the pet a class 2015-08-31 06:42:03 +02:00
Andreas Zweili 612896caff some first changes to make the pet a class 2015-08-31 06:40:33 +02:00
1052 changed files with 225 additions and 202835 deletions

10
.gitignore vendored
View File

@ -1,12 +1,2 @@
.idea
__pycache__
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

View File

@ -1,17 +1,20 @@
# tamagotchi
## Todo
* adding a function to decrease the health
## Possible things to add
Some interesting things I could add to the
tamagotchi programme which shouldn't be too hard:
* sleeping with all values with over 50% full heals the pet if it has lost health
* add pooping and cleaning function
* let it get sick if it's health is low, by random chance or if there's too much poop
* add sleep function, you have to switch the lights off otherwise it will have nightmare and loose one health point.
* add the possibility to get sick. Maybe compare two random numbers.
* add a function to restart the game or exit it after the pet died.
* add a function let the user exit the game
* safe the stats in a text file
* make a separate function for each age because it makes the aging
function more readable
* add a function which lets the tamagotchi age (one week as a youngling, three weeks as an adult and two weeks as an elderly)
* add a function which lets the tamagotchi age (one week as a youngling, three weeks as an adult and two weeks as an elderly)

339
pet_functions.py Executable file → Normal file
View File

@ -1,6 +1,3 @@
# #!/usr/bin/env python3
# imports the global variables
import pet_variables
# imports the time library needed to delay certain functions
import time
# imports the random library needed to generate a random number for
@ -11,218 +8,190 @@ import os
# imports the pygame library needed to play the sound in the
# poking function
from pygame import mixer
import threading
# variables needed for the guessing game
secret = randint(1, 10)
### Functions providing the basic function of the programme ###
### a class for controlling the pet ###
# a function which displays the pet's stats in a nice way.
def pet_stats():
os.system('clear')
print(pet_variables.pet_name)
print(pet_variables.pet_photo)
print("Status: " + pet_variables.pet_status)
print("Age: " + str(pet_variables.pet_age))
print("Health: " + pet_variables.pet_health * "")
print("Hunger: " + pet_variables.pet_hunger * "* ")
print("Happines: " + pet_variables.pet_happiness * "")
class Pet(object):
def __init__(self, name, photo, status, health, age, hunger, happiness, poke_count,
max_health, max_hunger, max_happiness):
# The pet's stats
self.name = name
self.photo = photo
self.status = status
self.health = health
self.age = age
self.hunger = hunger
self.happiness = happiness
self.poke_count = poke_count
self.max_health = max_health
self.max_hunger = max_hunger
self.max_happiness = max_happiness
# a function which displays the pet's stats in a nice way.
def display_stats(self):
os.system('clear')
print(self.name)
print(self.photo)
print("Status: " + self.status)
print("Age: " + str(self.age))
print("Health: " + self.health * "")
print("Hunger: " + self.hunger * "*")
print("Happines: " + self.happiness * "")
# A function which checks if the pet is still alive
def is_alive():
return pet_variables.pet_health > 0
# A function which checks if the pet is still alive
def is_alive(self):
return self.health > 0
# A function which changes the status of the pet depending of the age value.
# Each status has it's own characteristics.
# A function which let's the player choose his pet.
def beginning():
print("Which pet do you want to look after?")
print("1: Cat, 2: Mouse, 3: Fish, 4: Owl")
chosen_pet = int(input("Choose your pet:"))
if chosen_pet == 1:
pet_variables.pet_photo = pet_variables.cat
elif chosen_pet == 2:
pet_variables.pet_photo = pet_variables.mouse
elif chosen_pet == 3:
pet_variables.pet_photo = pet_variables.fish
elif chosen_pet == 4:
pet_variables.pet_photo = pet_variables.owl
pet_variables.pet_name = input("How do you want to call your pet?")
def set_youngling_stats(self):
self.max_health = 10
self.max_happiness = 8
self.max_hunger = 7
def set_adult_stats(self):
self.max_health = 10
self.max_happiness = 8
self.max_hunger = 7
# A function which changes the status of the pet depending of the age value.
# Each status has it's own characteristics.
def set_elderly_stats(self):
self.max_health = 7
self.max_happiness = 5
self.max_hunger = 10
def set_youngling_stats():
pet_variables.max_health = 10
pet_variables.max_happiness = 8
pet_variables.max_hunger = 7
def reset_stats(self):
self.health = self.max_health
self.happiness = self.max_happiness
self.hunger = self.max_hunger
def aging(self):
if self.age == 5:
self.status = "adult"
self.set_adult_stats()
print("Congratulation your pet has become an adult. It needs less food now")
print("and it's health has improved however it's grumpier than a youngling.")
elif self.age == 15:
self.status = "elderly"
self.set_elderly_stats()
print("Congratulation your pet has become an elderly it needs now less food.")
print("However it's health is worse and it's grumpier than an adult.")
def set_adult_stats():
pet_variables.max_health = 10
pet_variables.max_happiness = 8
pet_variables.max_hunger = 7
### Functions to increase and decrease stats ###
def increase_hunger(self):
if self.hunger < self.max_hunger:
self.hunger += 1
def set_elderly_stats():
pet_variables.max_health = 7
pet_variables.max_happiness = 5
pet_variables.max_hunger = 10
def increase_poke_count(self):
self.poke_count += 1
def increase_happiness(self):
if self.happiness < self.max_happiness:
self.happiness += 1
def reset_stats():
pet_variables.pet_health = pet_variables.max_health
pet_variables.pet_happiness = pet_variables.max_happiness
pet_variables.pet_hunger = pet_variables.max_hunger
def increase_health(self):
if self.health < self.max_health:
self.health += 1
def decrease_hunger(self):
if self.hunger > 0:
self.hunger -= 1
def aging():
if pet_variables.pet_age == 5:
pet_variables.pet_status = "adult"
set_adult_stats()
print("Congratulation your pet has become an adult. \
It needs less food now")
print("and it's health has improved. However, \
it's grumpier than a youngling.")
elif pet_variables.pet_age == 15:
pet_variables.pet_status = "elderly"
set_elderly_stats()
print("Congratulation your pet has become an elderly. \
It needs less food now.")
print("However it's health is worse and it is grumpier than an adult.")
def decrease_happiness(self):
if self.happiness > 0:
self.happiness -= 1
def decrease_health(self):
if self.health > 0:
self.health -= 1
### Functions to increase and decrease stats ###
def decrease_poke_count(self):
self.poke_count -= 1
def increase_hunger():
if pet_variables.pet_hunger < pet_variables.max_hunger:
pet_variables.pet_hunger += 1
# The function to decrease the stats and make the pet "live" needs to
# run in the background.
def _decrease_stats(self):
while True:
time.sleep(2)
self.decrease_hunger()
if self.hunger <= 0:
self.decrease_health()
self.decrease_happiness()
def decrease_stats(self):
threading.Thread(target=self.decrease_stats).start()
def increase_poke_count():
pet_variables.poke_count += 1
### Activities ###
# A function which simulates stroking it doesn't have any
# effect on the pet.
def stroking(self):
os.system('clear')
print()
print("You're stroking the back of your pet gently.")
print("It makes comforting noises and leans against your hand.")
time.sleep(1)
def increase_happiness():
if pet_variables.pet_happiness < pet_variables.max_happiness:
pet_variables.pet_happiness += 1
# Increases the pets hungriness by +1 unless the hunger is bigger than
# the pet's maximum hunger. In this case the pet will vomit and looses hunger
# and health.
def feeding(self):
os.system('clear')
print("Hungriness of " + self.name + ": " + self.hunger * "*")
feeding_confirmed = input("Do you want to feed your pet?")
if feeding_confirmed in ("Y", "y"):
self.increase_hunger()
def increase_health():
if pet_variables.pet_health < pet_variables.max_health:
pet_variables.pet_health += 1
def decrease_hunger():
if pet_variables.pet_hunger > 0:
pet_variables.pet_hunger -= 1
def decrease_happiness():
if pet_variables.pet_happiness > 0:
pet_variables.pet_happiness -= 1
def decrease_health():
if pet_variables.pet_health > 0:
pet_variables.pet_health -= 1
def decrease_poke_count():
pet_variables.poke_count -= 1
# The function to decrease the stats and make the pet "live" needs to
# run in the background.
def decrease_stats():
while True:
time.sleep(pet_variables.day)
decrease_hunger()
if pet_variables.pet_hunger <= 0:
decrease_health()
decrease_happiness()
### Activities ###
# A function which simulates stroking it doesn't have any
# effect on the pet.
def stroking():
os.system('clear')
print()
print("You're stroking the back of your pet gently.")
print("It makes comforting noises and leans against your hand.")
time.sleep(1)
# Increases the pets hungriness by +1 unless the hunger is bigger than
# the pet's maximum hunger. In this case the pet will vomit and looses hunger
# and health.
def feeding():
os.system('clear')
print("Hungriness of " \
+ pet_variables.pet_name \
+ ": " \
+ pet_variables.pet_hunger * "*")
feeding_confirmed = input("Do you want to feed your pet?")
if feeding_confirmed in ("Y", "y"):
increase_hunger()
# A simple guessing game which increases the pet's happiness
def playing():
guess = 0
os.system('clear')
while guess != secret:
g = input("Guess the Number")
guess = int(g)
if guess == secret:
print("You win!")
else:
if guess > secret:
print("Your guess is too high")
# A simple guessing game which increases the pet's happiness
def playing(self):
guess = 0
os.system('clear')
while guess != secret:
g = input("Guess the Number")
guess = int(g)
if guess == secret:
print("You win!")
else:
print("Too low")
increase_happiness()
print("Game over!")
if guess > secret:
print("Your guess is too high")
else:
print("Too low")
self.increase_happiness()
print("Game over!")
# let's you poke the pet and it will talk
# if you poke it more than 3 times it will get angry at you
def poking(self):
os.system('clear')
if self.poke_count < 3:
print("You poke " + self.name + " and it starts to speak.")
self.increase_poke_count()
mixer.init()
mixer.music.load('happy.mp3')
mixer.music.play()
time.sleep(5)
else:
print("You annoyed " + self.name + "." + " It got angry at you.")
self.decrease_happiness()
mixer.init()
mixer.music.load('angry.mp3')
mixer.music.play()
time.sleep(3)
# let's you poke the pet and it will talk
# if you poke it more than 3 times it will get angry at you
def poking():
os.system('clear')
if pet_variables.poke_count < 3:
print("You poke " \
+ pet_variables.pet_name \
+ " and it starts to speak.")
increase_poke_count()
mixer.init()
mixer.music.load('happy.mp3')
mixer.music.play()
time.sleep(5)
else:
print("You annoyed " \
+ pet_variables.pet_name \
+ "." \
+ " It got angry at you.")
decrease_happiness()
mixer.init()
mixer.music.load('angry.mp3')
mixer.music.play()
# A function which let's the pet sleep and regenerates it's stats
def sleeping(self):
os.system('clear')
print("Your pet is sleeping now.")
time.sleep(10)
if self.max_hunger / self.hunger > 0.5:
self.reset_stats()
print("Your pet woke up feeling rested and in a good mood.")
else:
print("Your pet has woken up.")
time.sleep(3)
# A function which let's the pet sleep and regenerates it's stats
def sleeping():
os.system('clear')
print("Your pet is sleeping now.")
time.sleep(10)
if pet_variables.max_hunger / pet_variables.pet_hunger > 0.5:
reset_stats()
print("Your pet woke up feeling rested and in a good mood.")
else:
print("Your pet has woken up.")
time.sleep(3)

View File

@ -1,26 +0,0 @@
#!/usr/bin/env python3
# The pet's stats
pet_name = "Fluffy"
pet_photo = "<`)))><"
pet_status = "youngling"
pet_health = 5
pet_age = 0
pet_hunger = 5
pet_happiness = 5
pet_stomach = 0
# age based max values
max_health = 5
max_hunger = 5
max_happiness = 10
# Pictures and symbols used ingame
cat = "(=^o.o^=)__"
mouse = "<:3 )~~~~"
fish = "<`)))><"
owl = "(^0M0^)"
# programme variables
beginning_finished = False
poke_count = 0
day = 15

View File

@ -1,80 +0,0 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
unset pydoc
# reset old environment variables
if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
hash -r 2>/dev/null
fi
if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "$1" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/home/andreas/git_repos/tamagotchi/pygame"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "$PYTHONHOME" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
if [ "x" != x ] ; then
PS1="$PS1"
else
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
fi
fi
export PS1
fi
alias pydoc="python -m pydoc"
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
hash -r 2>/dev/null
fi

View File

@ -1,42 +0,0 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/home/andreas/git_repos/tamagotchi/pygame"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
if ("" != "") then
set env_name = ""
else
if (`basename "$VIRTUAL_ENV"` == "__") then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
else
set env_name = `basename "$VIRTUAL_ENV"`
endif
endif
# Could be in a non-interactive environment,
# in which case, $prompt is undefined and we wouldn't
# care about the prompt anyway.
if ( $?prompt ) then
set _OLD_VIRTUAL_PROMPT="$prompt"
set prompt = "[$env_name] $prompt"
endif
unset env_name
alias pydoc python -m pydoc
rehash

View File

@ -1,74 +0,0 @@
# This file must be used with "source bin/activate.fish" *from fish* (http://fishshell.com)
# you cannot run it directly
function deactivate -d "Exit virtualenv and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
# set an empty local fish_function_path, so fish_prompt doesn't automatically reload
set -l fish_function_path
# erase the virtualenv's fish_prompt function, and restore the original
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
end
set -e VIRTUAL_ENV
if test "$argv[1]" != "nondestructive"
# Self destruct!
functions -e deactivate
end
end
# unset irrelevant variables
deactivate nondestructive
set -gx VIRTUAL_ENV "/home/andreas/git_repos/tamagotchi/pygame"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# unset PYTHONHOME if set
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# copy the current fish_prompt function as the function _old_fish_prompt
functions -c fish_prompt _old_fish_prompt
# with the original prompt function copied, we can override with our own.
function fish_prompt
# Prompt override?
if test -n ""
printf "%s%s" "" (set_color normal)
_old_fish_prompt
return
end
# ...Otherwise, prepend env
set -l _checkbase (basename "$VIRTUAL_ENV")
if test $_checkbase = "__"
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal)
_old_fish_prompt
else
printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal)
_old_fish_prompt
end
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end

View File

@ -1,34 +0,0 @@
"""By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))")
import sys
import os
old_os_path = os.environ['PATH']
os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if sys.platform == 'win32':
site_packages = os.path.join(base, 'Lib', 'site-packages')
else:
site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages')
prev_sys_path = list(sys.path)
import site
site.addsitedir(site_packages)
sys.real_prefix = sys.prefix
sys.prefix = base
# Move the added items to the front of the path:
new_sys_path = []
for item in list(sys.path):
if item not in prev_sys_path:
new_sys_path.append(item)
sys.path.remove(item)
sys.path[:0] = new_sys_path

View File

@ -1,11 +0,0 @@
#!/home/andreas/git_repos/tamagotchi/pygame/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@ -1,11 +0,0 @@
#!/home/andreas/git_repos/tamagotchi/pygame/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@ -1,11 +0,0 @@
#!/home/andreas/git_repos/tamagotchi/pygame/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from faker.cli import execute_from_command_line
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(execute_from_command_line())

View File

@ -1,11 +0,0 @@
#!/home/andreas/git_repos/tamagotchi/pygame/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@ -1,11 +0,0 @@
#!/home/andreas/git_repos/tamagotchi/pygame/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@ -1,11 +0,0 @@
#!/home/andreas/git_repos/tamagotchi/pygame/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@ -1 +0,0 @@
python3

Binary file not shown.

View File

@ -1 +0,0 @@
python3

View File

@ -1 +0,0 @@
/usr/include/python3.4m

View File

@ -1,27 +0,0 @@
/*
pygame - Python Game Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _CAMERA_H
#define _CAMERA_H
#include "_pygame.h"
#include "camera.h"
#endif

View File

@ -1,715 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef _PYGAME_H
#define _PYGAME_H
/** This header file includes all the definitions for the
** base pygame extensions. This header only requires
** SDL and Python includes. The reason for functions
** prototyped with #define's is to allow for maximum
** python portability. It also uses python as the
** runtime linker, which allows for late binding. For more
** information on this style of development, read the Python
** docs on this subject.
** http://www.python.org/doc/current/ext/using-cobjects.html
**
** If using this to build your own derived extensions,
** you'll see that the functions available here are mainly
** used to help convert between python objects and SDL objects.
** Since this library doesn't add a lot of functionality to
** the SDL libarary, it doesn't need to offer a lot either.
**
** When initializing your extension module, you must manually
** import the modules you want to use. (this is the part about
** using python as the runtime linker). Each module has its
** own import_xxx() routine. You need to perform this import
** after you have initialized your own module, and before
** you call any routines from that module. Since every module
** in pygame does this, there are plenty of examples.
**
** The base module does include some useful conversion routines
** that you are free to use in your own extension.
**
** When making changes, it is very important to keep the
** FIRSTSLOT and NUMSLOT constants up to date for each
** section. Also be sure not to overlap any of the slots.
** When you do make a mistake with this, it will result
** is a dereferenced NULL pointer that is easier to diagnose
** than it could be :]
**/
#if defined(HAVE_SNPRINTF) /* defined in python.h (pyerrors.h) and SDL.h (SDL_config.h) */
#undef HAVE_SNPRINTF /* remove GCC redefine warning */
#endif
// This must be before all else
#if defined(__SYMBIAN32__) && defined( OPENC )
#include <sys/types.h>
#if defined(__WINS__)
void* _alloca(size_t size);
# define alloca _alloca
#endif
#endif
/* This is unconditionally defined in Python.h */
#if defined(_POSIX_C_SOURCE)
#undef _POSIX_C_SOURCE
#endif
#include <Python.h>
/* Cobjects vanish in Python 3.2; so we will code as though we use capsules */
#if defined(Py_CAPSULE_H)
#define PG_HAVE_CAPSULE 1
#else
#define PG_HAVE_CAPSULE 0
#endif
#if defined(Py_COBJECT_H)
#define PG_HAVE_COBJECT 1
#else
#define PG_HAVE_COBJECT 0
#endif
#if !PG_HAVE_CAPSULE
#define PyCapsule_New(ptr, n, dfn) PyCObject_FromVoidPtr(ptr, dfn)
#define PyCapsule_GetPointer(obj, n) PyCObject_AsVoidPtr(obj)
#define PyCapsule_CheckExact(obj) PyCObject_Check(obj)
#endif
/* Pygame uses Py_buffer (PEP 3118) to exchange array information internally;
* define here as needed.
*/
#if !defined(PyBUF_SIMPLE)
typedef struct bufferinfo {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
/* Flags for getting buffers */
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
/* we used to include an E, backwards compatible alias */
#define PyBUF_WRITEABLE PyBUF_WRITABLE
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
#define PyBUF_CONTIG_RO (PyBUF_ND)
#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
#define PyBUF_STRIDED_RO (PyBUF_STRIDES)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
#define PyBUF_READ 0x100
#define PyBUF_WRITE 0x200
#define PyBUF_SHADOW 0x400
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(Py_buffer *);
#endif /* #if !defined(PyBUF_SIMPLE) */
/* Flag indicating a Pg_buffer; used for assertions within callbacks */
#ifndef NDEBUG
#define PyBUF_PYGAME 0x4000
#endif
#define PyBUF_HAS_FLAG(f, F) (((f) & (F)) == (F))
/* Array information exchange struct C type; inherits from Py_buffer
*
* Pygame uses its own Py_buffer derived C struct as an internal representation
* of an imported array buffer. The extended Py_buffer allows for a
* per-instance release callback,
*/
typedef void (*pybuffer_releaseproc)(Py_buffer *);
typedef struct pg_bufferinfo_s {
Py_buffer view;
PyObject *consumer; /* Input: Borrowed reference */
pybuffer_releaseproc release_buffer;
} Pg_buffer;
/* Operating system specific adjustments
*/
// No signal()
#if defined(__SYMBIAN32__) && defined(HAVE_SIGNAL_H)
#undef HAVE_SIGNAL_H
#endif
#if defined(HAVE_SNPRINTF)
#undef HAVE_SNPRINTF
#endif
#ifdef MS_WIN32 /*Python gives us MS_WIN32, SDL needs just WIN32*/
#ifndef WIN32
#define WIN32
#endif
#endif
/// Prefix when initializing module
#define MODPREFIX ""
/// Prefix when importing module
#define IMPPREFIX "pygame."
#ifdef __SYMBIAN32__
#undef MODPREFIX
#undef IMPPREFIX
// On Symbian there is no pygame package. The extensions are built-in or in sys\bin.
#define MODPREFIX "pygame_"
#define IMPPREFIX "pygame_"
#endif
#include <SDL.h>
/* macros used throughout the source */
#define RAISE(x,y) (PyErr_SetString((x), (y)), (PyObject*)NULL)
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 3
# define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
# define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
# define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
#endif
/* Py_ssize_t availability. */
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
typedef inquiry lenfunc;
typedef intargfunc ssizeargfunc;
typedef intobjargproc ssizeobjargproc;
typedef intintargfunc ssizessizeargfunc;
typedef intintobjargproc ssizessizeobjargproc;
typedef getreadbufferproc readbufferproc;
typedef getwritebufferproc writebufferproc;
typedef getsegcountproc segcountproc;
typedef getcharbufferproc charbufferproc;
#endif
#define PyType_Init(x) (((x).ob_type) = &PyType_Type)
#define PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API"
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ( (a) > (b) ? (a) : (b))
#endif
#ifndef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
#endif
/* test sdl initializations */
#define VIDEO_INIT_CHECK() \
if(!SDL_WasInit(SDL_INIT_VIDEO)) \
return RAISE(PyExc_SDLError, "video system not initialized")
#define CDROM_INIT_CHECK() \
if(!SDL_WasInit(SDL_INIT_CDROM)) \
return RAISE(PyExc_SDLError, "cdrom system not initialized")
#define JOYSTICK_INIT_CHECK() \
if(!SDL_WasInit(SDL_INIT_JOYSTICK)) \
return RAISE(PyExc_SDLError, "joystick system not initialized")
/* BASE */
#define VIEW_CONTIGUOUS 1
#define VIEW_C_ORDER 2
#define VIEW_F_ORDER 4
#define PYGAMEAPI_BASE_FIRSTSLOT 0
#define PYGAMEAPI_BASE_NUMSLOTS 19
#ifndef PYGAMEAPI_BASE_INTERNAL
#define PyExc_SDLError ((PyObject*)PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT])
#define PyGame_RegisterQuit \
(*(void(*)(void(*)(void)))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 1])
#define IntFromObj \
(*(int(*)(PyObject*, int*))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 2])
#define IntFromObjIndex \
(*(int(*)(PyObject*, int, int*))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 3])
#define TwoIntsFromObj \
(*(int(*)(PyObject*, int*, int*))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 4])
#define FloatFromObj \
(*(int(*)(PyObject*, float*))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 5])
#define FloatFromObjIndex \
(*(float(*)(PyObject*, int, float*)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 6])
#define TwoFloatsFromObj \
(*(int(*)(PyObject*, float*, float*)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 7])
#define UintFromObj \
(*(int(*)(PyObject*, Uint32*))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 8])
#define UintFromObjIndex \
(*(int(*)(PyObject*, int, Uint32*)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 9])
#define PyGame_Video_AutoQuit \
(*(void(*)(void))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 10])
#define PyGame_Video_AutoInit \
(*(int(*)(void))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 11])
#define RGBAFromObj \
(*(int(*)(PyObject*, Uint8*))PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 12])
#define PgBuffer_AsArrayInterface \
(*(PyObject*(*)(Py_buffer*)) PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 13])
#define PgBuffer_AsArrayStruct \
(*(PyObject*(*)(Py_buffer*)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 14])
#define PgObject_GetBuffer \
(*(int(*)(PyObject*, Pg_buffer*, int)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 15])
#define PgBuffer_Release \
(*(void(*)(Pg_buffer*)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 16])
#define PgDict_AsBuffer \
(*(int(*)(Pg_buffer*, PyObject*, int)) \
PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 17])
#define PgExc_BufferError \
((PyObject*)PyGAME_C_API[PYGAMEAPI_BASE_FIRSTSLOT + 18])
#define import_pygame_base() IMPORT_PYGAME_MODULE(base, BASE)
#endif
/* RECT */
#define PYGAMEAPI_RECT_FIRSTSLOT \
(PYGAMEAPI_BASE_FIRSTSLOT + PYGAMEAPI_BASE_NUMSLOTS)
#define PYGAMEAPI_RECT_NUMSLOTS 4
typedef struct {
int x, y;
int w, h;
}GAME_Rect;
typedef struct {
PyObject_HEAD
GAME_Rect r;
PyObject *weakreflist;
} PyRectObject;
#define PyRect_AsRect(x) (((PyRectObject*)x)->r)
#ifndef PYGAMEAPI_RECT_INTERNAL
#define PyRect_Check(x) \
((x)->ob_type == (PyTypeObject*)PyGAME_C_API[PYGAMEAPI_RECT_FIRSTSLOT + 0])
#define PyRect_Type (*(PyTypeObject*)PyGAME_C_API[PYGAMEAPI_RECT_FIRSTSLOT + 0])
#define PyRect_New \
(*(PyObject*(*)(SDL_Rect*))PyGAME_C_API[PYGAMEAPI_RECT_FIRSTSLOT + 1])
#define PyRect_New4 \
(*(PyObject*(*)(int,int,int,int))PyGAME_C_API[PYGAMEAPI_RECT_FIRSTSLOT + 2])
#define GameRect_FromObject \
(*(GAME_Rect*(*)(PyObject*, GAME_Rect*)) \
PyGAME_C_API[PYGAMEAPI_RECT_FIRSTSLOT + 3])
#define import_pygame_rect() IMPORT_PYGAME_MODULE(rect, RECT)
#endif
/* CDROM */
#define PYGAMEAPI_CDROM_FIRSTSLOT \
(PYGAMEAPI_RECT_FIRSTSLOT + PYGAMEAPI_RECT_NUMSLOTS)
#define PYGAMEAPI_CDROM_NUMSLOTS 2
typedef struct {
PyObject_HEAD
int id;
} PyCDObject;
#define PyCD_AsID(x) (((PyCDObject*)x)->id)
#ifndef PYGAMEAPI_CDROM_INTERNAL
#define PyCD_Check(x) \
((x)->ob_type == (PyTypeObject*)PyGAME_C_API[PYGAMEAPI_CDROM_FIRSTSLOT + 0])
#define PyCD_Type (*(PyTypeObject*)PyGAME_C_API[PYGAMEAPI_CDROM_FIRSTSLOT + 0])
#define PyCD_New \
(*(PyObject*(*)(int))PyGAME_C_API[PYGAMEAPI_CDROM_FIRSTSLOT + 1])
#define import_pygame_cd() IMPORT_PYGAME_MODULE(cdrom, CDROM)
#endif
/* JOYSTICK */
#define PYGAMEAPI_JOYSTICK_FIRSTSLOT \
(PYGAMEAPI_CDROM_FIRSTSLOT + PYGAMEAPI_CDROM_NUMSLOTS)
#define PYGAMEAPI_JOYSTICK_NUMSLOTS 2
typedef struct {
PyObject_HEAD
int id;
} PyJoystickObject;
#define PyJoystick_AsID(x) (((PyJoystickObject*)x)->id)
#ifndef PYGAMEAPI_JOYSTICK_INTERNAL
#define PyJoystick_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_JOYSTICK_FIRSTSLOT + 0])
#define PyJoystick_Type \
(*(PyTypeObject*)PyGAME_C_API[PYGAMEAPI_JOYSTICK_FIRSTSLOT + 0])
#define PyJoystick_New \
(*(PyObject*(*)(int))PyGAME_C_API[PYGAMEAPI_JOYSTICK_FIRSTSLOT + 1])
#define import_pygame_joystick() IMPORT_PYGAME_MODULE(joystick, JOYSTICK)
#endif
/* DISPLAY */
#define PYGAMEAPI_DISPLAY_FIRSTSLOT \
(PYGAMEAPI_JOYSTICK_FIRSTSLOT + PYGAMEAPI_JOYSTICK_NUMSLOTS)
#define PYGAMEAPI_DISPLAY_NUMSLOTS 2
typedef struct {
PyObject_HEAD
SDL_VideoInfo info;
} PyVidInfoObject;
#define PyVidInfo_AsVidInfo(x) (((PyVidInfoObject*)x)->info)
#ifndef PYGAMEAPI_DISPLAY_INTERNAL
#define PyVidInfo_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_DISPLAY_FIRSTSLOT + 0])
#define PyVidInfo_Type \
(*(PyTypeObject*)PyGAME_C_API[PYGAMEAPI_DISPLAY_FIRSTSLOT + 0])
#define PyVidInfo_New \
(*(PyObject*(*)(SDL_VideoInfo*)) \
PyGAME_C_API[PYGAMEAPI_DISPLAY_FIRSTSLOT + 1])
#define import_pygame_display() IMPORT_PYGAME_MODULE(display, DISPLAY)
#endif
/* SURFACE */
#define PYGAMEAPI_SURFACE_FIRSTSLOT \
(PYGAMEAPI_DISPLAY_FIRSTSLOT + PYGAMEAPI_DISPLAY_NUMSLOTS)
#define PYGAMEAPI_SURFACE_NUMSLOTS 3
typedef struct {
PyObject_HEAD
SDL_Surface* surf;
struct SubSurface_Data* subsurface; /*ptr to subsurface data (if a
* subsurface)*/
PyObject *weakreflist;
PyObject *locklist;
PyObject *dependency;
} PySurfaceObject;
#define PySurface_AsSurface(x) (((PySurfaceObject*)x)->surf)
#ifndef PYGAMEAPI_SURFACE_INTERNAL
#define PySurface_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_SURFACE_FIRSTSLOT + 0])
#define PySurface_Type \
(*(PyTypeObject*)PyGAME_C_API[PYGAMEAPI_SURFACE_FIRSTSLOT + 0])
#define PySurface_New \
(*(PyObject*(*)(SDL_Surface*)) \
PyGAME_C_API[PYGAMEAPI_SURFACE_FIRSTSLOT + 1])
#define PySurface_Blit \
(*(int(*)(PyObject*,PyObject*,SDL_Rect*,SDL_Rect*,int)) \
PyGAME_C_API[PYGAMEAPI_SURFACE_FIRSTSLOT + 2])
#define import_pygame_surface() do { \
IMPORT_PYGAME_MODULE(surface, SURFACE); \
if (PyErr_Occurred() != NULL) break; \
IMPORT_PYGAME_MODULE(surflock, SURFLOCK); \
} while (0)
#endif
/* SURFLOCK */ /*auto import/init by surface*/
#define PYGAMEAPI_SURFLOCK_FIRSTSLOT \
(PYGAMEAPI_SURFACE_FIRSTSLOT + PYGAMEAPI_SURFACE_NUMSLOTS)
#define PYGAMEAPI_SURFLOCK_NUMSLOTS 8
struct SubSurface_Data
{
PyObject* owner;
int pixeloffset;
int offsetx, offsety;
};
typedef struct
{
PyObject_HEAD
PyObject *surface;
PyObject *lockobj;
PyObject *weakrefs;
} PyLifetimeLock;
#ifndef PYGAMEAPI_SURFLOCK_INTERNAL
#define PyLifetimeLock_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 0])
#define PySurface_Prep(x) \
if(((PySurfaceObject*)x)->subsurface) \
(*(*(void(*)(PyObject*)) \
PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 1]))(x)
#define PySurface_Unprep(x) \
if(((PySurfaceObject*)x)->subsurface) \
(*(*(void(*)(PyObject*)) \
PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 2]))(x)
#define PySurface_Lock \
(*(int(*)(PyObject*))PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 3])
#define PySurface_Unlock \
(*(int(*)(PyObject*))PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 4])
#define PySurface_LockBy \
(*(int(*)(PyObject*,PyObject*)) \
PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 5])
#define PySurface_UnlockBy \
(*(int(*)(PyObject*,PyObject*)) \
PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 6])
#define PySurface_LockLifetime \
(*(PyObject*(*)(PyObject*,PyObject*)) \
PyGAME_C_API[PYGAMEAPI_SURFLOCK_FIRSTSLOT + 7])
#endif
/* EVENT */
#define PYGAMEAPI_EVENT_FIRSTSLOT \
(PYGAMEAPI_SURFLOCK_FIRSTSLOT + PYGAMEAPI_SURFLOCK_NUMSLOTS)
#define PYGAMEAPI_EVENT_NUMSLOTS 4
typedef struct {
PyObject_HEAD
int type;
PyObject* dict;
} PyEventObject;
#ifndef PYGAMEAPI_EVENT_INTERNAL
#define PyEvent_Check(x) \
((x)->ob_type == (PyTypeObject*)PyGAME_C_API[PYGAMEAPI_EVENT_FIRSTSLOT + 0])
#define PyEvent_Type \
(*(PyTypeObject*)PyGAME_C_API[PYGAMEAPI_EVENT_FIRSTSLOT + 0])
#define PyEvent_New \
(*(PyObject*(*)(SDL_Event*))PyGAME_C_API[PYGAMEAPI_EVENT_FIRSTSLOT + 1])
#define PyEvent_New2 \
(*(PyObject*(*)(int, PyObject*))PyGAME_C_API[PYGAMEAPI_EVENT_FIRSTSLOT + 2])
#define PyEvent_FillUserEvent \
(*(int (*)(PyEventObject*, SDL_Event*)) \
PyGAME_C_API[PYGAMEAPI_EVENT_FIRSTSLOT + 3])
#define import_pygame_event() IMPORT_PYGAME_MODULE(event, EVENT)
#endif
/* RWOBJECT */
/*the rwobject are only needed for C side work, not accessable from python*/
#define PYGAMEAPI_RWOBJECT_FIRSTSLOT \
(PYGAMEAPI_EVENT_FIRSTSLOT + PYGAMEAPI_EVENT_NUMSLOTS)
#define PYGAMEAPI_RWOBJECT_NUMSLOTS 7
#ifndef PYGAMEAPI_RWOBJECT_INTERNAL
#define RWopsFromObject \
(*(SDL_RWops*(*)(PyObject*))PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 0])
#define RWopsCheckObject \
(*(int(*)(SDL_RWops*))PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 1])
#define RWopsFromFileObjectThreaded \
(*(SDL_RWops*(*)(PyObject*))PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 2])
#define RWopsCheckObjectThreaded \
(*(int(*)(SDL_RWops*))PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 3])
#define RWopsEncodeFilePath \
(*(PyObject*(*)(PyObject*, PyObject*)) \
PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 4])
#define RWopsEncodeString \
(*(PyObject*(*)(PyObject*, const char*, const char*, PyObject*)) \
PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 5])
#define RWopsFromFileObject \
(*(SDL_RWops*(*)(PyObject*))PyGAME_C_API[PYGAMEAPI_RWOBJECT_FIRSTSLOT + 6])
#define import_pygame_rwobject() IMPORT_PYGAME_MODULE(rwobject, RWOBJECT)
/* For backward compatibility */
#define RWopsFromPython RWopsFromObject
#define RWopsCheckPython RWopsCheckObject
#define RWopsFromPythonThreaded RWopsFromFileObjectThreaded
#define RWopsCheckPythonThreaded RWopsCheckObjectThreaded
#endif
/* PixelArray */
#define PYGAMEAPI_PIXELARRAY_FIRSTSLOT \
(PYGAMEAPI_RWOBJECT_FIRSTSLOT + PYGAMEAPI_RWOBJECT_NUMSLOTS)
#define PYGAMEAPI_PIXELARRAY_NUMSLOTS 2
#ifndef PYGAMEAPI_PIXELARRAY_INTERNAL
#define PyPixelArray_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_PIXELARRAY_FIRSTSLOT + 0])
#define PyPixelArray_New \
(*(PyObject*(*)) PyGAME_C_API[PYGAMEAPI_PIXELARRAY_FIRSTSLOT + 1])
#define import_pygame_pixelarray() IMPORT_PYGAME_MODULE(pixelarray, PIXELARRAY)
#endif /* PYGAMEAPI_PIXELARRAY_INTERNAL */
/* Color */
#define PYGAMEAPI_COLOR_FIRSTSLOT \
(PYGAMEAPI_PIXELARRAY_FIRSTSLOT + PYGAMEAPI_PIXELARRAY_NUMSLOTS)
#define PYGAMEAPI_COLOR_NUMSLOTS 4
#ifndef PYGAMEAPI_COLOR_INTERNAL
#define PyColor_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_COLOR_FIRSTSLOT + 0])
#define PyColor_Type (*(PyObject *) PyGAME_C_API[PYGAMEAPI_COLOR_FIRSTSLOT])
#define PyColor_New \
(*(PyObject *(*)(Uint8*)) PyGAME_C_API[PYGAMEAPI_COLOR_FIRSTSLOT + 1])
#define PyColor_NewLength \
(*(PyObject *(*)(Uint8*, Uint8)) PyGAME_C_API[PYGAMEAPI_COLOR_FIRSTSLOT + 3])
#define RGBAFromColorObj \
(*(int(*)(PyObject*, Uint8*)) PyGAME_C_API[PYGAMEAPI_COLOR_FIRSTSLOT + 2])
#define import_pygame_color() IMPORT_PYGAME_MODULE(color, COLOR)
#endif /* PYGAMEAPI_COLOR_INTERNAL */
/* Math */
#define PYGAMEAPI_MATH_FIRSTSLOT \
(PYGAMEAPI_COLOR_FIRSTSLOT + PYGAMEAPI_COLOR_NUMSLOTS)
#define PYGAMEAPI_MATH_NUMSLOTS 2
#ifndef PYGAMEAPI_MATH_INTERNAL
#define PyVector2_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_MATH_FIRSTSLOT + 0])
#define PyVector3_Check(x) \
((x)->ob_type == (PyTypeObject*) \
PyGAME_C_API[PYGAMEAPI_MATH_FIRSTSLOT + 1])
/*
#define PyVector2_New \
(*(PyObject*(*)) PyGAME_C_API[PYGAMEAPI_MATH_FIRSTSLOT + 1])
*/
#define import_pygame_math() IMPORT_PYGAME_MODULE(math, MATH)
#endif /* PYGAMEAPI_MATH_INTERNAL */
#define PG_CAPSULE_NAME(m) (IMPPREFIX m "." PYGAMEAPI_LOCAL_ENTRY)
#define _IMPORT_PYGAME_MODULE(module, MODULE, api_root) { \
PyObject *_module = PyImport_ImportModule (IMPPREFIX #module); \
\
if (_module != NULL) { \
PyObject *_c_api = \
PyObject_GetAttrString (_module, PYGAMEAPI_LOCAL_ENTRY); \
\
Py_DECREF (_module); \
if (_c_api != NULL && PyCapsule_CheckExact (_c_api)) { \
void **localptr = \
(void**) PyCapsule_GetPointer (_c_api, \
PG_CAPSULE_NAME(#module)); \
\
if (localptr != NULL) { \
memcpy (api_root + PYGAMEAPI_##MODULE##_FIRSTSLOT, \
localptr, \
sizeof(void **)*PYGAMEAPI_##MODULE##_NUMSLOTS); \
} \
} \
Py_XDECREF(_c_api); \
} \
}
#ifndef NO_PYGAME_C_API
#define IMPORT_PYGAME_MODULE(module, MODULE) \
_IMPORT_PYGAME_MODULE(module, MODULE, PyGAME_C_API)
#define PYGAMEAPI_TOTALSLOTS \
(PYGAMEAPI_MATH_FIRSTSLOT + PYGAMEAPI_MATH_NUMSLOTS)
#ifdef PYGAME_H
void* PyGAME_C_API[PYGAMEAPI_TOTALSLOTS] = { NULL };
#else
extern void* PyGAME_C_API[PYGAMEAPI_TOTALSLOTS];
#endif
#endif
#if PG_HAVE_CAPSULE
#define encapsulate_api(ptr, module) \
PyCapsule_New(ptr, PG_CAPSULE_NAME(module), NULL)
#else
#define encapsulate_api(ptr, module) \
PyCObject_FromVoidPtr(ptr, NULL)
#endif
/*last platform compiler stuff*/
#if defined(macintosh) && defined(__MWERKS__) || defined(__SYMBIAN32__)
#define PYGAME_EXPORT __declspec(export)
#else
#define PYGAME_EXPORT
#endif
#if defined(__SYMBIAN32__) && PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 2
// These are missing from Python 2.2
#ifndef Py_RETURN_NONE
#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
#ifndef intrptr_t
#define intptr_t int
// No PySlice_GetIndicesEx on Py 2.2
#define PySlice_GetIndicesEx(a,b,c,d,e,f) PySlice_GetIndices(a,b,c,d,e)
#define PyBool_FromLong(x) Py_BuildValue("b", x)
#endif
// _symport_free and malloc are not exported in python.dll
// See http://discussion.forum.nokia.com/forum/showthread.php?t=57874
#undef PyObject_NEW
#define PyObject_NEW PyObject_New
#undef PyMem_MALLOC
#define PyMem_MALLOC PyMem_Malloc
#undef PyObject_DEL
#define PyObject_DEL PyObject_Del
#endif // intptr_t
#endif // __SYMBIAN32__ Python 2.2.2
#endif /* PYGAME_H */

View File

@ -1,31 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
Copyright (C) 2007 Marcus von Appen
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef _SURFACE_H
#define _SURFACE_H
#include "_pygame.h"
#include "surface.h"
#endif

View File

@ -1,146 +0,0 @@
/*
Bitmask 1.7 - A pixel-perfect collision detection library.
Copyright (C) 2002-2005 Ulf Ekstrom except for the bitcount
function which is copyright (C) Donald W. Gillies, 1992.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BITMASK_H
#define BITMASK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h>
/* Define INLINE for different compilers. If your compiler does not
support inlining then there might be a performance hit in
bitmask_overlap_area().
*/
#ifndef INLINE
# ifdef __GNUC__
# define INLINE inline
# else
# ifdef _MSC_VER
# define INLINE __inline
# else
# define INLINE
# endif
# endif
#endif
#define BITMASK_W unsigned long int
#define BITMASK_W_LEN (sizeof(BITMASK_W)*CHAR_BIT)
#define BITMASK_W_MASK (BITMASK_W_LEN - 1)
#define BITMASK_N(n) ((BITMASK_W)1 << (n))
typedef struct bitmask
{
int w,h;
BITMASK_W bits[1];
} bitmask_t;
/* Creates a bitmask of width w and height h, where
w and h must both be greater than 0.
The mask is automatically cleared when created.
*/
bitmask_t *bitmask_create(int w, int h);
/* Frees all the memory allocated by bitmask_create for m. */
void bitmask_free(bitmask_t *m);
/* Clears all bits in the mask */
void bitmask_clear(bitmask_t *m);
/* Sets all bits in the mask */
void bitmask_fill(bitmask_t *m);
/* Flips all bits in the mask */
void bitmask_invert(bitmask_t *m);
/* Counts the bits in the mask */
unsigned int bitmask_count(bitmask_t *m);
/* Returns nonzero if the bit at (x,y) is set. Coordinates start at
(0,0) */
static INLINE int bitmask_getbit(const bitmask_t *m, int x, int y)
{
return (m->bits[x/BITMASK_W_LEN*m->h + y] & BITMASK_N(x & BITMASK_W_MASK)) != 0;
}
/* Sets the bit at (x,y) */
static INLINE void bitmask_setbit(bitmask_t *m, int x, int y)
{
m->bits[x/BITMASK_W_LEN*m->h + y] |= BITMASK_N(x & BITMASK_W_MASK);
}
/* Clears the bit at (x,y) */
static INLINE void bitmask_clearbit(bitmask_t *m, int x, int y)
{
m->bits[x/BITMASK_W_LEN*m->h + y] &= ~BITMASK_N(x & BITMASK_W_MASK);
}
/* Returns nonzero if the masks overlap with the given offset.
The overlap tests uses the following offsets (which may be negative):
+----+----------..
|A | yoffset
| +-+----------..
+--|B
|xoffset
| |
: :
*/
int bitmask_overlap(const bitmask_t *a, const bitmask_t *b, int xoffset, int yoffset);
/* Like bitmask_overlap(), but will also give a point of intersection.
x and y are given in the coordinates of mask a, and are untouched
if there is no overlap. */
int bitmask_overlap_pos(const bitmask_t *a, const bitmask_t *b,
int xoffset, int yoffset, int *x, int *y);
/* Returns the number of overlapping 'pixels' */
int bitmask_overlap_area(const bitmask_t *a, const bitmask_t *b, int xoffset, int yoffset);
/* Fills a mask with the overlap of two other masks. A bitwise AND. */
void bitmask_overlap_mask (const bitmask_t *a, const bitmask_t *b, bitmask_t *c, int xoffset, int yoffset);
/* Draws mask b onto mask a (bitwise OR). Can be used to compose large
(game background?) mask from several submasks, which may speed up
the testing. */
void bitmask_draw(bitmask_t *a, const bitmask_t *b, int xoffset, int yoffset);
void bitmask_erase(bitmask_t *a, const bitmask_t *b, int xoffset, int yoffset);
/* Return a new scaled bitmask, with dimensions w*h. The quality of the
scaling may not be perfect for all circumstances, but it should
be reasonable. If either w or h is 0 a clear 1x1 mask is returned. */
bitmask_t *bitmask_scale(const bitmask_t *m, int w, int h);
/* Convolve b into a, drawing the output into o, shifted by offset. If offset
* is 0, then the (x,y) bit will be set if and only if
* bitmask_overlap(a, b, x - b->w - 1, y - b->h - 1) returns true.
*
* Modifies bits o[xoffset ... xoffset + a->w + b->w - 1)
* [yoffset ... yoffset + a->h + b->h - 1). */
void bitmask_convolve(const bitmask_t *a, const bitmask_t *b, bitmask_t *o, int xoffset, int yoffset);
#ifdef __cplusplus
} /* End of extern "C" { */
#endif
#endif

View File

@ -1,199 +0,0 @@
/*
pygame - Python Game Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "pygame.h"
#include "doc/camera_doc.h"
#if defined(__unix__)
#include <structmember.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <fcntl.h> /* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
/* on freebsd there is no asm/types */
#ifdef linux
#include <asm/types.h> /* for videodev2.h */
#endif
#include <linux/videodev2.h>
#elif defined(__APPLE__)
#include <AvailabilityMacros.h>
/* We support OSX 10.6 and below. */
#if __MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
#define PYGAME_MAC_CAMERA_OLD 1
#endif
#endif
#if defined(PYGAME_MAC_CAMERA_OLD)
#include <QuickTime/QuickTime.h>
#include <QuickTime/Movies.h>
#include <QuickTime/ImageCompression.h>
#endif
/* some constants used which are not defined on non-v4l machines. */
#ifndef V4L2_PIX_FMT_RGB24
#define V4L2_PIX_FMT_RGB24 'RGB3'
#endif
#ifndef V4L2_PIX_FMT_RGB444
#define V4L2_PIX_FMT_RGB444 'R444'
#endif
#ifndef V4L2_PIX_FMT_YUYV
#define V4L2_PIX_FMT_YUYV 'YUYV'
#endif
#define CLEAR(x) memset (&(x), 0, sizeof (x))
#define SAT(c) if (c & (~255)) { if (c < 0) c = 0; else c = 255; }
#define SAT2(c) ((c) & (~255) ? ((c) < 0 ? 0 : 255) : (c))
#define DEFAULT_WIDTH 640
#define DEFAULT_HEIGHT 480
#define RGB_OUT 1
#define YUV_OUT 2
#define HSV_OUT 4
#define CAM_V4L 1 /* deprecated. the incomplete support in pygame was removed */
#define CAM_V4L2 2
struct buffer {
void * start;
size_t length;
};
#if defined(__unix__)
typedef struct PyCameraObject {
PyObject_HEAD
char* device_name;
int camera_type;
unsigned long pixelformat;
unsigned int color_out;
struct buffer* buffers;
unsigned int n_buffers;
int width;
int height;
int size;
int hflip;
int vflip;
int brightness;
int fd;
} PyCameraObject;
#elif defined(PYGAME_MAC_CAMERA_OLD)
typedef struct PyCameraObject {
PyObject_HEAD
char* device_name; /* unieke name of the device */
OSType pixelformat;
unsigned int color_out;
SeqGrabComponent component; /* A type used by the Sequence Grabber API */
SGChannel channel; /* Channel of the Sequence Grabber */
GWorldPtr gworld; /* Pointer to the struct that holds the data of the captured image */
Rect boundsRect; /* bounds of the image frame */
long size; /* size of the image in our buffer to draw */
int hflip;
int vflip;
short depth;
struct buffer pixels;
//struct buffer tmp_pixels /* place where the flipped image in temporarly stored if hflip or vflip is true.*/
} PyCameraObject;
#else
/* generic definition.
*/
typedef struct PyCameraObject {
PyObject_HEAD
char* device_name;
int camera_type;
unsigned long pixelformat;
unsigned int color_out;
struct buffer* buffers;
unsigned int n_buffers;
int width;
int height;
int size;
int hflip;
int vflip;
int brightness;
int fd;
} PyCameraObject;
#endif
/* internal functions for colorspace conversion */
void colorspace (SDL_Surface *src, SDL_Surface *dst, int cspace);
void rgb24_to_rgb (const void* src, void* dst, int length, SDL_PixelFormat* format);
void rgb444_to_rgb (const void* src, void* dst, int length, SDL_PixelFormat* format);
void rgb_to_yuv (const void* src, void* dst, int length,
unsigned long source, SDL_PixelFormat* format);
void rgb_to_hsv (const void* src, void* dst, int length,
unsigned long source, SDL_PixelFormat* format);
void yuyv_to_rgb (const void* src, void* dst, int length, SDL_PixelFormat* format);
void yuyv_to_yuv (const void* src, void* dst, int length, SDL_PixelFormat* format);
void sbggr8_to_rgb (const void* src, void* dst, int width, int height,
SDL_PixelFormat* format);
void yuv420_to_rgb (const void* src, void* dst, int width, int height,
SDL_PixelFormat* format);
void yuv420_to_yuv (const void* src, void* dst, int width, int height,
SDL_PixelFormat* format);
#if defined(__unix__)
/* internal functions specific to v4l2 */
char** v4l2_list_cameras (int* num_devices);
int v4l2_get_control (int fd, int id, int *value);
int v4l2_set_control (int fd, int id, int value);
PyObject* v4l2_read_raw (PyCameraObject* self);
int v4l2_xioctl (int fd, int request, void *arg);
int v4l2_process_image (PyCameraObject* self, const void *image,
unsigned int buffer_size, SDL_Surface* surf);
int v4l2_query_buffer (PyCameraObject* self);
int v4l2_read_frame (PyCameraObject* self, SDL_Surface* surf);
int v4l2_stop_capturing (PyCameraObject* self);
int v4l2_start_capturing (PyCameraObject* self);
int v4l2_uninit_device (PyCameraObject* self);
int v4l2_init_mmap (PyCameraObject* self);
int v4l2_init_device (PyCameraObject* self);
int v4l2_close_device (PyCameraObject* self);
int v4l2_open_device (PyCameraObject* self);
#elif defined(PYGAME_MAC_CAMERA_OLD)
/* internal functions specific to mac */
char** mac_list_cameras(int* num_devices);
int mac_open_device (PyCameraObject* self);
int mac_init_device(PyCameraObject* self);
int mac_close_device (PyCameraObject* self);
int mac_start_capturing(PyCameraObject* self);
int mac_stop_capturing (PyCameraObject* self);
int mac_get_control(PyCameraObject* self, int id, int* value);
int mac_set_control(PyCameraObject* self, int id, int value);
PyObject* mac_read_raw(PyCameraObject *self);
int mac_read_frame(PyCameraObject* self, SDL_Surface* surf);
int mac_camera_idle(PyCameraObject* self);
int mac_copy_gworld_to_surface(PyCameraObject* self, SDL_Surface* surf);
void flip_image(const void* image, void* flipped_image, int width, int height,
short depth, int hflip, int vflip);
#endif

View File

@ -1,48 +0,0 @@
#ifndef _FASTEVENTS_H_
#define _FASTEVENTS_H_
/*
NET2 is a threaded, event based, network IO library for SDL.
Copyright (C) 2002 Bob Pendleton
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
If you do not wish to comply with the terms of the LGPL please
contact the author as other terms are available for a fee.
Bob Pendleton
Bob@Pendleton.com
*/
#include "SDL.h"
#ifdef __cplusplus
extern "C" {
#endif
int FE_Init(void); // Initialize FE
void FE_Quit(void); // shutdown FE
void FE_PumpEvents(void); // replacement for SDL_PumpEvents
int FE_PollEvent(SDL_Event *event); // replacement for SDL_PollEvent
int FE_WaitEvent(SDL_Event *event); // replacement for SDL_WaitEvent
int FE_PushEvent(SDL_Event *event); // replacement for SDL_PushEvent
char *FE_GetError(void); // get the last error
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,57 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#include <Python.h>
#if defined(HAVE_SNPRINTF) /* also defined in SDL_ttf (SDL.h) */
#undef HAVE_SNPRINTF /* remove GCC macro redefine warning */
#endif
#include <SDL_ttf.h>
/* test font initialization */
#define FONT_INIT_CHECK() \
if(!(*(int*)PyFONT_C_API[2])) \
return RAISE(PyExc_SDLError, "font system not initialized")
#define PYGAMEAPI_FONT_FIRSTSLOT 0
#define PYGAMEAPI_FONT_NUMSLOTS 3
typedef struct {
PyObject_HEAD
TTF_Font* font;
PyObject* weakreflist;
} PyFontObject;
#define PyFont_AsFont(x) (((PyFontObject*)x)->font)
#ifndef PYGAMEAPI_FONT_INTERNAL
#define PyFont_Check(x) ((x)->ob_type == (PyTypeObject*)PyFONT_C_API[0])
#define PyFont_Type (*(PyTypeObject*)PyFONT_C_API[0])
#define PyFont_New (*(PyObject*(*)(TTF_Font*))PyFONT_C_API[1])
/*slot 2 taken by FONT_INIT_CHECK*/
#define import_pygame_font() \
_IMPORT_PYGAME_MODULE(font, FONT, PyFONT_C_API)
static void* PyFONT_C_API[PYGAMEAPI_FONT_NUMSLOTS] = {NULL};
#endif

View File

@ -1,137 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2009 Vicent Marti
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _PYGAME_FREETYPE_H_
#define _PYGAME_FREETYPE_H_
#define PGFT_PYGAME1_COMPAT
#define HAVE_PYGAME_SDL_VIDEO
#define HAVE_PYGAME_SDL_RWOPS
#include "pygame.h"
#include "pgcompat.h"
#if PY3
# define IS_PYTHON_3
#endif
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_CACHE_H
#include FT_XFREE86_H
#include FT_TRIGONOMETRY_H
/**********************************************************
* Global module constants
**********************************************************/
/* Render styles */
#define FT_STYLE_NORMAL 0x00
#define FT_STYLE_STRONG 0x01
#define FT_STYLE_OBLIQUE 0x02
#define FT_STYLE_UNDERLINE 0x04
#define FT_STYLE_WIDE 0x08
#define FT_STYLE_DEFAULT 0xFF
/* Bounding box modes */
#define FT_BBOX_EXACT FT_GLYPH_BBOX_SUBPIXELS
#define FT_BBOX_EXACT_GRIDFIT FT_GLYPH_BBOX_GRIDFIT
#define FT_BBOX_PIXEL FT_GLYPH_BBOX_TRUNCATE
#define FT_BBOX_PIXEL_GRIDFIT FT_GLYPH_BBOX_PIXELS
/* Rendering flags */
#define FT_RFLAG_NONE (0)
#define FT_RFLAG_ANTIALIAS (1 << 0)
#define FT_RFLAG_AUTOHINT (1 << 1)
#define FT_RFLAG_VERTICAL (1 << 2)
#define FT_RFLAG_HINTED (1 << 3)
#define FT_RFLAG_KERNING (1 << 4)
#define FT_RFLAG_TRANSFORM (1 << 5)
#define FT_RFLAG_PAD (1 << 6)
#define FT_RFLAG_ORIGIN (1 << 7)
#define FT_RFLAG_UCS4 (1 << 8)
#define FT_RFLAG_USE_BITMAP_STRIKES (1 << 9)
#define FT_RFLAG_DEFAULTS (FT_RFLAG_HINTED | \
FT_RFLAG_USE_BITMAP_STRIKES | \
FT_RFLAG_ANTIALIAS)
#define FT_RENDER_NEWBYTEARRAY 0x0
#define FT_RENDER_NEWSURFACE 0x1
#define FT_RENDER_EXISTINGSURFACE 0x2
/**********************************************************
* Global module types
**********************************************************/
typedef struct _scale_s {
FT_UInt x, y;
} Scale_t;
typedef FT_Angle Angle_t;
struct fontinternals_;
struct freetypeinstance_;
typedef struct {
FT_Long font_index;
FT_Open_Args open_args;
} PgFontId;
typedef struct {
PyObject_HEAD
PgFontId id;
PyObject *path;
int is_scalable;
Scale_t face_size;
FT_Int16 style;
FT_Int16 render_flags;
double strength;
double underline_adjustment;
FT_UInt resolution;
Angle_t rotation;
FT_Matrix transform;
FT_Byte fgcolor[4];
struct freetypeinstance_ *freetype; /* Personal reference */
struct fontinternals_ *_internals;
} PgFontObject;
#define PgFont_IS_ALIVE(o) \
(((PgFontObject *)(o))->_internals != 0)
/**********************************************************
* Module declaration
**********************************************************/
#define PYGAMEAPI_FREETYPE_FIRSTSLOT 0
#define PYGAMEAPI_FREETYPE_NUMSLOTS 2
#ifndef PYGAME_FREETYPE_INTERNAL
#define PgFont_Check(x) ((x)->ob_type == (PyTypeObject*)PgFREETYPE_C_API[0])
#define PgFont_Type (*(PyTypeObject*)PgFREETYPE_C_API[1])
#define PgFont_New (*(PyObject*(*)(const char*, long))PgFREETYPE_C_API[1])
#define import_pygame_freetype() \
_IMPORT_PYGAME_MODULE(freetype, FREETYPE, PgFREETYPE_C_API)
static void *PgFREETYPE_C_API[PYGAMEAPI_FREETYPE_NUMSLOTS] = {0};
#endif /* PYGAME_FREETYPE_INTERNAL */
#endif /* _PYGAME_FREETYPE_H_ */

View File

@ -1,25 +0,0 @@
#include <Python.h>
#include "bitmask.h"
#define PYGAMEAPI_MASK_FIRSTSLOT 0
#define PYGAMEAPI_MASK_NUMSLOTS 1
#define PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API"
typedef struct {
PyObject_HEAD
bitmask_t *mask;
} PyMaskObject;
#define PyMask_AsBitmap(x) (((PyMaskObject*)x)->mask)
#ifndef PYGAMEAPI_MASK_INTERNAL
#define PyMask_Type (*(PyTypeObject*)PyMASK_C_API[0])
#define PyMask_Check(x) ((x)->ob_type == &PyMask_Type)
#define import_pygame_mask() \
_IMPORT_PYGAME_MODULE(mask, MASK, PyMASK_C_API)
static void* PyMASK_C_API[PYGAMEAPI_MASK_NUMSLOTS] = {NULL};
#endif /* #ifndef PYGAMEAPI_MASK_INTERNAL */

View File

@ -1,66 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#include <Python.h>
#include <SDL_mixer.h>
#include <structmember.h>
/* test mixer initializations */
#define MIXER_INIT_CHECK() \
if(!SDL_WasInit(SDL_INIT_AUDIO)) \
return RAISE(PyExc_SDLError, "mixer system not initialized")
#define PYGAMEAPI_MIXER_FIRSTSLOT 0
#define PYGAMEAPI_MIXER_NUMSLOTS 7
typedef struct {
PyObject_HEAD
Mix_Chunk *chunk;
Uint8 *mem;
PyObject *weakreflist;
} PySoundObject;
typedef struct {
PyObject_HEAD
int chan;
} PyChannelObject;
#define PySound_AsChunk(x) (((PySoundObject*)x)->chunk)
#define PyChannel_AsInt(x) (((PyChannelObject*)x)->chan)
#ifndef PYGAMEAPI_MIXER_INTERNAL
#define PySound_Check(x) ((x)->ob_type == (PyTypeObject*)PyMIXER_C_API[0])
#define PySound_Type (*(PyTypeObject*)PyMIXER_C_API[0])
#define PySound_New (*(PyObject*(*)(Mix_Chunk*))PyMIXER_C_API[1])
#define PySound_Play (*(PyObject*(*)(PyObject*, PyObject*))PyMIXER_C_API[2])
#define PyChannel_Check(x) ((x)->ob_type == (PyTypeObject*)PyMIXER_C_API[3])
#define PyChannel_Type (*(PyTypeObject*)PyMIXER_C_API[3])
#define PyChannel_New (*(PyObject*(*)(int))PyMIXER_C_API[4])
#define PyMixer_AutoInit (*(PyObject*(*)(PyObject*, PyObject*))PyMIXER_C_API[5])
#define PyMixer_AutoQuit (*(void(*)(void))PyMIXER_C_API[6])
#define import_pygame_mixer() \
_IMPORT_PYGAME_MODULE(mixer, MIXER, PyMIXER_C_API)
static void* PyMIXER_C_API[PYGAMEAPI_MIXER_NUMSLOTS] = {NULL};
#endif

View File

@ -1,26 +0,0 @@
/* array structure interface version 3 declarations */
#if !defined(PG_ARRAYINTER_HEADER)
#define PG_ARRAYINTER_HEADER
static const int PAI_CONTIGUOUS = 0x01;
static const int PAI_FORTRAN = 0x02;
static const int PAI_ALIGNED = 0x100;
static const int PAI_NOTSWAPPED = 0x200;
static const int PAI_WRITEABLE = 0x400;
static const int PAI_ARR_HAS_DESCR = 0x800;
typedef struct {
int two; /* contains the integer 2 -- simple sanity check */
int nd; /* number of dimensions */
char typekind; /* kind in array -- character code of typestr */
int itemsize; /* size of each element */
int flags; /* flags indicating how the data should be */
/* interpreted */
Py_intptr_t *shape; /* A length-nd array of shape information */
Py_intptr_t *strides; /* A length-nd array of stride information */
void *data; /* A pointer to the first element of the array */
PyObject *descr; /* NULL or a data-description */
} PyArrayInterface;
#endif

View File

@ -1,52 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
Copyright (C) 2007 Rene Dudfield, Richard Goedeken
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
/* Bufferproxy module C api.
Depends on pygame.h being included first.
*/
#if !defined(PG_BUFPROXY_HEADER)
#define PYGAMEAPI_BUFPROXY_NUMSLOTS 4
#define PYGAMEAPI_BUFPROXY_FIRSTSLOT 0
#if !(defined(PYGAMEAPI_BUFPROXY_INTERNAL) || defined(NO_PYGAME_C_API))
static void *PgBUFPROXY_C_API[PYGAMEAPI_BUFPROXY_NUMSLOTS];
typedef PyObject *(*_pgbufproxy_new_t)(PyObject *, getbufferproc);
typedef PyObject *(*_pgbufproxy_get_obj_t)(PyObject *);
typedef int (*_pgbufproxy_trip_t)(PyObject *);
#define PgBufproxy_Type (*(PyTypeObject*)PgBUFPROXY_C_API[0])
#define PgBufproxy_New (*(_pgbufproxy_new_t)PgBUFPROXY_C_API[1])
#define PgBufproxy_GetParent \
(*(_pgbufproxy_get_obj_t)PgBUFPROXY_C_API[2])
#define PgBufproxy_Trip (*(_pgbufproxy_trip_t)PgBUFPROXY_C_API[3])
#define PgBufproxy_Check(x) ((x)->ob_type == (PgBufproxy_Type))
#define import_pygame_bufferproxy() \
_IMPORT_PYGAME_MODULE(bufferproxy, BUFPROXY, PgBUFPROXY_C_API)
#endif /* #if !(defined(PYGAMEAPI_BUFPROXY_INTERNAL) || ... */
#define PG_BUFPROXY_HEADER
#endif /* #if !defined(PG_BUFPROXY_HEADER) */

View File

@ -1,210 +0,0 @@
/* Python 2.x/3.x compitibility tools
*/
#if !defined(PGCOMPAT_H)
#define PGCOMPAT_H
#if PY_MAJOR_VERSION >= 3
#define PY3 1
/* Define some aliases for the removed PyInt_* functions */
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyNumber_Int PyNumber_Long
/* Weakrefs flags changed in 3.x */
#define Py_TPFLAGS_HAVE_WEAKREFS 0
/* Module init function returns new module instance. */
#define MODINIT_RETURN(x) return x
#define MODINIT_DEFINE(mod_name) PyMODINIT_FUNC PyInit_##mod_name (void)
#define DECREF_MOD(mod) Py_DECREF (mod)
/* Type header differs. */
#define TYPE_HEAD(x,y) PyVarObject_HEAD_INIT(x,y)
/* Text interface. Use unicode strings. */
#define Text_Type PyUnicode_Type
#define Text_Check PyUnicode_Check
#define Text_FromUTF8 PyUnicode_FromString
#define Text_FromUTF8AndSize PyUnicode_FromStringAndSize
#define Text_FromFormat PyUnicode_FromFormat
#define Text_GetSize PyUnicode_GetSize
#define Text_GET_SIZE PyUnicode_GET_SIZE
/* Binary interface. Use bytes. */
#define Bytes_Type PyBytes_Type
#define Bytes_Check PyBytes_Check
#define Bytes_Size PyBytes_Size
#define Bytes_AsString PyBytes_AsString
#define Bytes_AsStringAndSize PyBytes_AsStringAndSize
#define Bytes_FromStringAndSize PyBytes_FromStringAndSize
#define Bytes_FromFormat PyBytes_FromFormat
#define Bytes_AS_STRING PyBytes_AS_STRING
#define Bytes_GET_SIZE PyBytes_GET_SIZE
#define Bytes_AsDecodeObject PyBytes_AsDecodedObject
#define Object_Unicode PyObject_Str
#define IsTextObj(x) (PyUnicode_Check(x) || PyBytes_Check(x))
/* Renamed builtins */
#define BUILTINS_MODULE "builtins"
#define BUILTINS_UNICODE "str"
#define BUILTINS_UNICHR "chr"
/* Defaults for unicode file path encoding */
#define UNICODE_DEF_FS_CODEC Py_FileSystemDefaultEncoding
#if defined(MS_WIN32)
#define UNICODE_DEF_FS_ERROR "replace"
#else
#define UNICODE_DEF_FS_ERROR "surrogateescape"
#endif
#else /* #if PY_MAJOR_VERSION >= 3 */
#define PY3 0
/* Module init function returns nothing. */
#define MODINIT_RETURN(x) return
#define MODINIT_DEFINE(mod_name) PyMODINIT_FUNC init##mod_name (void)
#define DECREF_MOD(mod)
/* Type header differs. */
#define TYPE_HEAD(x,y) \
PyObject_HEAD_INIT(x) \
0,
/* Text interface. Use ascii strings. */
#define Text_Type PyString_Type
#define Text_Check PyString_Check
#define Text_FromUTF8 PyString_FromString
#define Text_FromUTF8AndSize PyString_FromStringAndSize
#define Text_FromFormat PyString_FromFormat
#define Text_GetSize PyString_GetSize
#define Text_GET_SIZE PyString_GET_SIZE
/* Binary interface. Use ascii strings. */
#define Bytes_Type PyString_Type
#define Bytes_Check PyString_Check
#define Bytes_Size PyString_Size
#define Bytes_AsString PyString_AsString
#define Bytes_AsStringAndSize PyString_AsStringAndSize
#define Bytes_FromStringAndSize PyString_FromStringAndSize
#define Bytes_FromFormat PyString_FromFormat
#define Bytes_AS_STRING PyString_AS_STRING
#define Bytes_GET_SIZE PyString_GET_SIZE
#define Bytes_AsDecodedObject PyString_AsDecodedObject
#define Object_Unicode PyObject_Unicode
/* Renamed builtins */
#define BUILTINS_MODULE "__builtin__"
#define BUILTINS_UNICODE "unicode"
#define BUILTINS_UNICHR "unichr"
/* Defaults for unicode file path encoding */
#define UNICODE_DEF_FS_CODEC Py_FileSystemDefaultEncoding
#define UNICODE_DEF_FS_ERROR "strict"
#endif /* #if PY_MAJOR_VERSION >= 3 */
#define PY2 (!PY3)
#define MODINIT_ERROR MODINIT_RETURN (NULL)
/* Module state. These macros are used to define per-module macros.
* v - global state variable (Python 2.x)
* s - global state structure (Python 3.x)
*/
#define PY2_GETSTATE(v) (&(v))
#define PY3_GETSTATE(s, m) ((struct s *) PyModule_GetState (m))
/* Pep 3123: Making PyObject_HEAD conform to standard C */
#if !defined(Py_TYPE)
#define Py_TYPE(o) (((PyObject *)(o))->ob_type)
#define Py_REFCNT(o) (((PyObject *)(o))->ob_refcnt)
#define Py_SIZE(o) (((PyVarObject *)(o))->ob_size)
#endif
/* Encode a unicode file path */
#define Unicode_AsEncodedPath(u) \
PyUnicode_AsEncodedString ((u), UNICODE_DEF_FS_CODEC, UNICODE_DEF_FS_ERROR)
/* Relative paths introduced in Python 2.6 */
#if PY_VERSION_HEX >= 0x02060000
#define HAVE_RELATIVE_IMPORT 1
#else
#define HAVE_RELATIVE_IMPORT 0
#endif
#if HAVE_RELATIVE_IMPORT
#define RELATIVE_MODULE(m) ("." m)
#else
#define RELATIVE_MODULE(m) (m)
#endif
/* Python 3 (PEP 3118) buffer protocol */
#if PY_VERSION_HEX >= 0x02060000
#define HAVE_NEW_BUFPROTO 1
#else
#define HAVE_NEW_BUFPROTO 0
#endif
#define HAVE_OLD_BUFPROTO PY2
#if !defined(PG_ENABLE_OLDBUF) /* allow for command line override */
#if HAVE_OLD_BUFPROTO
#define PG_ENABLE_OLDBUF 1
#else
#define PG_ENABLE_OLDBUF 0
#endif
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_CLASS
#define Py_TPFLAGS_HAVE_CLASS 0
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
#endif
#if PY_VERSION_HEX >= 0x03020000
#define Slice_GET_INDICES_EX(slice, length, start, stop, step, slicelength) \
PySlice_GetIndicesEx(slice, length, start, stop, step, slicelength)
#else
#define Slice_GET_INDICES_EX(slice, length, start, stop, step, slicelength) \
PySlice_GetIndicesEx((PySliceObject *)(slice), length, \
start, stop, step, slicelength)
#endif
/* Python 2.4 (PEP 353) ssize_t */
#if PY_VERSION_HEX < 0x02050000
#define PyInt_AsSsize_t PyInt_AsLong
#define PyInt_FromSsizt_t PyInt_FromLong
#endif
/* Support new buffer protocol? */
#if !defined(PG_ENABLE_NEWBUF) /* allow for command line override */
#if HAVE_NEW_BUFPROTO && !defined(PYPY_VERSION)
#define PG_ENABLE_NEWBUF 1
#else
#define PG_ENABLE_NEWBUF 0
#endif
#endif
#endif /* #if !defined(PGCOMPAT_H) */

View File

@ -1,16 +0,0 @@
#if !defined(PGOPENGL_H)
#define PGOPENGL_H
/** This header includes definitions of Opengl functions as pointer types for
** use with the SDL function SDL_GL_GetProcAddress.
**/
#if defined(_WIN32)
#define GL_APIENTRY __stdcall
#else
#define GL_APIENTRY
#endif
typedef void (GL_APIENTRY *GL_glReadPixels_Func)(int, int, int, int, unsigned int, unsigned int, void*);
#endif

View File

@ -1,34 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
/* To allow the Pygame C api to be globally shared by all code within an
* extension module built from multiple C files, only include the pygame.h
* header within the top level C file, the one which calls the
* 'import_pygame_*' macros. All other C source files of the module should
* include _pygame.h instead.
*/
#ifndef PYGAME_H
#define PYGAME_H
#include "_pygame.h"
#endif

View File

@ -1,143 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2006, 2007 Rene Dudfield, Marcus von Appen
Originally put in the public domain by Sam Lantinga.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This is unconditionally defined in Python.h */
#if defined(_POSIX_C_SOURCE)
#undef _POSIX_C_SOURCE
#endif
#include <Python.h>
/* Handle clipboard text and data in arbitrary formats */
/**
* Predefined supported pygame scrap types.
*/
#define PYGAME_SCRAP_TEXT "text/plain"
#define PYGAME_SCRAP_BMP "image/bmp"
#define PYGAME_SCRAP_PPM "image/ppm"
#define PYGAME_SCRAP_PBM "image/pbm"
/**
* The supported scrap clipboard types.
*
* This is only relevant in a X11 environment, which supports mouse
* selections as well. For Win32 and MacOS environments the default
* clipboard is used, no matter what value is passed.
*/
typedef enum
{
SCRAP_CLIPBOARD,
SCRAP_SELECTION /* only supported in X11 environments. */
} ScrapClipType;
/**
* Macro for initialization checks.
*/
#define PYGAME_SCRAP_INIT_CHECK() \
if(!pygame_scrap_initialized()) \
return (PyErr_SetString (PyExc_SDLError, \
"scrap system not initialized."), NULL)
/**
* \brief Checks, whether the pygame scrap module was initialized.
*
* \return 1 if the modules was initialized, 0 otherwise.
*/
extern int
pygame_scrap_initialized (void);
/**
* \brief Initializes the pygame scrap module internals. Call this before any
* other method.
*
* \return 1 on successful initialization, 0 otherwise.
*/
extern int
pygame_scrap_init (void);
/**
* \brief Checks, whether the pygame window lost the clipboard focus or not.
*
* \return 1 if the window lost the focus, 0 otherwise.
*/
extern int
pygame_scrap_lost (void);
/**
* \brief Places content of a specific type into the clipboard.
*
* \note For X11 the following notes are important: The following types
* are reserved for internal usage and thus will throw an error on
* setting them: "TIMESTAMP", "TARGETS", "SDL_SELECTION".
* Setting PYGAME_SCRAP_TEXT ("text/plain") will also automatically
* set the X11 types "STRING" (XA_STRING), "TEXT" and "UTF8_STRING".
*
* For Win32 the following notes are important: Setting
* PYGAME_SCRAP_TEXT ("text/plain") will also automatically set
* the Win32 type "TEXT" (CF_TEXT).
*
* For QNX the following notes are important: Setting
* PYGAME_SCRAP_TEXT ("text/plain") will also automatically set
* the QNX type "TEXT" (Ph_CL_TEXT).
*
* \param type The type of the content.
* \param srclen The length of the content.
* \param src The NULL terminated content.
* \return 1, if the content could be successfully pasted into the clipboard,
* 0 otherwise.
*/
extern int
pygame_scrap_put (char *type, int srclen, char *src);
/**
* \brief Gets the current content from the clipboard.
*
* \note The received content does not need to be the content previously
* placed in the clipboard using pygame_put_scrap(). See the
* pygame_put_scrap() notes for more details.
*
* \param type The type of the content to receive.
* \param count The size of the returned content.
* \return The content or NULL in case of an error or if no content of the
* specified type was available.
*/
extern char*
pygame_scrap_get (char *type, unsigned long *count);
/**
* \brief Gets the currently available content types from the clipboard.
*
* \return The different available content types or NULL in case of an
* error or if no content type is available.
*/
extern char**
pygame_scrap_get_types (void);
/**
* \brief Checks whether content for the specified scrap type is currently
* available in the clipboard.
*
* \param type The type to check for.
* \return 1, if there is content and 0 otherwise.
*/
extern int
pygame_scrap_contains (char *type);

View File

@ -1,359 +0,0 @@
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
Copyright (C) 2007 Marcus von Appen
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#ifndef SURFACE_H
#define SURFACE_H
/* This is defined in SDL.h */
#if defined(_POSIX_C_SOURCE)
#undef _POSIX_C_SOURCE
#endif
#include <SDL.h>
#include "pygame.h"
#define PYGAME_BLEND_ADD 0x1
#define PYGAME_BLEND_SUB 0x2
#define PYGAME_BLEND_MULT 0x3
#define PYGAME_BLEND_MIN 0x4
#define PYGAME_BLEND_MAX 0x5
#define PYGAME_BLEND_RGB_ADD 0x1
#define PYGAME_BLEND_RGB_SUB 0x2
#define PYGAME_BLEND_RGB_MULT 0x3
#define PYGAME_BLEND_RGB_MIN 0x4
#define PYGAME_BLEND_RGB_MAX 0x5
#define PYGAME_BLEND_RGBA_ADD 0x6
#define PYGAME_BLEND_RGBA_SUB 0x7
#define PYGAME_BLEND_RGBA_MULT 0x8
#define PYGAME_BLEND_RGBA_MIN 0x9
#define PYGAME_BLEND_RGBA_MAX 0x10
#define PYGAME_BLEND_PREMULTIPLIED 0x11
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define GET_PIXEL_24(b) (b[0] + (b[1] << 8) + (b[2] << 16))
#else
#define GET_PIXEL_24(b) (b[2] + (b[1] << 8) + (b[0] << 16))
#endif
#define GET_PIXEL(pxl, bpp, source) \
switch (bpp) \
{ \
case 2: \
pxl = *((Uint16 *) (source)); \
break; \
case 4: \
pxl = *((Uint32 *) (source)); \
break; \
default: \
{ \
Uint8 *b = (Uint8 *) source; \
pxl = GET_PIXEL_24(b); \
} \
break; \
}
#define GET_PIXELVALS(_sR, _sG, _sB, _sA, px, fmt, ppa) \
_sR = ((px & fmt->Rmask) >> fmt->Rshift); \
_sR = (_sR << fmt->Rloss) + (_sR >> (8 - (fmt->Rloss << 1))); \
_sG = ((px & fmt->Gmask) >> fmt->Gshift); \
_sG = (_sG << fmt->Gloss) + (_sG >> (8 - (fmt->Gloss << 1))); \
_sB = ((px & fmt->Bmask) >> fmt->Bshift); \
_sB = (_sB << fmt->Bloss) + (_sB >> (8 - (fmt->Bloss << 1))); \
if (ppa) \
{ \
_sA = ((px & fmt->Amask) >> fmt->Ashift); \
_sA = (_sA << fmt->Aloss) + (_sA >> (8 - (fmt->Aloss << 1))); \
} \
else \
{ \
_sA = 255; \
}
#define GET_PIXELVALS_1(sr, sg, sb, sa, _src, _fmt) \
sr = _fmt->palette->colors[*((Uint8 *) (_src))].r; \
sg = _fmt->palette->colors[*((Uint8 *) (_src))].g; \
sb = _fmt->palette->colors[*((Uint8 *) (_src))].b; \
sa = 255;
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SET_OFFSETS_24(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 0 : \
fmt->Rshift == 8 ? 1 : \
2 ); \
og = (fmt->Gshift == 0 ? 0 : \
fmt->Gshift == 8 ? 1 : \
2 ); \
ob = (fmt->Bshift == 0 ? 0 : \
fmt->Bshift == 8 ? 1 : \
2 ); \
}
#define SET_OFFSETS_32(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 0 : \
fmt->Rshift == 8 ? 1 : \
fmt->Rshift == 16 ? 2 : \
3 ); \
og = (fmt->Gshift == 0 ? 0 : \
fmt->Gshift == 8 ? 1 : \
fmt->Gshift == 16 ? 2 : \
3 ); \
ob = (fmt->Bshift == 0 ? 0 : \
fmt->Bshift == 8 ? 1 : \
fmt->Bshift == 16 ? 2 : \
3 ); \
}
#else
#define SET_OFFSETS_24(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 2 : \
fmt->Rshift == 8 ? 1 : \
0 ); \
og = (fmt->Gshift == 0 ? 2 : \
fmt->Gshift == 8 ? 1 : \
0 ); \
ob = (fmt->Bshift == 0 ? 2 : \
fmt->Bshift == 8 ? 1 : \
0 ); \
}
#define SET_OFFSETS_32(or, og, ob, fmt) \
{ \
or = (fmt->Rshift == 0 ? 3 : \
fmt->Rshift == 8 ? 2 : \
fmt->Rshift == 16 ? 1 : \
0 ); \
og = (fmt->Gshift == 0 ? 3 : \
fmt->Gshift == 8 ? 2 : \
fmt->Gshift == 16 ? 1 : \
0 ); \
ob = (fmt->Bshift == 0 ? 3 : \
fmt->Bshift == 8 ? 2 : \
fmt->Bshift == 16 ? 1 : \
0 ); \
}
#endif
#define CREATE_PIXEL(buf, r, g, b, a, bp, ft) \
switch (bp) \
{ \
case 2: \
*((Uint16 *) (buf)) = \
((r >> ft->Rloss) << ft->Rshift) | \
((g >> ft->Gloss) << ft->Gshift) | \
((b >> ft->Bloss) << ft->Bshift) | \
((a >> ft->Aloss) << ft->Ashift); \
break; \
case 4: \
*((Uint32 *) (buf)) = \
((r >> ft->Rloss) << ft->Rshift) | \
((g >> ft->Gloss) << ft->Gshift) | \
((b >> ft->Bloss) << ft->Bshift) | \
((a >> ft->Aloss) << ft->Ashift); \
break; \
}
/* Pretty good idea from Tom Duff :-). */
#define LOOP_UNROLLED4(code, n, width) \
n = (width + 3) / 4; \
switch (width & 3) \
{ \
case 0: do { code; \
case 3: code; \
case 2: code; \
case 1: code; \
} while (--n > 0); \
}
/* Used in the srcbpp == dstbpp == 1 blend functions */
#define REPEAT_3(code) \
code; \
code; \
code;
#define REPEAT_4(code) \
code; \
code; \
code; \
code;
#define BLEND_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255); \
tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255); \
tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255);
#define BLEND_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR - sR; dR = (tmp >= 0 ? tmp : 0); \
tmp = dG - sG; dG = (tmp >= 0 ? tmp : 0); \
tmp = dB - sB; dB = (tmp >= 0 ? tmp : 0);
#define BLEND_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \
dR = (dR && sR) ? (dR * sR) >> 8 : 0; \
dG = (dG && sG) ? (dG * sG) >> 8 : 0; \
dB = (dB && sB) ? (dB * sB) >> 8 : 0;
#define BLEND_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \
if(sR < dR) { dR = sR; } \
if(sG < dG) { dG = sG; } \
if(sB < dB) { dB = sB; }
#define BLEND_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \
if(sR > dR) { dR = sR; } \
if(sG > dG) { dG = sG; } \
if(sB > dB) { dB = sB; }
#define BLEND_RGBA_ADD(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR + sR; dR = (tmp <= 255 ? tmp : 255); \
tmp = dG + sG; dG = (tmp <= 255 ? tmp : 255); \
tmp = dB + sB; dB = (tmp <= 255 ? tmp : 255); \
tmp = dA + sA; dA = (tmp <= 255 ? tmp : 255);
#define BLEND_RGBA_SUB(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
tmp = dR - sR; dR = (tmp >= 0 ? tmp : 0); \
tmp = dG - sG; dG = (tmp >= 0 ? tmp : 0); \
tmp = dB - sB; dB = (tmp >= 0 ? tmp : 0); \
tmp = dA - sA; dA = (tmp >= 0 ? tmp : 0);
#define BLEND_RGBA_MULT(sR, sG, sB, sA, dR, dG, dB, dA) \
dR = (dR && sR) ? (dR * sR) >> 8 : 0; \
dG = (dG && sG) ? (dG * sG) >> 8 : 0; \
dB = (dB && sB) ? (dB * sB) >> 8 : 0; \
dA = (dA && sA) ? (dA * sA) >> 8 : 0;
#define BLEND_RGBA_MIN(sR, sG, sB, sA, dR, dG, dB, dA) \
if(sR < dR) { dR = sR; } \
if(sG < dG) { dG = sG; } \
if(sB < dB) { dB = sB; } \
if(sA < dA) { dA = sA; }
#define BLEND_RGBA_MAX(sR, sG, sB, sA, dR, dG, dB, dA) \
if(sR > dR) { dR = sR; } \
if(sG > dG) { dG = sG; } \
if(sB > dB) { dB = sB; } \
if(sA > dA) { dA = sA; }
#if 1
/* Choose an alpha blend equation. If the sign is preserved on a right shift
* then use a specialized, faster, equation. Otherwise a more general form,
* where all additions are done before the shift, is needed.
*/
#if (-1 >> 1) < 0
#define ALPHA_BLEND_COMP(sC, dC, sA) ((((sC - dC) * sA + sC) >> 8) + dC)
#else
#define ALPHA_BLEND_COMP(sC, dC, sA) (((dC << 8) + (sC - dC) * sA + sC) >> 8)
#endif
#define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \
do { \
if (dA) \
{ \
dR = ALPHA_BLEND_COMP(sR, dR, sA); \
dG = ALPHA_BLEND_COMP(sG, dG, sA); \
dB = ALPHA_BLEND_COMP(sB, dB, sA); \
dA = sA + dA - ((sA * dA) / 255); \
} \
else \
{ \
dR = sR; \
dG = sG; \
dB = sB; \
dA = sA; \
} \
} while(0)
#define ALPHA_BLEND_PREMULTIPLIED_COMP(sC, dC, sA) (sC + dC - ((dC * sA) >> 8))
#define ALPHA_BLEND_PREMULTIPLIED(tmp, sR, sG, sB, sA, dR, dG, dB, dA) \
do { \
tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sR, dR, sA); dR = (tmp > 255 ? 255 : tmp); \
tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sG, dG, sA); dG = (tmp > 255 ? 255 : tmp); \
tmp = ALPHA_BLEND_PREMULTIPLIED_COMP(sB, dB, sA); dB = (tmp > 255 ? 255 : tmp); \
dA = sA + dA - ((sA * dA) / 255); \
} while(0)
#elif 0
#define ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB, dA) \
do { \
if(sA){ \
if(dA && sA < 255){ \
int dContrib = dA*(255 - sA)/255; \
dA = sA+dA - ((sA*dA)/255); \
dR = (dR*dContrib + sR*sA)/dA; \
dG = (dG*dContrib + sG*sA)/dA; \
dB = (dB*dContrib + sB*sA)/dA; \
}else{ \
dR = sR; \
dG = sG; \
dB = sB; \
dA = sA; \
} \
} \
} while(0)
#endif
int
surface_fill_blend (SDL_Surface *surface, SDL_Rect *rect, Uint32 color,
int blendargs);
void
surface_respect_clip_rect (SDL_Surface *surface, SDL_Rect *rect);
int
pygame_AlphaBlit (SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect, int the_args);
int
pygame_Blit (SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect, int the_args);
#endif /* SURFACE_H */

View File

@ -1 +0,0 @@
/usr/lib/python3.4/__future__.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/_bootlocale.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/_collections_abc.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/_dummy_thread.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/_weakrefset.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/abc.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/base64.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/bisect.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/codecs.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/collections

View File

@ -1 +0,0 @@
/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu

View File

@ -1 +0,0 @@
/usr/lib/python3.4/copy.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/copyreg.py

View File

@ -1,101 +0,0 @@
import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils')
if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)):
warnings.warn(
"The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
else:
__path__.insert(0, distutils_path)
real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY))
# Copy the relevant attributes
try:
__revision__ = real_distutils.__revision__
except AttributeError:
pass
__version__ = real_distutils.__version__
from distutils import dist, sysconfig
try:
basestring
except NameError:
basestring = str
## patch build_ext (distutils doesn't know how to get the libs directory
## path on windows - it hardcodes the paths around the patched sys.prefix)
if sys.platform == 'win32':
from distutils.command.build_ext import build_ext as old_build_ext
class build_ext(old_build_ext):
def finalize_options (self):
if self.library_dirs is None:
self.library_dirs = []
elif isinstance(self.library_dirs, basestring):
self.library_dirs = self.library_dirs.split(os.pathsep)
self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs"))
old_build_ext.finalize_options(self)
from distutils.command import build_ext as build_ext_module
build_ext_module.build_ext = build_ext
## distutils.dist patches:
old_find_config_files = dist.Distribution.find_config_files
def find_config_files(self):
found = old_find_config_files(self)
system_distutils = os.path.join(distutils_path, 'distutils.cfg')
#if os.path.exists(system_distutils):
# found.insert(0, system_distutils)
# What to call the per-user config file
if os.name == 'posix':
user_filename = ".pydistutils.cfg"
else:
user_filename = "pydistutils.cfg"
user_filename = os.path.join(sys.prefix, user_filename)
if os.path.isfile(user_filename):
for item in list(found):
if item.endswith('pydistutils.cfg'):
found.remove(item)
found.append(user_filename)
return found
dist.Distribution.find_config_files = find_config_files
## distutils.sysconfig patches:
old_get_python_inc = sysconfig.get_python_inc
def sysconfig_get_python_inc(plat_specific=0, prefix=None):
if prefix is None:
prefix = sys.real_prefix
return old_get_python_inc(plat_specific, prefix)
sysconfig_get_python_inc.__doc__ = old_get_python_inc.__doc__
sysconfig.get_python_inc = sysconfig_get_python_inc
old_get_python_lib = sysconfig.get_python_lib
def sysconfig_get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
if standard_lib and prefix is None:
prefix = sys.real_prefix
return old_get_python_lib(plat_specific, standard_lib, prefix)
sysconfig_get_python_lib.__doc__ = old_get_python_lib.__doc__
sysconfig.get_python_lib = sysconfig_get_python_lib
old_get_config_vars = sysconfig.get_config_vars
def sysconfig_get_config_vars(*args):
real_vars = old_get_config_vars(*args)
if sys.platform == 'win32':
lib_dir = os.path.join(sys.real_prefix, "libs")
if isinstance(real_vars, dict) and 'LIBDIR' not in real_vars:
real_vars['LIBDIR'] = lib_dir # asked for all
elif isinstance(real_vars, list) and 'LIBDIR' in args:
real_vars = real_vars + [lib_dir] # asked for list
return real_vars
sysconfig_get_config_vars.__doc__ = old_get_config_vars.__doc__
sysconfig.get_config_vars = sysconfig_get_config_vars

View File

@ -1,6 +0,0 @@
# This is a config file local to this virtualenv installation
# You may include options that will be used by all distutils commands,
# and by easy_install. For instance:
#
# [easy_install]
# find_links = http://mylocalsite

View File

@ -1 +0,0 @@
/usr/lib/python3.4/encodings

View File

@ -1 +0,0 @@
/usr/lib/python3.4/fnmatch.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/functools.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/genericpath.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/hashlib.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/heapq.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/hmac.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/imp.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/importlib

View File

@ -1 +0,0 @@
/usr/lib/python3.4/io.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/keyword.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/lib-dynload

View File

@ -1 +0,0 @@
/usr/lib/python3.4/linecache.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/locale.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/ntpath.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/operator.py

View File

@ -1 +0,0 @@
/usr

View File

@ -1 +0,0 @@
/usr/lib/python3.4/os.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/plat-x86_64-linux-gnu

View File

@ -1 +0,0 @@
/usr/lib/python3.4/posixpath.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/random.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/re.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/reprlib.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/rlcompleter.py

View File

@ -1 +0,0 @@
/usr/lib/python3.4/shutil.py

View File

@ -1,615 +0,0 @@
::
_|_|_|_| _|
_| _|_|_| _| _| _|_| _| _|_|
_|_|_| _| _| _|_| _|_|_|_| _|_|
_| _| _| _| _| _| _|
_| _|_|_| _| _| _|_|_| _|
*Faker* is a Python package that generates fake data for you. Whether
you need to bootstrap your database, create good-looking XML documents,
fill-in your persistence to stress test it, or anonymize data taken from
a production service, Faker is for you.
Faker is heavily inspired by `PHP Faker`_, `Perl Faker`_, and by `Ruby Faker`_.
----
|pypi| |unix_build| |windows_build| |coverage| |license|
----
For more details, see the `extended docs`_.
Basic Usage
-----------
Install with pip:
.. code:: bash
pip install Faker
Use ``faker.Factory.create()`` to create and initialize a faker
generator, which can generate data by accessing properties named after
the type of data you want.
.. code:: python
from faker import Factory
fake = Factory.create()
# OR
from faker import Faker
fake = Faker()
fake.name()
# 'Lucy Cechtelar'
fake.address()
# "426 Jordy Lodge
# Cartwrightshire, SC 88120-6700"
fake.text()
# Sint velit eveniet. Rerum atque repellat voluptatem quia rerum. Numquam excepturi
# beatae sint laudantium consequatur. Magni occaecati itaque sint et sit tempore. Nesciunt
# amet quidem. Iusto deleniti cum autem ad quia aperiam.
# A consectetur quos aliquam. In iste aliquid et aut similique suscipit. Consequatur qui
# quaerat iste minus hic expedita. Consequuntur error magni et laboriosam. Aut aspernatur
# voluptatem sit aliquam. Dolores voluptatum est.
# Aut molestias et maxime. Fugit autem facilis quos vero. Eius quibusdam possimus est.
# Ea quaerat et quisquam. Deleniti sunt quam. Adipisci consequatur id in occaecati.
# Et sint et. Ut ducimus quod nemo ab voluptatum.
Each call to method ``fake.name()`` yields a different (random) result.
This is because faker forwards ``faker.Generator.method_name()`` calls
to ``faker.Generator.format(method_name)``.
.. code:: python
for _ in range(0,10):
print fake.name()
# Adaline Reichel
# Dr. Santa Prosacco DVM
# Noemy Vandervort V
# Lexi O'Conner
# Gracie Weber
# Roscoe Johns
# Emmett Lebsack
# Keegan Thiel
# Wellington Koelpin II
# Ms. Karley Kiehn V
Providers
---------
Each of the generator properties (like ``name``, ``address``, and
``lorem``) are called "fake". A faker generator has many of them,
packaged in "providers".
Check the `extended docs`_ for a list of `bundled providers`_ and a list of
`community providers`_.
Localization
------------
``faker.Factory`` can take a locale as an argument, to return localized
data. If no localized provider is found, the factory falls back to the
default en\_US locale.
.. code:: python
from faker import Factory
fake = Factory.create('it_IT')
for _ in range(0,10):
print fake.name()
> Elda Palumbo
> Pacifico Giordano
> Sig. Avide Guerra
> Yago Amato
> Eustachio Messina
> Dott. Violante Lombardo
> Sig. Alighieri Monti
> Costanzo Costa
> Nazzareno Barbieri
> Max Coppola
You can check available Faker locales in the source code, under the
providers package. The localization of Faker is an ongoing process, for
which we need your help. Please don't hesitate to create a localized
provider for your own locale and submit a Pull Request (PR).
Included localized providers:
- `bg\_BG <https://faker.readthedocs.io/en/master/locales/bg_BG.html>`__ - Bulgarian
- `cs\_CZ <https://faker.readthedocs.io/en/master/locales/cs_CZ.html>`__ - Czech
- `de\_DE <https://faker.readthedocs.io/en/master/locales/de_DE.html>`__ - German
- `dk\_DK <https://faker.readthedocs.io/en/master/locales/dk_DK.html>`__ - Danish
- `el\_GR <https://faker.readthedocs.io/en/master/locales/el_GR.html>`__ - Greek
- `en\_AU <https://faker.readthedocs.io/en/master/locales/en_AU.html>`__ - English (Australia)
- `en\_CA <https://faker.readthedocs.io/en/master/locales/en_CA.html>`__ - English (Canada)
- `en\_GB <https://faker.readthedocs.io/en/master/locales/en_GB.html>`__ - English (Great Britain)
- `en\_US <https://faker.readthedocs.io/en/master/locales/en_US.html>`__ - English (United States)
- `es\_ES <https://faker.readthedocs.io/en/master/locales/es_ES.html>`__ - Spanish (Spain)
- `es\_MX <https://faker.readthedocs.io/en/master/locales/es_MX.html>`__ - Spanish (Mexico)
- `fa\_IR <https://faker.readthedocs.io/en/master/locales/fa_IR.html>`__ - Persian (Iran)
- `fi\_FI <https://faker.readthedocs.io/en/master/locales/fi_FI.html>`__ - Finnish
- `fr\_FR <https://faker.readthedocs.io/en/master/locales/fr_FR.html>`__ - French
- `hi\_IN <https://faker.readthedocs.io/en/master/locales/hi_IN.html>`__ - Hindi
- `hr\_HR <https://faker.readthedocs.io/en/master/locales/hr_HR.html>`__ - Croatian
- `it\_IT <https://faker.readthedocs.io/en/master/locales/it_IT.html>`__ - Italian
- `ja\_JP <https://faker.readthedocs.io/en/master/locales/ja_JP.html>`__ - Japanese
- `ko\_KR <https://faker.readthedocs.io/en/master/locales/ko_KR.html>`__ - Korean
- `lt\_LT <https://faker.readthedocs.io/en/master/locales/lt_LT.html>`__ - Lithuanian
- `lv\_LV <https://faker.readthedocs.io/en/master/locales/lv_LV.html>`__ - Latvian
- `ne\_NP <https://faker.readthedocs.io/en/master/locales/ne_NP.html>`__ - Nepali
- `nl\_NL <https://faker.readthedocs.io/en/master/locales/nl_NL.html>`__ - Dutch (Netherlands)
- `no\_NO <https://faker.readthedocs.io/en/master/locales/no_NO.html>`__ - Norwegian
- `pl\_PL <https://faker.readthedocs.io/en/master/locales/pl_PL.html>`__ - Polish
- `pt\_BR <https://faker.readthedocs.io/en/master/locales/pt_BR.html>`__ - Portuguese (Brazil)
- `pt\_PT <https://faker.readthedocs.io/en/master/locales/pt_PT.html>`__ - Portuguese (Portugal)
- `ru\_RU <https://faker.readthedocs.io/en/master/locales/ru_RU.html>`__ - Russian
- `sl\_SI <https://faker.readthedocs.io/en/master/locales/sl_SI.html>`__ - Slovene
- `sv\_SE <https://faker.readthedocs.io/en/master/locales/sv_SE.html>`__ - Swedish
- `tr\_TR <https://faker.readthedocs.io/en/master/locales/tr_TR.html>`__ - Turkish
- `zh\_CN <https://faker.readthedocs.io/en/master/locales/zh_CN.html>`__ - Chinese (China)
- `zh\_TW <https://faker.readthedocs.io/en/master/locales/zh_TW.html>`__ - Chinese (Taiwan)
Command line usage
------------------
When installed, you can invoke faker from the command-line:
.. code:: bash
faker [-h] [--version] [-o output]
[-l {bg_BG,cs_CZ,...,zh_CN,zh_TW}]
[-r REPEAT] [-s SEP]
[-i {module.containing.custom_provider othermodule.containing.custom_provider}]
[fake] [fake argument [fake argument ...]]
Where:
- ``faker``: is the script when installed in your environment, in
development you could use ``python -m faker`` instead
- ``-h``, ``--help``: shows a help message
- ``--version``: shows the program's version number
- ``-o FILENAME``: redirects the output to the specified filename
- ``-l {bg_BG,cs_CZ,...,zh_CN,zh_TW}``: allows use of a localized
provider
- ``-r REPEAT``: will generate a specified number of outputs
- ``-s SEP``: will generate the specified separator after each
generated output
- ``-i {my.custom_provider other.custom_provider}`` list of additional custom providers to use.
Note that is the import path of the module containing your Provider class, not the custom Provider class itself.
- ``fake``: is the name of the fake to generate an output for, such as
``name``, ``address``, or ``text``
- ``[fake argument ...]``: optional arguments to pass to the fake (e.g. the profile fake takes an optional list of comma separated field names as the first argument)
Examples:
.. code:: bash
$ faker address
968 Bahringer Garden Apt. 722
Kristinaland, NJ 09890
$ faker -l de_DE address
Samira-Niemeier-Allee 56
94812 Biedenkopf
$ faker profile ssn,birthdate
{'ssn': u'628-10-1085', 'birthdate': '2008-03-29'}
$ faker -r=3 -s=";" name
Willam Kertzmann;
Josiah Maggio;
Gayla Schmitt;
How to create a Provider
------------------------
.. code:: python
from faker import Faker
fake = Faker()
# first, import a similar Provider or use the default one
from faker.providers import BaseProvider
# create new provider class
class MyProvider(BaseProvider):
def foo(self):
return 'bar'
# then add new provider to faker instance
fake.add_provider(MyProvider)
# now you can use:
fake.foo()
> 'bar'
How to use with factory-boy
---------------------------
.. code:: python
import factory
from faker import Factory as FakerFactory
from myapp.models import Book
faker = FakerFactory.create()
class Book(factory.Factory):
FACTORY_FOR = Book
title = factory.LazyAttribute(lambda x: faker.sentence(nb_words=4))
author_name = factory.LazyAttribute(lambda x: faker.name())
Accessing the `random` instance
-------------------------------
The ``.random`` property on the generator returns the instance of ``random.Random``
used to generate the values:
.. code:: python
from faker import Faker
fake = Faker()
fake.random
fake.random.getstate()
Seeding the Generator
---------------------
When using Faker for unit testing, you will often want to generate the same
data set. For convenience, the generator also provide a ``seed()`` method, which
seeds the random number generator. Calling the same script twice with the same
seed produces the same results.
.. code:: python
from faker import Faker
fake = Faker()
fake.seed(4321)
print fake.name()
> Margaret Boehm
The code above is equivalent to the following:
.. code:: python
from faker import Faker
fake = Faker()
faker.random.seed(4321)
print fake.name()
> Margaret Boehm
Tests
-----
Installing dependencies:
.. code:: bash
$ pip install -r faker/tests/requirements.txt
Run tests:
.. code:: bash
$ python setup.py test
or
.. code:: bash
$ python -m unittest -v faker.tests
Write documentation for providers:
.. code:: bash
$ python -m faker > docs.txt
Contribute
----------
Please see `CONTRIBUTING`_.
License
-------
Faker is released under the MIT License. See the bundled `LICENSE`_ file for details.
Credits
-------
- `FZaninotto`_ / `PHP Faker`_
- `Distribute`_
- `Buildout`_
- `modern-package-template`_
.. _FZaninotto: https://github.com/fzaninotto
.. _PHP Faker: https://github.com/fzaninotto/Faker
.. _Perl Faker: http://search.cpan.org/~jasonk/Data-Faker-0.07/
.. _Ruby Faker: http://faker.rubyforge.org/
.. _Distribute: http://pypi.python.org/pypi/distribute
.. _Buildout: http://www.buildout.org/
.. _modern-package-template: http://pypi.python.org/pypi/modern-package-template
.. _extended docs: https://faker.readthedocs.io/en/latest/
.. _bundled providers: https://faker.readthedocs.io/en/latest/providers.html
.. _community providers: https://faker.readthedocs.io/en/latest/communityproviders.html
.. _LICENSE: https://github.com/joke2k/faker/blob/master/LICENSE.txt
.. _CONTRIBUTING: https://github.com/joke2k/faker/blob/master/CONTRIBUTING.rst
.. |pypi| image:: https://img.shields.io/pypi/v/fake-factory.svg?style=flat-square&label=version
:target: https://pypi.python.org/pypi/fake-factory
:alt: Latest version released on PyPi
.. |coverage| image:: https://img.shields.io/coveralls/joke2k/faker/master.svg?style=flat-square
:target: https://coveralls.io/r/joke2k/faker?branch=master
:alt: Test coverage
.. |unix_build| image:: https://img.shields.io/travis/joke2k/faker/master.svg?style=flat-square&label=unix%20build
:target: http://travis-ci.org/joke2k/faker
:alt: Build status of the master branch on Mac/Linux
.. |windows_build| image:: https://img.shields.io/appveyor/ci/joke2k/faker.svg?style=flat-square&label=windows%20build
:target: https://ci.appveyor.com/project/joke2k/faker
:alt: Build status of the master branch on Windows
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://raw.githubusercontent.com/joke2k/faker/master/LICENSE.txt
:alt: Package license
Changelog
=========
`0.6.1 - TBD <http://github.com/joke2k/faker/compare/v0.6.0...v0.6.1>`__
------------------------------------------------------------------------
* `date_time_this_century` now returns ``datetime``s outside the current decade. Thanks @JarUrb.
* Add support for localized jobs for ``hr_HR``. Thanks @mislavcimpersak.
* Adding support for Croatian ``hr_HR`` ssn (oib). Thanks @mislavcimpersak.
`0.6.0 - 09-August-2016 <http://github.com/joke2k/faker/compare/v0.5.11...v0.6.0>`__
------------------------------------------------------------------------------------
* Dropped Python 2.6 support
`0.5.11 - 09-August-2016 <http://github.com/joke2k/faker/compare/v0.5.10...v0.5.11>`__
--------------------------------------------------------------------------------------
* Add optional parameter `sex` to `profile` and `simple_profile`. Thanks @navyad.
* Fix whitespace in dk_DK provider last_names/last_name. Thanks @iAndriy.
* Fix utf8 coding issue with ``address/fi_FI`` provider. Thanks @delneg.
* ! Latest version to support Python 2.6
`0.5.10 - 01-August-2016 <http://github.com/joke2k/faker/compare/v0.5.9...v0.5.10>`__
-------------------------------------------------------------------------------------
* Fix random_sample_unique. Thanks @cecedille1.
`0.5.9 - 08-July-2016 <http://github.com/joke2k/faker/compare/v0.5.8...v0.5.9>`__
---------------------------------------------------------------------------------
* Add more ``pt_BR`` names. Thanks @cuducos.
* Added ``en_GB`` names. Thanks @jonny5532.
* Add romanized internet provider for ``zh_CN``.
* Add ``fr_CH`` providers. Thanks @gfavre.
`0.5.8 - 28-June-2016 <http://github.com/joke2k/faker/compare/v0.5.7...v0.5.8>`__
---------------------------------------------------------------------------------
* Improve CLI output and help. Thanks @cbaines.
* Update ``en_US`` anmes to be more realistic. Thanks @dethpickle.
* Modify pystr provider to accept a minimum number of characters. Thanks @tamarbuta.
* Add `job` Provider for ``zh_TW``. Thanks @weihanglo.
* Modify ``zh_TW`` phone number for a more valid format. Thanks @weihanglo.
* Reduce the maximum value of start timestamps. Thanks @cbaines.
* Add `random_sample` and `random_sample_unique`. Thanks @bengolder.
`0.5.7 - 07-March-2016 <http://github.com/joke2k/faker/compare/v0.5.6...v0.5.7>`__
----------------------------------------------------------------------------------
* Repackage to resolve PyPI issue.
`0.5.6 - 07-March-2016 <http://github.com/joke2k/faker/compare/v0.5.5...v0.5.6>`__
----------------------------------------------------------------------------------
* Add date handling for datetime functions. Thanks @rpkilby.
* Discern male and female first names in pt_BR. Thanks @gabrielusvicente.
`0.5.5 - 29-February-2016 <http://github.com/joke2k/faker/compare/v0.5.4...v0.5.5>`__
--------------------------------------------------------------------------------------
* Specify help text for command line. Thanks @cbaines.
`0.5.4 - 29-February-2016 <http://github.com/joke2k/faker/compare/v0.5.3...v0.5.4>`__
--------------------------------------------------------------------------------------
* Expose Provider's random instance. Thank @gsingers for the suggestion.
* Make sure required characters are in the password. Thanks @craig552uk.
* Add ``internet`` and ``job`` Providers for ``fa_IR``. Thanks @hamidfzm.
* Correct Poland phone numbers. Thanks @fizista.
* Fix brittly tests due to seconds elapsed in-between comparison
* Allow unicode in emails and domains. Thanks @zdelagrange for the report.
* Use ``dateutil`` for computing next_month. Thanks @mark-love, @rshk.
* Fix tests module import. Thanks @jorti for the report.
* Handle unexpected length in ``ean()``. Thanks @michaelcho.
* Add internet provider for ``ja_JP``. Thanks @massa142.
* Add Romanized Japanese person name. Thanks @massa142.
* Add tzinfo support to datetime methods. Thanks @j0hnsmith.
* Add an 'office' file extensions category. Thanks @j0hnsmith.
* Generate name according to profile's sex. Thanks @Dutcho for the report.
* Add ``bs_BA`` phone number and internet provider. Thanks @elahmo.
* Add a SSN provider for ``zh_CN``. Thanks @felixonmars.
* Differentiate male and female first names in ``fr_FR`` locale. Thanks @GregoryVds
* Add Maestro credit card. Thanks @anthonylauzon.
* Add ``hr_HR`` localization. Thanks @mislavcimpersak.
* Update ``de_DE`` first names. Thanks @WarrenFaith and @mschoebel.
* Allow generation of IPv4 and IPv6 network address with valid CIDR. Thanks @kdeldycke.
* Unittest IPv4 and IPv6 address and network generation. Thanks @kdeldycke.
* Add a new provider to generate random binary blob. Thanks @kdeldycke.
* Check that randomly produced language codes are parseable as locale by the
factory constructor. Thanks @kdeldycke.
* Fix chinese random language code. Thanks @kdeldycke.
* Remove duplicate words from Lorem provider. Thanks @jeffwidman.
`0.5.3 - 21-September-2015 <http://github.com/joke2k/faker/compare/v0.5.2...v0.5.3>`__
--------------------------------------------------------------------------------------
* Added ``company_vat`` to company ``fi_FI`` provider. Thanks @kivipe.
* Seed a Random instance instead of the module. Thanks Amy Hanlon.
* Fixed en_GB postcodes to be more realistic. Thanks @mapleoin for the report.
* Fixed support for Python 3 in the python provider. Thanks @derekjamescurtis.
* Fixed U.S. SSN generation. Thanks @jschaf.
* Use environment markers for wheels. Thanks @RonnyPfannschmidt
* Fixed Python3 issue in ``pyiterable`` and ``pystruct`` providers. Thanks @derekjamescurtis.
* Fixed ``en_GB`` postcodes to be more realistic. Thanks @mapleoin.
* Fixed and improved performance of credit card number provider. Thanks @0x000.
* Added Brazilian SSN, aka CPF. Thanks @ericchaves.
* Added female and male names for ``fa_IR``. Thanks @afshinrodgar.
* Fixed issues with Decimal objects as input to geo_coordinate. Thanks @davy.
* Fixed bug for ``center`` set to ``None`` in geo_coordinate. Thanks @davy.
* Fixed deprecated image URL placeholder services.
* Fixed provider's example formatting in documentation.
* Added en_AU provider. Thanks @xfxf.
`0.5.2 - 11-June-2015 <http://github.com/joke2k/faker/compare/v0.5.1...v0.5.2>`__
---------------------------------------------------------------------------------
* Added ``uuid4`` to ``misc`` provider. Thanks Jared Culp.
* Fixed ``jcb15`` and ``jcb16`` in ``credit_card`` provider. Thanks Rodrigo Braz.
* Fixed CVV and CID code generation in `credit_card` provider. Thanks Kevin Stone.
* Added ``--include`` flag to command line tool. Thanks Flavio Curella.
* Added ``country_code`` to `address`` provider. Thanks @elad101 and Tobin Brown.
`0.5.1 - 21-May-2015 <http://github.com/joke2k/faker/compare/v0.5...v0.5.1>`__
------------------------------------------------------------------------------
* Fixed egg installation. Thanks David R. MacIver, @kecaps
* Updated person names for ``ru_RU``. Thanks @mousebaiker.
* Updated ko_KR locale. Thanks Lee Yeonjae.
* Fixed installation to install importlib on Python 2.6. Thanks Guillaume Thomas.
* Improved tests. Thanks Aarni Koskela, @kecaps, @kaushal.
* Made Person ``prefixes``/``suffixes`` always return strings. Thanks Aarni Koskela.
* ``pl_PL`` jobs added. Thanks Dariusz Choruży.
* Added ``ja_JP`` provider. Thanks Tatsuji Tsuchiya, Masato Ohba.
* Localized remaining providers for consistency. Thanks Flavio Curella.
* List of providers in compiled on runtime and is not hardcoded anymore. Thanks Flavio Curella.
* Fixed State names in ``en_US``. Thanks Greg Meece.
* Added ``time_delta`` method to ``date_time`` provider. Thanks Tobin Brown.
* Added filename and file extension methods to ``file`` provider. Thanks Tobin Brown.
* Added Finnish ssn (HETU) provider. Thanks @kivipe.
* Fixed person names for ``pl_PL``. Thanks Marek Bleschke.
* Added ``sv_SE`` locale providers. Thanks Tome Cvitan.
* ``pt_BR`` Provider: Added ``catch_phrase`` to Company provider and fixed names in Person Provider. Thanks Marcelo Fonseca Tambalo.
* Added ``sk_SK`` localized providers. Thanks @viktormaruna.
* Removed ``miscelleneous`` provider. It is superceded by the ``misc`` provider.
`0.5.0 - 16-Feb-2015 <http://github.com/joke2k/faker/compare/v0.4.2...v0.5>`__
------------------------------------------------------------------------------
* Localized providers
* Updated ``ko_KR`` provider. Thanks Lee Yeonjae.
* Added ``pt_PT`` provider. Thanks João Delgado.
* Fixed mispellings for ``en_US`` company provider. Thanks Greg Meece.
* Added currency provider. Thanks Wiktor Ślęczka
* Ensure choice_distribution always uses floats. Thanks Katy Lavallee.
* Added ``uk_UA`` provider. Thanks Cyril Tarasenko.
* Fixed encoding issues with README, CHANGELOG and setup.py. Thanks Sven-Hendrik Haase.
* Added Turkish person names and phone number patterns. Thanks Murat Çorlu.
* Added ``ne_NP`` provider. Thanks Sudip Kafle.
* Added provider for Austrian ``de_AT``. Thanks Bernhard Essl.
`0.4.2 - 20-Aug-2014 <http://github.com/joke2k/faker/compare/v0.4.1...v0.4.2>`__
--------------------------------------------------------------------------------
* Fixed setup
`0.4.1 - 20-Aug-2014 <http://github.com/joke2k/faker/compare/v0.4...v0.4.1>`__
------------------------------------------------------------------------------
* Added MAC address provider. Thanks Sébastien Béal.
* Added ``lt_LT`` and ``lv_LV`` localized providers. Thanks Edgar Gavrik.
* Added ``nl_NL`` localized providers. Thanks @LolkeAB, @mdxs.
* Added ``bg_BG`` localized providers. Thanks Bret B.
* Added ``sl_SI``. Thanks to @janezkranjc
* Added distribution feature. Thanks to @fcurella
* Relative date time. Thanks to @soobrosa
* Fixed ``date_time_ad`` on 32bit Linux. Thanks @mdxs.
* Fixed ``domain_word`` to output slugified strings.
`0.4 - 30-Mar-2014 <http://github.com/joke2k/faker/compare/v0.3.2...v0.4>`__
----------------------------------------------------------------------------
* Modified en_US ``person.py`` to ouput female and male names. Thanks Adrian Klaver.
* Added SSN provider for ``en_US`` and ``en_CA``. Thanks Scott (@milliquet).
* Added ``hi_IN`` localized provider. Thanks Pratik Kabra.
* Refactoring of command line
0.3.2 - 11-Nov-2013
-------------------
* New provider: Credit card generator
* Improved Documentor
0.3.1
-----
* FIX setup.py
0.3 - 18-Oct-2013
-----------------
* PEP8 style conversion (old camelCased methods are deprecated!)
* New language: ``pt_BR`` (thanks to @rvnovaes)
* all localized provider now uses ``from __future__ import unicode_literals``
* documentor prints localized provider after all defaults
* FIX tests for python 2.6
0.2 - 01-Dec-2012
-----------------
* New providers: ``Python``, ``File``
* Providers imported with ``__import__``
* Module is runnable with ``python -m faker [name] [*args]``
* Rewrite fake generator system (allow autocompletation)
* New language: French
* Rewrite module ``__main__`` and new Documentor class
0.1 - 13-Nov-2012
-----------------
* First release

View File

@ -1,644 +0,0 @@
Metadata-Version: 2.0
Name: Faker
Version: 0.7.3
Summary: Faker is a Python package that generates fake data for you.
Home-page: http://github.com/joke2k/faker
Author: joke2k
Author-email: joke2k@gmail.com
License: MIT License
Keywords: faker fixtures data test mock generator
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: python-dateutil (>=2.4)
Requires-Dist: six
Requires-Dist: ipaddress; python_version=="2.7"
Requires-Dist: importlib; python_version=="3.0"
Requires-Dist: ipaddress; python_version=="3.2"
::
_|_|_|_| _|
_| _|_|_| _| _| _|_| _| _|_|
_|_|_| _| _| _|_| _|_|_|_| _|_|
_| _| _| _| _| _| _|
_| _|_|_| _| _| _|_|_| _|
*Faker* is a Python package that generates fake data for you. Whether
you need to bootstrap your database, create good-looking XML documents,
fill-in your persistence to stress test it, or anonymize data taken from
a production service, Faker is for you.
Faker is heavily inspired by `PHP Faker`_, `Perl Faker`_, and by `Ruby Faker`_.
----
|pypi| |unix_build| |windows_build| |coverage| |license|
----
For more details, see the `extended docs`_.
Basic Usage
-----------
Install with pip:
.. code:: bash
pip install Faker
Use ``faker.Factory.create()`` to create and initialize a faker
generator, which can generate data by accessing properties named after
the type of data you want.
.. code:: python
from faker import Factory
fake = Factory.create()
# OR
from faker import Faker
fake = Faker()
fake.name()
# 'Lucy Cechtelar'
fake.address()
# "426 Jordy Lodge
# Cartwrightshire, SC 88120-6700"
fake.text()
# Sint velit eveniet. Rerum atque repellat voluptatem quia rerum. Numquam excepturi
# beatae sint laudantium consequatur. Magni occaecati itaque sint et sit tempore. Nesciunt
# amet quidem. Iusto deleniti cum autem ad quia aperiam.
# A consectetur quos aliquam. In iste aliquid et aut similique suscipit. Consequatur qui
# quaerat iste minus hic expedita. Consequuntur error magni et laboriosam. Aut aspernatur
# voluptatem sit aliquam. Dolores voluptatum est.
# Aut molestias et maxime. Fugit autem facilis quos vero. Eius quibusdam possimus est.
# Ea quaerat et quisquam. Deleniti sunt quam. Adipisci consequatur id in occaecati.
# Et sint et. Ut ducimus quod nemo ab voluptatum.
Each call to method ``fake.name()`` yields a different (random) result.
This is because faker forwards ``faker.Generator.method_name()`` calls
to ``faker.Generator.format(method_name)``.
.. code:: python
for _ in range(0,10):
print fake.name()
# Adaline Reichel
# Dr. Santa Prosacco DVM
# Noemy Vandervort V
# Lexi O'Conner
# Gracie Weber
# Roscoe Johns
# Emmett Lebsack
# Keegan Thiel
# Wellington Koelpin II
# Ms. Karley Kiehn V
Providers
---------
Each of the generator properties (like ``name``, ``address``, and
``lorem``) are called "fake". A faker generator has many of them,
packaged in "providers".
Check the `extended docs`_ for a list of `bundled providers`_ and a list of
`community providers`_.
Localization
------------
``faker.Factory`` can take a locale as an argument, to return localized
data. If no localized provider is found, the factory falls back to the
default en\_US locale.
.. code:: python
from faker import Factory
fake = Factory.create('it_IT')
for _ in range(0,10):
print fake.name()
> Elda Palumbo
> Pacifico Giordano
> Sig. Avide Guerra
> Yago Amato
> Eustachio Messina
> Dott. Violante Lombardo
> Sig. Alighieri Monti
> Costanzo Costa
> Nazzareno Barbieri
> Max Coppola
You can check available Faker locales in the source code, under the
providers package. The localization of Faker is an ongoing process, for
which we need your help. Please don't hesitate to create a localized
provider for your own locale and submit a Pull Request (PR).
Included localized providers:
- `bg\_BG <https://faker.readthedocs.io/en/master/locales/bg_BG.html>`__ - Bulgarian
- `cs\_CZ <https://faker.readthedocs.io/en/master/locales/cs_CZ.html>`__ - Czech
- `de\_DE <https://faker.readthedocs.io/en/master/locales/de_DE.html>`__ - German
- `dk\_DK <https://faker.readthedocs.io/en/master/locales/dk_DK.html>`__ - Danish
- `el\_GR <https://faker.readthedocs.io/en/master/locales/el_GR.html>`__ - Greek
- `en\_AU <https://faker.readthedocs.io/en/master/locales/en_AU.html>`__ - English (Australia)
- `en\_CA <https://faker.readthedocs.io/en/master/locales/en_CA.html>`__ - English (Canada)
- `en\_GB <https://faker.readthedocs.io/en/master/locales/en_GB.html>`__ - English (Great Britain)
- `en\_US <https://faker.readthedocs.io/en/master/locales/en_US.html>`__ - English (United States)
- `es\_ES <https://faker.readthedocs.io/en/master/locales/es_ES.html>`__ - Spanish (Spain)
- `es\_MX <https://faker.readthedocs.io/en/master/locales/es_MX.html>`__ - Spanish (Mexico)
- `fa\_IR <https://faker.readthedocs.io/en/master/locales/fa_IR.html>`__ - Persian (Iran)
- `fi\_FI <https://faker.readthedocs.io/en/master/locales/fi_FI.html>`__ - Finnish
- `fr\_FR <https://faker.readthedocs.io/en/master/locales/fr_FR.html>`__ - French
- `hi\_IN <https://faker.readthedocs.io/en/master/locales/hi_IN.html>`__ - Hindi
- `hr\_HR <https://faker.readthedocs.io/en/master/locales/hr_HR.html>`__ - Croatian
- `it\_IT <https://faker.readthedocs.io/en/master/locales/it_IT.html>`__ - Italian
- `ja\_JP <https://faker.readthedocs.io/en/master/locales/ja_JP.html>`__ - Japanese
- `ko\_KR <https://faker.readthedocs.io/en/master/locales/ko_KR.html>`__ - Korean
- `lt\_LT <https://faker.readthedocs.io/en/master/locales/lt_LT.html>`__ - Lithuanian
- `lv\_LV <https://faker.readthedocs.io/en/master/locales/lv_LV.html>`__ - Latvian
- `ne\_NP <https://faker.readthedocs.io/en/master/locales/ne_NP.html>`__ - Nepali
- `nl\_NL <https://faker.readthedocs.io/en/master/locales/nl_NL.html>`__ - Dutch (Netherlands)
- `no\_NO <https://faker.readthedocs.io/en/master/locales/no_NO.html>`__ - Norwegian
- `pl\_PL <https://faker.readthedocs.io/en/master/locales/pl_PL.html>`__ - Polish
- `pt\_BR <https://faker.readthedocs.io/en/master/locales/pt_BR.html>`__ - Portuguese (Brazil)
- `pt\_PT <https://faker.readthedocs.io/en/master/locales/pt_PT.html>`__ - Portuguese (Portugal)
- `ru\_RU <https://faker.readthedocs.io/en/master/locales/ru_RU.html>`__ - Russian
- `sl\_SI <https://faker.readthedocs.io/en/master/locales/sl_SI.html>`__ - Slovene
- `sv\_SE <https://faker.readthedocs.io/en/master/locales/sv_SE.html>`__ - Swedish
- `tr\_TR <https://faker.readthedocs.io/en/master/locales/tr_TR.html>`__ - Turkish
- `zh\_CN <https://faker.readthedocs.io/en/master/locales/zh_CN.html>`__ - Chinese (China)
- `zh\_TW <https://faker.readthedocs.io/en/master/locales/zh_TW.html>`__ - Chinese (Taiwan)
Command line usage
------------------
When installed, you can invoke faker from the command-line:
.. code:: bash
faker [-h] [--version] [-o output]
[-l {bg_BG,cs_CZ,...,zh_CN,zh_TW}]
[-r REPEAT] [-s SEP]
[-i {module.containing.custom_provider othermodule.containing.custom_provider}]
[fake] [fake argument [fake argument ...]]
Where:
- ``faker``: is the script when installed in your environment, in
development you could use ``python -m faker`` instead
- ``-h``, ``--help``: shows a help message
- ``--version``: shows the program's version number
- ``-o FILENAME``: redirects the output to the specified filename
- ``-l {bg_BG,cs_CZ,...,zh_CN,zh_TW}``: allows use of a localized
provider
- ``-r REPEAT``: will generate a specified number of outputs
- ``-s SEP``: will generate the specified separator after each
generated output
- ``-i {my.custom_provider other.custom_provider}`` list of additional custom providers to use.
Note that is the import path of the module containing your Provider class, not the custom Provider class itself.
- ``fake``: is the name of the fake to generate an output for, such as
``name``, ``address``, or ``text``
- ``[fake argument ...]``: optional arguments to pass to the fake (e.g. the profile fake takes an optional list of comma separated field names as the first argument)
Examples:
.. code:: bash
$ faker address
968 Bahringer Garden Apt. 722
Kristinaland, NJ 09890
$ faker -l de_DE address
Samira-Niemeier-Allee 56
94812 Biedenkopf
$ faker profile ssn,birthdate
{'ssn': u'628-10-1085', 'birthdate': '2008-03-29'}
$ faker -r=3 -s=";" name
Willam Kertzmann;
Josiah Maggio;
Gayla Schmitt;
How to create a Provider
------------------------
.. code:: python
from faker import Faker
fake = Faker()
# first, import a similar Provider or use the default one
from faker.providers import BaseProvider
# create new provider class
class MyProvider(BaseProvider):
def foo(self):
return 'bar'
# then add new provider to faker instance
fake.add_provider(MyProvider)
# now you can use:
fake.foo()
> 'bar'
How to use with factory-boy
---------------------------
.. code:: python
import factory
from faker import Factory as FakerFactory
from myapp.models import Book
faker = FakerFactory.create()
class Book(factory.Factory):
FACTORY_FOR = Book
title = factory.LazyAttribute(lambda x: faker.sentence(nb_words=4))
author_name = factory.LazyAttribute(lambda x: faker.name())
Accessing the `random` instance
-------------------------------
The ``.random`` property on the generator returns the instance of ``random.Random``
used to generate the values:
.. code:: python
from faker import Faker
fake = Faker()
fake.random
fake.random.getstate()
Seeding the Generator
---------------------
When using Faker for unit testing, you will often want to generate the same
data set. For convenience, the generator also provide a ``seed()`` method, which
seeds the random number generator. Calling the same script twice with the same
seed produces the same results.
.. code:: python
from faker import Faker
fake = Faker()
fake.seed(4321)
print fake.name()
> Margaret Boehm
The code above is equivalent to the following:
.. code:: python
from faker import Faker
fake = Faker()
faker.random.seed(4321)
print fake.name()
> Margaret Boehm
Tests
-----
Installing dependencies:
.. code:: bash
$ pip install -r faker/tests/requirements.txt
Run tests:
.. code:: bash
$ python setup.py test
or
.. code:: bash
$ python -m unittest -v faker.tests
Write documentation for providers:
.. code:: bash
$ python -m faker > docs.txt
Contribute
----------
Please see `CONTRIBUTING`_.
License
-------
Faker is released under the MIT License. See the bundled `LICENSE`_ file for details.
Credits
-------
- `FZaninotto`_ / `PHP Faker`_
- `Distribute`_
- `Buildout`_
- `modern-package-template`_
.. _FZaninotto: https://github.com/fzaninotto
.. _PHP Faker: https://github.com/fzaninotto/Faker
.. _Perl Faker: http://search.cpan.org/~jasonk/Data-Faker-0.07/
.. _Ruby Faker: http://faker.rubyforge.org/
.. _Distribute: http://pypi.python.org/pypi/distribute
.. _Buildout: http://www.buildout.org/
.. _modern-package-template: http://pypi.python.org/pypi/modern-package-template
.. _extended docs: https://faker.readthedocs.io/en/latest/
.. _bundled providers: https://faker.readthedocs.io/en/latest/providers.html
.. _community providers: https://faker.readthedocs.io/en/latest/communityproviders.html
.. _LICENSE: https://github.com/joke2k/faker/blob/master/LICENSE.txt
.. _CONTRIBUTING: https://github.com/joke2k/faker/blob/master/CONTRIBUTING.rst
.. |pypi| image:: https://img.shields.io/pypi/v/fake-factory.svg?style=flat-square&label=version
:target: https://pypi.python.org/pypi/fake-factory
:alt: Latest version released on PyPi
.. |coverage| image:: https://img.shields.io/coveralls/joke2k/faker/master.svg?style=flat-square
:target: https://coveralls.io/r/joke2k/faker?branch=master
:alt: Test coverage
.. |unix_build| image:: https://img.shields.io/travis/joke2k/faker/master.svg?style=flat-square&label=unix%20build
:target: http://travis-ci.org/joke2k/faker
:alt: Build status of the master branch on Mac/Linux
.. |windows_build| image:: https://img.shields.io/appveyor/ci/joke2k/faker.svg?style=flat-square&label=windows%20build
:target: https://ci.appveyor.com/project/joke2k/faker
:alt: Build status of the master branch on Windows
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://raw.githubusercontent.com/joke2k/faker/master/LICENSE.txt
:alt: Package license
Changelog
=========
`0.6.1 - TBD <http://github.com/joke2k/faker/compare/v0.6.0...v0.6.1>`__
------------------------------------------------------------------------
* `date_time_this_century` now returns ``datetime``s outside the current decade. Thanks @JarUrb.
* Add support for localized jobs for ``hr_HR``. Thanks @mislavcimpersak.
* Adding support for Croatian ``hr_HR`` ssn (oib). Thanks @mislavcimpersak.
`0.6.0 - 09-August-2016 <http://github.com/joke2k/faker/compare/v0.5.11...v0.6.0>`__
------------------------------------------------------------------------------------
* Dropped Python 2.6 support
`0.5.11 - 09-August-2016 <http://github.com/joke2k/faker/compare/v0.5.10...v0.5.11>`__
--------------------------------------------------------------------------------------
* Add optional parameter `sex` to `profile` and `simple_profile`. Thanks @navyad.
* Fix whitespace in dk_DK provider last_names/last_name. Thanks @iAndriy.
* Fix utf8 coding issue with ``address/fi_FI`` provider. Thanks @delneg.
* ! Latest version to support Python 2.6
`0.5.10 - 01-August-2016 <http://github.com/joke2k/faker/compare/v0.5.9...v0.5.10>`__
-------------------------------------------------------------------------------------
* Fix random_sample_unique. Thanks @cecedille1.
`0.5.9 - 08-July-2016 <http://github.com/joke2k/faker/compare/v0.5.8...v0.5.9>`__
---------------------------------------------------------------------------------
* Add more ``pt_BR`` names. Thanks @cuducos.
* Added ``en_GB`` names. Thanks @jonny5532.
* Add romanized internet provider for ``zh_CN``.
* Add ``fr_CH`` providers. Thanks @gfavre.
`0.5.8 - 28-June-2016 <http://github.com/joke2k/faker/compare/v0.5.7...v0.5.8>`__
---------------------------------------------------------------------------------
* Improve CLI output and help. Thanks @cbaines.
* Update ``en_US`` anmes to be more realistic. Thanks @dethpickle.
* Modify pystr provider to accept a minimum number of characters. Thanks @tamarbuta.
* Add `job` Provider for ``zh_TW``. Thanks @weihanglo.
* Modify ``zh_TW`` phone number for a more valid format. Thanks @weihanglo.
* Reduce the maximum value of start timestamps. Thanks @cbaines.
* Add `random_sample` and `random_sample_unique`. Thanks @bengolder.
`0.5.7 - 07-March-2016 <http://github.com/joke2k/faker/compare/v0.5.6...v0.5.7>`__
----------------------------------------------------------------------------------
* Repackage to resolve PyPI issue.
`0.5.6 - 07-March-2016 <http://github.com/joke2k/faker/compare/v0.5.5...v0.5.6>`__
----------------------------------------------------------------------------------
* Add date handling for datetime functions. Thanks @rpkilby.
* Discern male and female first names in pt_BR. Thanks @gabrielusvicente.
`0.5.5 - 29-February-2016 <http://github.com/joke2k/faker/compare/v0.5.4...v0.5.5>`__
--------------------------------------------------------------------------------------
* Specify help text for command line. Thanks @cbaines.
`0.5.4 - 29-February-2016 <http://github.com/joke2k/faker/compare/v0.5.3...v0.5.4>`__
--------------------------------------------------------------------------------------
* Expose Provider's random instance. Thank @gsingers for the suggestion.
* Make sure required characters are in the password. Thanks @craig552uk.
* Add ``internet`` and ``job`` Providers for ``fa_IR``. Thanks @hamidfzm.
* Correct Poland phone numbers. Thanks @fizista.
* Fix brittly tests due to seconds elapsed in-between comparison
* Allow unicode in emails and domains. Thanks @zdelagrange for the report.
* Use ``dateutil`` for computing next_month. Thanks @mark-love, @rshk.
* Fix tests module import. Thanks @jorti for the report.
* Handle unexpected length in ``ean()``. Thanks @michaelcho.
* Add internet provider for ``ja_JP``. Thanks @massa142.
* Add Romanized Japanese person name. Thanks @massa142.
* Add tzinfo support to datetime methods. Thanks @j0hnsmith.
* Add an 'office' file extensions category. Thanks @j0hnsmith.
* Generate name according to profile's sex. Thanks @Dutcho for the report.
* Add ``bs_BA`` phone number and internet provider. Thanks @elahmo.
* Add a SSN provider for ``zh_CN``. Thanks @felixonmars.
* Differentiate male and female first names in ``fr_FR`` locale. Thanks @GregoryVds
* Add Maestro credit card. Thanks @anthonylauzon.
* Add ``hr_HR`` localization. Thanks @mislavcimpersak.
* Update ``de_DE`` first names. Thanks @WarrenFaith and @mschoebel.
* Allow generation of IPv4 and IPv6 network address with valid CIDR. Thanks @kdeldycke.
* Unittest IPv4 and IPv6 address and network generation. Thanks @kdeldycke.
* Add a new provider to generate random binary blob. Thanks @kdeldycke.
* Check that randomly produced language codes are parseable as locale by the
factory constructor. Thanks @kdeldycke.
* Fix chinese random language code. Thanks @kdeldycke.
* Remove duplicate words from Lorem provider. Thanks @jeffwidman.
`0.5.3 - 21-September-2015 <http://github.com/joke2k/faker/compare/v0.5.2...v0.5.3>`__
--------------------------------------------------------------------------------------
* Added ``company_vat`` to company ``fi_FI`` provider. Thanks @kivipe.
* Seed a Random instance instead of the module. Thanks Amy Hanlon.
* Fixed en_GB postcodes to be more realistic. Thanks @mapleoin for the report.
* Fixed support for Python 3 in the python provider. Thanks @derekjamescurtis.
* Fixed U.S. SSN generation. Thanks @jschaf.
* Use environment markers for wheels. Thanks @RonnyPfannschmidt
* Fixed Python3 issue in ``pyiterable`` and ``pystruct`` providers. Thanks @derekjamescurtis.
* Fixed ``en_GB`` postcodes to be more realistic. Thanks @mapleoin.
* Fixed and improved performance of credit card number provider. Thanks @0x000.
* Added Brazilian SSN, aka CPF. Thanks @ericchaves.
* Added female and male names for ``fa_IR``. Thanks @afshinrodgar.
* Fixed issues with Decimal objects as input to geo_coordinate. Thanks @davy.
* Fixed bug for ``center`` set to ``None`` in geo_coordinate. Thanks @davy.
* Fixed deprecated image URL placeholder services.
* Fixed provider's example formatting in documentation.
* Added en_AU provider. Thanks @xfxf.
`0.5.2 - 11-June-2015 <http://github.com/joke2k/faker/compare/v0.5.1...v0.5.2>`__
---------------------------------------------------------------------------------
* Added ``uuid4`` to ``misc`` provider. Thanks Jared Culp.
* Fixed ``jcb15`` and ``jcb16`` in ``credit_card`` provider. Thanks Rodrigo Braz.
* Fixed CVV and CID code generation in `credit_card` provider. Thanks Kevin Stone.
* Added ``--include`` flag to command line tool. Thanks Flavio Curella.
* Added ``country_code`` to `address`` provider. Thanks @elad101 and Tobin Brown.
`0.5.1 - 21-May-2015 <http://github.com/joke2k/faker/compare/v0.5...v0.5.1>`__
------------------------------------------------------------------------------
* Fixed egg installation. Thanks David R. MacIver, @kecaps
* Updated person names for ``ru_RU``. Thanks @mousebaiker.
* Updated ko_KR locale. Thanks Lee Yeonjae.
* Fixed installation to install importlib on Python 2.6. Thanks Guillaume Thomas.
* Improved tests. Thanks Aarni Koskela, @kecaps, @kaushal.
* Made Person ``prefixes``/``suffixes`` always return strings. Thanks Aarni Koskela.
* ``pl_PL`` jobs added. Thanks Dariusz Choruży.
* Added ``ja_JP`` provider. Thanks Tatsuji Tsuchiya, Masato Ohba.
* Localized remaining providers for consistency. Thanks Flavio Curella.
* List of providers in compiled on runtime and is not hardcoded anymore. Thanks Flavio Curella.
* Fixed State names in ``en_US``. Thanks Greg Meece.
* Added ``time_delta`` method to ``date_time`` provider. Thanks Tobin Brown.
* Added filename and file extension methods to ``file`` provider. Thanks Tobin Brown.
* Added Finnish ssn (HETU) provider. Thanks @kivipe.
* Fixed person names for ``pl_PL``. Thanks Marek Bleschke.
* Added ``sv_SE`` locale providers. Thanks Tome Cvitan.
* ``pt_BR`` Provider: Added ``catch_phrase`` to Company provider and fixed names in Person Provider. Thanks Marcelo Fonseca Tambalo.
* Added ``sk_SK`` localized providers. Thanks @viktormaruna.
* Removed ``miscelleneous`` provider. It is superceded by the ``misc`` provider.
`0.5.0 - 16-Feb-2015 <http://github.com/joke2k/faker/compare/v0.4.2...v0.5>`__
------------------------------------------------------------------------------
* Localized providers
* Updated ``ko_KR`` provider. Thanks Lee Yeonjae.
* Added ``pt_PT`` provider. Thanks João Delgado.
* Fixed mispellings for ``en_US`` company provider. Thanks Greg Meece.
* Added currency provider. Thanks Wiktor Ślęczka
* Ensure choice_distribution always uses floats. Thanks Katy Lavallee.
* Added ``uk_UA`` provider. Thanks Cyril Tarasenko.
* Fixed encoding issues with README, CHANGELOG and setup.py. Thanks Sven-Hendrik Haase.
* Added Turkish person names and phone number patterns. Thanks Murat Çorlu.
* Added ``ne_NP`` provider. Thanks Sudip Kafle.
* Added provider for Austrian ``de_AT``. Thanks Bernhard Essl.
`0.4.2 - 20-Aug-2014 <http://github.com/joke2k/faker/compare/v0.4.1...v0.4.2>`__
--------------------------------------------------------------------------------
* Fixed setup
`0.4.1 - 20-Aug-2014 <http://github.com/joke2k/faker/compare/v0.4...v0.4.1>`__
------------------------------------------------------------------------------
* Added MAC address provider. Thanks Sébastien Béal.
* Added ``lt_LT`` and ``lv_LV`` localized providers. Thanks Edgar Gavrik.
* Added ``nl_NL`` localized providers. Thanks @LolkeAB, @mdxs.
* Added ``bg_BG`` localized providers. Thanks Bret B.
* Added ``sl_SI``. Thanks to @janezkranjc
* Added distribution feature. Thanks to @fcurella
* Relative date time. Thanks to @soobrosa
* Fixed ``date_time_ad`` on 32bit Linux. Thanks @mdxs.
* Fixed ``domain_word`` to output slugified strings.
`0.4 - 30-Mar-2014 <http://github.com/joke2k/faker/compare/v0.3.2...v0.4>`__
----------------------------------------------------------------------------
* Modified en_US ``person.py`` to ouput female and male names. Thanks Adrian Klaver.
* Added SSN provider for ``en_US`` and ``en_CA``. Thanks Scott (@milliquet).
* Added ``hi_IN`` localized provider. Thanks Pratik Kabra.
* Refactoring of command line
0.3.2 - 11-Nov-2013
-------------------
* New provider: Credit card generator
* Improved Documentor
0.3.1
-----
* FIX setup.py
0.3 - 18-Oct-2013
-----------------
* PEP8 style conversion (old camelCased methods are deprecated!)
* New language: ``pt_BR`` (thanks to @rvnovaes)
* all localized provider now uses ``from __future__ import unicode_literals``
* documentor prints localized provider after all defaults
* FIX tests for python 2.6
0.2 - 01-Dec-2012
-----------------
* New providers: ``Python``, ``File``
* Providers imported with ``__import__``
* Module is runnable with ``python -m faker [name] [*args]``
* Rewrite fake generator system (allow autocompletation)
* New language: French
* Rewrite module ``__main__`` and new Documentor class
0.1 - 13-Nov-2012
-----------------
* First release

View File

@ -1,458 +0,0 @@
Faker-0.7.3.dist-info/DESCRIPTION.rst,sha256=qcmRXEhr-SNHEdfcWxWTcr9jC2Y3NAG2FknXUXF9s9E,23569
Faker-0.7.3.dist-info/METADATA,sha256=wctCZ9FxFGeG4UlpdAaGpdDfWu9o1eQwoS1813VKE4Y,24683
Faker-0.7.3.dist-info/RECORD,,
Faker-0.7.3.dist-info/WHEEL,sha256=5wvfB7GvgZAbKBSE9uX9Zbi6LCL-_KgezgHblXhCRnM,113
Faker-0.7.3.dist-info/entry_points.txt,sha256=wO9ch_qT4k3HilX8_lD5Y4fK0vsRGwSHHTbreZrXJ90,63
Faker-0.7.3.dist-info/metadata.json,sha256=0YGJ-Q1KFcFJ4L1MtxucrnDn9JW5TJHXwZl3tkR008M,1517
Faker-0.7.3.dist-info/top_level.txt,sha256=r5c8fW5_gMtLHv1Ql00Y4ifqUwZFD8NDLz9-nTKZmSk,6
Faker-0.7.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
faker/__init__.py,sha256=Xa0UjjHTB_ygUqOIZ0snl128AqPY-QxkFL5esR57vjQ,115
faker/__main__.py,sha256=zXvXu3DT2TDq5vfdGbOWXwPuqbn28eT_NVufqY8ZBtY,127
faker/build_docs.py,sha256=uj-aylWyFK1ERJ1wKx93wGhyVqIpDQ3anYcESfIZTuw,3567
faker/cli.py,sha256=ObJpGO1gfV14d7j9bwBNjI1tCbjqaUuuK3f2LRJJKvg,8290
faker/config.py,sha256=aMAJm5v7s1A87LFSIjG8_WaYSJYOSWva1Ga7GVfnCb0,362
faker/documentor.py,sha256=XzyFBGc_SR-DSIpGvPnFZdcCjX_UFxQme0yFvm2Shro,3188
faker/factory.py,sha256=wME-UwNMI6snPwyMCu9U_rwE60Xe12CRUJS11sJfDT4,2833
faker/generator.py,sha256=wTnrafsK_GM9_dQuRiGU3_vzyKn5LpzTp3Modr1XDwA,2517
faker/providers/__init__.py,sha256=DKhCQAmSUN2X6TotDupnZjaokla_8yEFlPGEd-0THg4,6330
faker/providers/address/__init__.py,sha256=4dZjPCwzGgeYjIriwfS0oEc7gRZOSgICxjWbjvtPXUk,3116
faker/providers/address/cs_CZ/__init__.py,sha256=rRm1IiTx-fNoNH8FQw2YXSFRF0bk_DViISJ8oCmRVEE,19060
faker/providers/address/de_DE/__init__.py,sha256=hICv-J4jqw2xokXpP4PW8miGJ_LQVmxAodLZ59VolEg,11385
faker/providers/address/el_GR/__init__.py,sha256=DtIuyrqtke-OVYrTU-CwBKzqh1T12esV_2v-Wdolbto,148105
faker/providers/address/en/__init__.py,sha256=UktaqfnFsllvdJhwDli5JX0IXvG1_VTF3fxS1MfQXlY,4099
faker/providers/address/en_AU/__init__.py,sha256=bz1Y-Bjer_Beuu_vfp-sDooI8T4_UgBMHd84B9Dpdjo,4689
faker/providers/address/en_CA/__init__.py,sha256=CNfLqG3KJBB7rEC9s5h7TzBRtuZWM6A-Weg6zEVSc1U,5220
faker/providers/address/en_GB/__init__.py,sha256=uvattlsfng49vbNvSv0E8Hm9OgXkDgMhEZuV_TgGmBs,5719
faker/providers/address/en_US/__init__.py,sha256=F2t1vhIiyRDmHiJdHPBCqMD7ZgCjxJqtVvtDPTzpQOE,6794
faker/providers/address/es/__init__.py,sha256=W3jzzY-JwDU6BPZHajPZ2O2BnOhSJz-s04-VsnktuhQ,3261
faker/providers/address/es_ES/__init__.py,sha256=pgb9T49rYzUdx624Rr9SPHOUMBPjQfAnJDKznKpcwAI,2082
faker/providers/address/es_MX/__init__.py,sha256=yP99m_kT1C9Xgxu4eD91LpMS5zg7DpJX8F7D3ZoDEkQ,4524
faker/providers/address/fa_IR/__init__.py,sha256=kqDXKr9Xj1SkUiUZzQ18rnMY4RxhH_Ik01XlXebctLc,6370
faker/providers/address/fi_FI/__init__.py,sha256=OBHoaxC6QlHBHF-U3tRmESD5Lx5ZyNhP-ZtgP5M6mrg,8526
faker/providers/address/fr_CH/__init__.py,sha256=W1yCwycBozNuCriDl_Ke-EEA-H-NKLoLc3niouZErZM,6830
faker/providers/address/fr_FR/__init__.py,sha256=L5rr0aaN8ccCq-Qa_adOZdoaPPjQOnOC6siOT1ybzMs,9194
faker/providers/address/hi_IN/__init__.py,sha256=dqvjVi_LRykjLzJU7hwMxsIxHnzKlNLCt5T50nX9C3s,6379
faker/providers/address/hr_HR/__init__.py,sha256=5ogaefQmPmamH6aNFbXe3T5W0vq5iq6ghAUk6BhKXh8,9453
faker/providers/address/it_IT/__init__.py,sha256=LiCRDtVJpfhF8m41C5DGdlIgB9Cy3SI6uxB5ULqIP3k,7680
faker/providers/address/ja_JP/__init__.py,sha256=Rgyu7vYuqP3f8vf7GtyyiSZzSV7qTX6VtGM1hujhBDQ,12041
faker/providers/address/ko_KR/__init__.py,sha256=MhHBGYtQM_6qAHOcR_sMa3YCmpyioGMHO0epBhe1Lek,5311
faker/providers/address/ne_NP/__init__.py,sha256=4hd-SgC9KgxoSqe8jxsdrNmzr-jQygEk-LVPP6SWvWI,17705
faker/providers/address/nl_NL/__init__.py,sha256=T7JhRfVPI00dCssVykhp3hQkxOSi2nLSbbsE-ZKVAIQ,40758
faker/providers/address/no_NO/__init__.py,sha256=yCgH5iWuSE-Iq47nRtmuytpr91Ef-RpRh888zQZuW_A,1634
faker/providers/address/pl_PL/__init__.py,sha256=tIFVosG_l4YRdPd9Y1yh-oIwYOWqx7tlvls_yA7c26A,12991
faker/providers/address/pt_BR/__init__.py,sha256=-tG7PB_0njxMZ-tdJEp5bZtkk6EMZxFb6Y44wTWKMxY,16910
faker/providers/address/pt_PT/__init__.py,sha256=FioTnAVLnoxwuTCcK0UeN3wxifPSMYxhmj2dL9h6H9w,7475
faker/providers/address/sk_SK/__init__.py,sha256=WwNJChKSMyPV22E7dSIm32FhzfyOqc4MENaZFZTBUkg,89067
faker/providers/address/sl_SI/__init__.py,sha256=gCa_HzA5v68nXzfQhmua6GEuAqmqBE43_o4KMJb3LlE,33696
faker/providers/address/sv_SE/__init__.py,sha256=RwRkQpLIi6k6scnJuIU1LNxdKqKkcTwcfTnxGm8XjY0,5870
faker/providers/address/zh_CN/__init__.py,sha256=EdzYVopsIuBid0H4Kobtj1Yybt24nVnd28oHYpVL3OA,5730
faker/providers/address/zh_TW/__init__.py,sha256=7T56HPAQZLQacisvD6YphBcSEgl_frG-DPSfLE0skvY,5959
faker/providers/barcode/__init__.py,sha256=_M-Yus6TVmarOoR29ttkQ90ElClU5sFZaNCPY-ASuqw,761
faker/providers/barcode/en_US/__init__.py,sha256=03L7Nu3CPBDfqX7aWEi5-dl-3OQYghSxtb8cr0FzOKo,87
faker/providers/color/__init__.py,sha256=LysijS_UOcc-wqmELJL46-CLbIshbu9vepAJ5d-CPm0,6038
faker/providers/color/en_US/__init__.py,sha256=ZAa2S6T2sRJkrloSqimygLpRP5HCmDGKv6YuGOi4krA,83
faker/providers/company/__init__.py,sha256=mexRPZ00hSn_xO5vDATf5afLl0lLDk1n2R9UoawyzK0,545
faker/providers/company/bg_BG/__init__.py,sha256=m_WaavvPUyb0JYzT26OspsakrWGw6RgW9iLxhypqo4U,534
faker/providers/company/cs_CZ/__init__.py,sha256=FGBt_W48-h-f7IYsx-yGZbIFrm31c-pOZEcC18wOzKM,333
faker/providers/company/de_DE/__init__.py,sha256=XwrF3SQhScW1e7CTlXoqWXT_5AnXHbZfZ6Fn9so7A_I,641
faker/providers/company/en_US/__init__.py,sha256=blRQkt2Z4CbcEFk3UoVZ2to4Gzbfy8ASghIfI8p4F90,8476
faker/providers/company/es_MX/__init__.py,sha256=6EaYWAUSy1YRlcKB9FPh3vJrQ44BgGXX6rZHUfTWhSc,8620
faker/providers/company/fa_IR/__init__.py,sha256=h4GOTGz2h7WsA5qd_nz8oS4vbuaNdSMXwT5v91FI1a4,47780
faker/providers/company/fi_FI/__init__.py,sha256=qxPPhXXuhL_o1NGAOPyXEGT0-0ugZgcu3nKVvldWT6s,1836
faker/providers/company/fr_CH/__init__.py,sha256=7Q3joVsl6hNTKtZdyz-9_RgkJo0LB2Eym0cyxORFUog,1408
faker/providers/company/fr_FR/__init__.py,sha256=_RyNiFSgtRfevMn3T90YxY8kZ1JFJfWk7zmKmFRzeEo,3749
faker/providers/company/hr_HR/__init__.py,sha256=IqEDl5mPZJq3oTl4TapFvrNxCHWrxxAZzonYgTUsjko,336
faker/providers/company/it_IT/__init__.py,sha256=xgB5xOTTsRmHSWBiQiwBhxlcw9LCF26o0u7_nra86GA,6081
faker/providers/company/ja_JP/__init__.py,sha256=KDwwxh514uYN3wcRGO614zq2W5RQN6w8JtRrvHLGLOQ,384
faker/providers/company/ko_KR/__init__.py,sha256=sDeanu-RTS5AzbwWX1xN-CLuq2oSpOUbhzPW5VyITHs,6690
faker/providers/company/no_NO/__init__.py,sha256=sgdh3Rbgi9Y90ZVH0efjvvBM1Nlch4bBWkbAO4MmxWY,539
faker/providers/company/pt_BR/__init__.py,sha256=B9Ip0PRjv_Cb-LPAnlwjHdl6wEdfFsBAI66gyTfk5Ug,2012
faker/providers/company/pt_PT/__init__.py,sha256=Eiw9G6RFDm0lVJS1-6QG8ngOkA8wZ0uhyZ3XhTlGapM,1192
faker/providers/company/sk_SK/__init__.py,sha256=bsLVoA7JzYOewNqvIIOgt-PGHztreJZ6246Hbdg21-k,343
faker/providers/company/sl_SI/__init__.py,sha256=r-WfvTDkde8AVLpOChcePG0lK3sNJFKW50TmlknlEDE,287
faker/providers/company/sv_SE/__init__.py,sha256=zhIzFX7JhzNdneFCdFgIfmrgLMGBfix7P8ASdV6ZF5E,369
faker/providers/company/zh_CN/__init__.py,sha256=eGnisTy3tFe-yAFAP1l282X-8-Z7lyFonVTyGkFovf8,1878
faker/providers/company/zh_TW/__init__.py,sha256=k3lzcL8MNhTizEobJtYrUnWsJKPLCEbpA383NTi_lOU,2520
faker/providers/credit_card/__init__.py,sha256=lzfQwmLJaZtu6tijuiBxMgzzzxF7ObX6HYboLyllW4I,5026
faker/providers/credit_card/en_US/__init__.py,sha256=PEBug2VJ1cR6tMTnOGq32rPoE33ABkQQFYYTV7uhvMk,93
faker/providers/currency/__init__.py,sha256=uxETFz1PfXY1prvM6LsRgJeY32nHfNRYk-gaMXD1LHw,2641
faker/providers/currency/en_US/__init__.py,sha256=JMSBZNDpKCSgVCrMECszx1wyMJdkAVXv9WRN-ObozNA,89
faker/providers/date_time/__init__.py,sha256=_Kg0b6wbTmneoCthdufBTVVe4unOr3cLUpnshr6lG_c,37932
faker/providers/date_time/en_US/__init__.py,sha256=NGaWjgCkr-Ae3_DkERfa4tWtJipCiySJXcyE3nBfBcg,89
faker/providers/file/__init__.py,sha256=hATjpbK3QXkzhUrL_pkVnafx-uNxiRnr8Vq05T1VZWQ,10042
faker/providers/file/en_US/__init__.py,sha256=UYkUQfPQkwJR5RBve6PBNFkXmvVgIIcW7cefOXShkSs,81
faker/providers/internet/__init__.py,sha256=ibV94kwcC12tGdZyuD61Ii1vAeKGBjH8j32I4MZ37Ms,5313
faker/providers/internet/bg_BG/__init__.py,sha256=mcmvkBErph-_iUeaSKgukowaWL1SMkOnqtOIr6uRb4I,1943
faker/providers/internet/bs_BA/__init__.py,sha256=Yg3EZVDX-bvstLMI2wOLRkE_Igf4mBDO29QT3x485h0,548
faker/providers/internet/cs_CZ/__init__.py,sha256=LOY8k5fMuY3uMx1oHjhbbLpO74XXhFt6KnB-5Bu6vL8,811
faker/providers/internet/de_AT/__init__.py,sha256=PF9iejKow-OQXCbbAOqJ8AZyLc8cuZqbKBx-9K3PP7Y,434
faker/providers/internet/de_DE/__init__.py,sha256=Q-4dFxALs5rUvsKQkLomH5PaltaGI_D2zliArO4lrqg,497
faker/providers/internet/el_GR/__init__.py,sha256=TZYMoV8rRWcZjeozWL1TaHYtuGHk-1sRUCcxuiiFYBQ,2593
faker/providers/internet/en_AU/__init__.py,sha256=-fPF0yXJlVTBv76c4lM4JukHygkLbh5Mjx3ZrNd4j4M,348
faker/providers/internet/en_US/__init__.py,sha256=JkaeOqg0VaAY10lzVnvhyrRtW8lpFYQJlbD0xSNeqg8,143
faker/providers/internet/fa_IR/__init__.py,sha256=K_aAkvGqCEx-c_iza_xCKkzsqFI47c1Tm3LwqF0yENI,345
faker/providers/internet/fi_FI/__init__.py,sha256=LtEu4L6pW9TTxh6NiQZnkcOZYrb7rvw_oRKRbcCINcw,352
faker/providers/internet/fr_CH/__init__.py,sha256=FR1URpLzVTfkeMmaa8Myzb6u7BYelYN01uxrMjS2CwU,700
faker/providers/internet/fr_FR/__init__.py,sha256=GOZp4AGSyEC4b0E98cLnLle4K4Ri2kT1v4Xr0V6YvrM,781
faker/providers/internet/hr_HR/__init__.py,sha256=NDZIRP1fHYhl8NTz8-aT19TVpn7fT2ZVLTiyIegRZrY,608
faker/providers/internet/ja_JP/__init__.py,sha256=hrXzZU1Y8uU3SP5IlPeTSIchV4x4_6itD1B1ip5memA,570
faker/providers/internet/ko_KR/__init__.py,sha256=aSDf0eK70c-upKk61RyxtwDmH_f5czLmzowmBJQD2IU,351
faker/providers/internet/no_NO/__init__.py,sha256=c0oj9VNhodADS7GLntpoJWGVDyhC1KeFBFIzaVZa3kU,468
faker/providers/internet/pt_BR/__init__.py,sha256=eF1VQJ2UMeKFDd88XLoB53HbUdfng7oy0CoZTqM5cYo,360
faker/providers/internet/pt_PT/__init__.py,sha256=9az9PplqDyJ83aaZ4BUdaWPOM64_hyLiwdgTPMRbAuw,325
faker/providers/internet/sk_SK/__init__.py,sha256=Xj5EDwE_1lg6elROoaZ7tVHpgBQTpdrq4eSB4XkSvlE,847
faker/providers/internet/sl_SI/__init__.py,sha256=nJsd2t6a2I8loThDkI6ajEdEloscEsc_zc_Pz6IaZbw,1037
faker/providers/internet/sv_SE/__init__.py,sha256=WF_ltU7iaDltgx_n1s5hF_a94W0-BKVfqJVR1CHfHBQ,474
faker/providers/internet/zh_CN/__init__.py,sha256=cCJhSYPEi3i9ESQLkGKbJLPPrQggQorE1EbP1qvC0w8,570
faker/providers/job/__init__.py,sha256=ZOwjPge1tJVFhv-n16ozTYD797syE1Tr7boQLinRyro,20711
faker/providers/job/en_US/__init__.py,sha256=ezR0GcDrcQClOYJa3kSg56L60wmm5UeBzU92e-aCnig,81
faker/providers/job/fa_IR/__init__.py,sha256=f0VBhZO-IpES6raBFwV_57pzmAfeyGT-UWqxJ6rjyKw,2496
faker/providers/job/fr_CH/__init__.py,sha256=-NJ7XQRb2Bd2AyEj8cS2d4XnEmBqknBZPC1tJDy2DQU,37303
faker/providers/job/fr_FR/__init__.py,sha256=f8Y55bjLb4sP0AioqTttGaiFFeIJTLTt3Oc0AOVbc2A,17756
faker/providers/job/hr_HR/__init__.py,sha256=KrNjp5uGv7BFiFzgZYZIkENTDh_Usn-2Bqh-QEDcRZg,10463
faker/providers/job/pl_PL/__init__.py,sha256=tcPxd58koUTU83MZ1UGfmb1iWy-7f0VHmq0FKjOhe2E,5593
faker/providers/job/ru_RU/__init__.py,sha256=y0vDX_AEsjcTLZF2_1WonN0Up7BYupTU_hZxlwM4mQg,13863
faker/providers/job/uk_UA/__init__.py,sha256=EzsJo7jj8soDxT4OogoPYoUR8WsjCHyNSnEDGGUGZCU,4166
faker/providers/job/zh_TW/__init__.py,sha256=UuefcxyMGWcACb8dzRtKKNujfbol5f-GiljrMX3iVlE,14394
faker/providers/lorem/__init__.py,sha256=TeX3-VVPOguio74j7otPJV0dq47CK46TSwcCfzVOzH8,4530
faker/providers/lorem/el_GR/__init__.py,sha256=OKnA54cW7tshilMIkkDLsPwydxBTGa1V9-LKd2tUEbk,7483
faker/providers/lorem/la/__init__.py,sha256=ruzWU5AJ2pT4O9P_zyG_Hv4DwnHBmolG4IPZiGuf1eo,2274
faker/providers/lorem/ru_RU/__init__.py,sha256=8SvUpwmmFR6k_R416dEGaPHsRK8hECiXkpNOPao7mC4,4473
faker/providers/misc/__init__.py,sha256=k9NSmdWKiki8gfn3G85JhM-osngUsDY7wqX6A2Hcz_Q,4026
faker/providers/misc/en_US/__init__.py,sha256=ZE5bQjYE6QH86j2R4Hj_Hd_FmchvGPTKnn9vlUYnd_I,81
faker/providers/person/__init__.py,sha256=Z2M5PaYZvI_L6yH_hCQoPS-gde6hQyWUpBASVWGSGMo,3203
faker/providers/person/bg_BG/__init__.py,sha256=1kv738cE5pXzAkdXk8pRAQiDoGPkyzMXaHK3PlbfHEk,30839
faker/providers/person/cs_CZ/__init__.py,sha256=nh3cWL8DpOBybzNHvWwxAtdS1YRKemtVz2KEFYMw0hI,5141
faker/providers/person/de_AT/__init__.py,sha256=JJ8UwHgqOrKbbYfitQsEAoQs6_Lea-m4BgX-cpl_UoQ,2417
faker/providers/person/de_DE/__init__.py,sha256=X2Un8uLu7vdFoHeE95dZzEGvKgEk9c55E5DRNTurqnE,30289
faker/providers/person/dk_DK/__init__.py,sha256=T4JOBNiLFr5GqSbAOqzXVxtpLwaN4kSRALmhkazfvdk,7622
faker/providers/person/el_GR/__init__.py,sha256=BUZ-tbSTAvlKG5n12EnlfoTdx94loVKx-RKZvGs6AvA,51364
faker/providers/person/en/__init__.py,sha256=31LH-_kcjrq-vrYXaX466eJNztW8GYTm19H267XgLoM,86750
faker/providers/person/en_GB/__init__.py,sha256=FSgXgU0DwoGs3hNNfpWyX2pAS8xbws_IkIbsx6laQ6Y,18349
faker/providers/person/en_US/__init__.py,sha256=mEeVs0fzsd8H5k-DM1yD3azz2kQGXobDCoUQwmlA7RI,58231
faker/providers/person/es_ES/__init__.py,sha256=9bgQIZLbeeVF1FHaRtf168OmTXa4vmOhtj6efu1G87Y,16564
faker/providers/person/es_MX/__init__.py,sha256=7s9HmkaUSWf4Tom_gpsUMvVg_6IUqJYZVhZpdAL54g4,11307
faker/providers/person/fa_IR/__init__.py,sha256=GHguBi-1w4Olp5cfRPuXpZ3STbBwnGvErFodP7Sj9_0,4915
faker/providers/person/fi_FI/__init__.py,sha256=3GcuGbW69NY8Zre0jg0CHww_ZXWwAXnrOs0K_3r2pmE,14403
faker/providers/person/fr_CH/__init__.py,sha256=AWMVtPxJTXqpTKPskNMewXCDBkZP1y8V9Trw9IgonNM,4972
faker/providers/person/fr_FR/__init__.py,sha256=pQMejcmRPYkjYcqtMkqzdY20weCroP-4JiROYoLsO94,8581
faker/providers/person/hi_IN/__init__.py,sha256=pBDDPdjdmyHRDXS5Gi6N_B54R5dQUbv0Qm5--HD5-d8,3626
faker/providers/person/hr_HR/__init__.py,sha256=V4U5URIZzxzSoV1bKHoObpyLPqVlUDUMOlBiAbEbzWM,13009
faker/providers/person/it_IT/__init__.py,sha256=iSQrLF_-MggtmF4fieYGQw-XkYjBFrZRkiM4q1pfYkQ,6119
faker/providers/person/ja_JP/__init__.py,sha256=xivp1JDKu6rrel4BT1E4wtWGq5xZbZaFAS-bj6QfusY,6626
faker/providers/person/ko_KR/__init__.py,sha256=tPpqhJeLGDp1jvagpuqmq7xIf-qLc0hX7H6onZ-O67s,2321
faker/providers/person/lt_LT/__init__.py,sha256=0JOghTjOzirAfbmFe3IHr1-58_BVDRDoukjRTXnlJU8,3334
faker/providers/person/lv_LV/__init__.py,sha256=T6erN95nqT9x1e2yKBTAf7ynHrYiE-rCE3MmncodJYM,4359
faker/providers/person/ne_NP/__init__.py,sha256=xFV0GGlMK4I8PCe4f4_8GJg00Y3BiuM5vJaw5gNH0QQ,33739
faker/providers/person/nl_NL/__init__.py,sha256=EVcNg41uFvuDwtykWUaO9flkCVXcQyX8oPsRS_dzhQk,22069
faker/providers/person/no_NO/__init__.py,sha256=AGvnpSFOPUYR48IZ9nGCq_l_zaDwQJJ9Lr_TVcFXIuw,7122
faker/providers/person/pl_PL/__init__.py,sha256=rrzuRDgyor-b5-pS5tBHdGrryoC79fTxsetkEg9oLNI,49115
faker/providers/person/pt_BR/__init__.py,sha256=qRWmm7KnaNcq70oVOJGAYsDne9CxxG8RB85zrr8pH18,5457
faker/providers/person/pt_PT/__init__.py,sha256=7Met7lWvVtJSc1rOfCpQM8tjTXtxguYk1FOjnZzLhIY,4154
faker/providers/person/ru_RU/__init__.py,sha256=L9zX52H1ByQhqt41CGGt7iabQAokjMz-rZyDTyA2tJA,19087
faker/providers/person/sl_SI/__init__.py,sha256=4aciseU5Kv9vTmlcjnmEKle8jjwcfJ6nFxPWYpCfOdM,6169
faker/providers/person/sv_SE/__init__.py,sha256=i2XTvp2_-etlDS8mtWjHKm2bIGVp29sf1jstJVxRx9U,11114
faker/providers/person/tr_TR/__init__.py,sha256=JzYTBEYmuRHUgzj8KtzLLIegONnE2c5tj96Me4T2p78,20243
faker/providers/person/uk_UA/__init__.py,sha256=nulWXhNie-Uj0vtnZZOs3ub935Pzfz2e2v7ppqPLgjQ,14885
faker/providers/person/zh_CN/__init__.py,sha256=HN_R_VNrWO_dnBQKW202Lu0phaT4jQPeca3pUw85Enc,7411
faker/providers/person/zh_TW/__init__.py,sha256=4yElAb9PUQ0fszlsOPNg5T0v5T_UA18AI6gEB7vWeIs,5132
faker/providers/phone_number/__init__.py,sha256=mpfuSvuU95t6g1xRupcZlOpwMneu3xgI3MukGie38WM,215
faker/providers/phone_number/bg_BG/__init__.py,sha256=DAQ9Z_hzo1TakjFYD6pur9R99iVkonAFM4hp07igUhw,453
faker/providers/phone_number/bs_BA/__init__.py,sha256=FOJVvEgxnvhoOYu06GMIeCw_OeiZcx2hc6DUmea8Txo,918
faker/providers/phone_number/cs_CZ/__init__.py,sha256=hHeMor0rRMqCIwtfto1Y3CX3vDhC0DCvuPU2eEKmM7A,953
faker/providers/phone_number/de_DE/__init__.py,sha256=9BXXTXdPVP9xZwEYTovF-Qd5WKKg8lIQ-Ud9MrJtOnI,451
faker/providers/phone_number/dk_DK/__init__.py,sha256=21dn76wjJIwFBnjFiJPpN_RapldZ28q32JxohUQufCo,450
faker/providers/phone_number/el_GR/__init__.py,sha256=znQhhOq1gx7uEooVojTc4b8E2Lhnza-Xc9jMQZlTRFw,567
faker/providers/phone_number/en_AU/__init__.py,sha256=Vuum4_iPaQfm0_hoMm6aSi8aAYDMDM_csQwrqcOigxU,1394
faker/providers/phone_number/en_CA/__init__.py,sha256=ZYUr1Pr1ufZyPv1rK4YhS2Qpo5Wcbc18hshVtK6bmaY,388
faker/providers/phone_number/en_GB/__init__.py,sha256=riLsCVHUJ-r6RBbOkBlrZxKwXHZ_RpFRnpTBArHn5QI,403
faker/providers/phone_number/en_US/__init__.py,sha256=ZXzsUN4Q1CMQLvpd-978vSWJ42HNV2Vt6gFuLr1kRIw,804
faker/providers/phone_number/es_ES/__init__.py,sha256=w1imLT3-SAD-_6Ufpk4wxHM11Ft2j7YBTKeNhC6frMU,304
faker/providers/phone_number/es_MX/__init__.py,sha256=ZXzsUN4Q1CMQLvpd-978vSWJ42HNV2Vt6gFuLr1kRIw,804
faker/providers/phone_number/fa_IR/__init__.py,sha256=YnXQZMmCNAbacff0SNwOzOaKEOYXSuwf_YQPAz4kroE,610
faker/providers/phone_number/fi_FI/__init__.py,sha256=OeOes_aRFnLxX7UgtBJPJQQhnurxJ0nw7apiYTtBQy4,299
faker/providers/phone_number/fr_CH/__init__.py,sha256=X54vOP6excQLdpUcXPP8KgDd_WFaPTXBWXu-nNNPbaU,1025
faker/providers/phone_number/fr_FR/__init__.py,sha256=jiP75LGHShJVGSxmMmnY5Er1ii6alUVfCmqAN5-cKOM,1019
faker/providers/phone_number/hi_IN/__init__.py,sha256=cpRdSsxRGH_CnLYK3wMEe1BjlKVAiTfczfsRy4poRRg,272
faker/providers/phone_number/hr_HR/__init__.py,sha256=PFoKwLcI0g3HqS6pveIogWyllRSTSSxdpXmFmX0LUVo,843
faker/providers/phone_number/it_IT/__init__.py,sha256=ZMSUxUseljmy62lgGU27kHk7z8BESK7rsaip_2_UUTc,341
faker/providers/phone_number/ja_JP/__init__.py,sha256=2StG6QtUb50zqqUX1AX5mKNtDoYtFe9PioRvH0l-fH4,271
faker/providers/phone_number/ko_KR/__init__.py,sha256=9dPTiXuTrMGZYeItcqUVCxcYV-L2I42jiz-J31PXSHw,739
faker/providers/phone_number/lt_LT/__init__.py,sha256=CPRoMe1pbWHKczxAp9oDVln1y_XujGpNrtD4D-5dXUA,223
faker/providers/phone_number/lv_LV/__init__.py,sha256=7mdRAVXF-tAgU2pStRmw4XAw85M6tS4kmkmc3jCnSRA,223
faker/providers/phone_number/ne_NP/__init__.py,sha256=n5Fu6CyD5MAy9C9RGg6_0Z6jlwflHnk7z3VSGrSDTy8,269
faker/providers/phone_number/nl_NL/__init__.py,sha256=hWSZ3ZRk7u-okKuKA6xxDo_FQLU-_KB4fXomeWRJchI,568
faker/providers/phone_number/no_NO/__init__.py,sha256=i4Se2VXXf3jcD9Fk5xzK3kldj4JfweWDO2C0uh3Aauo,369
faker/providers/phone_number/pl_PL/__init__.py,sha256=7tEKRcPE0m720_jXL2LTpsSsfl0bKe1Hx5mZ0TKs0cI,937
faker/providers/phone_number/pt_BR/__init__.py,sha256=h1lEX2pEATx11MMTB9fDb8DCPdkOTwrhE6eA4TvGf2Q,1945
faker/providers/phone_number/pt_PT/__init__.py,sha256=p7gsR2rsUVCRFQRBZgN_eNI7hUw0mBLdEvUTRfuR5fY,1053
faker/providers/phone_number/ru_RU/__init__.py,sha256=qeBCG61HQfAnq2R0SEoEW0WriQvu90CfVFA0TqDU8v8,261
faker/providers/phone_number/sk_SK/__init__.py,sha256=WyODzRrYUFITOmm8YTC2vUpCFVhWBHkwnrCZXKvI_hA,426
faker/providers/phone_number/sl_SI/__init__.py,sha256=WI70ct6rNdYYdqPDkFrh3XKQIv96EanZSG1aUpMcWtU,401
faker/providers/phone_number/sv_SE/__init__.py,sha256=X20t-n9G2teOD3VWh-ISv_NYN8Bt9aIouF2mdg6k35U,423
faker/providers/phone_number/tr_TR/__init__.py,sha256=F4kSG7Zr9fBQ5tE1C9Pq0BlHreO60w8hOEfCsdAWzZE,387
faker/providers/phone_number/uk_UA/__init__.py,sha256=2dC9JydqURXvw8hjwkPf7nO9hCQ6JnWOvTCKL40BcP8,373
faker/providers/phone_number/zh_CN/__init__.py,sha256=x1AZXompZ0W6WRBb1TQgdodDJCdU3Q200a8Tkz9XzKw,589
faker/providers/phone_number/zh_TW/__init__.py,sha256=j3at6y_owhURPBLPUNeiC9t-UEOD3gs0jPBZ9glrAaE,438
faker/providers/profile/__init__.py,sha256=YL0_2ABtj7oe07FsxyonT4AcT71-Ad_gbwrk4T1VEXs,1830
faker/providers/profile/en_US/__init__.py,sha256=YJPzyqSOsrDsGiT6lDSr2PaQik3d3-1Ykp49ewu7Zb4,87
faker/providers/python/__init__.py,sha256=mLdjCxyiGjEHSLPgra1fXHpcG0PlvjQti12W6p0CmiI,5274
faker/providers/python/en_US/__init__.py,sha256=lyer68-Cv7hcwAoKFf86KWzPAbyE3QGLajRzRXsbHnk,85
faker/providers/ssn/__init__.py,sha256=f7gxZf2dPg2x13xqwNowTiEGMbr-VFFPtPeSEpm6kHE,268
faker/providers/ssn/en_CA/__init__.py,sha256=X6FliqH4o_Rsnw4iX5k9g68EQsupqBh6Wf-yQvLu8H8,1427
faker/providers/ssn/en_US/__init__.py,sha256=hqRPbDjizMd72TziWA_FbW3tJM8NcQQb5Ba7ShkrK0Q,663
faker/providers/ssn/fi_FI/__init__.py,sha256=k9isbTQqsG73Z0rgv3qHtge3B3up8pEapvlm29lii7s,1817
faker/providers/ssn/fr_CH/__init__.py,sha256=f69RNeRWQCNlkm21HnKzawX9gMKdiv86l6MxJcgJ3EQ,1160
faker/providers/ssn/hr_HR/__init__.py,sha256=9v-G2WI0ec-yCkQ9gQf-b7Xy1-A7YEZNeWWbQ_W4UtM,1231
faker/providers/ssn/it_IT/__init__.py,sha256=v8oeS0asXUS-kdOh3c3kmMQCM7XpvAv_dc0Wr-DyHSY,1171
faker/providers/ssn/ko_KR/__init__.py,sha256=evRqGTdbL-Qie7PppOXg5ongOaK1ndjz9kteg_Rv_o8,371
faker/providers/ssn/nl_NL/__init__.py,sha256=WXyg-nCoSGHFLPrCxHLqrSefQCZlbn24Mgqhbjg-nSU,1438
faker/providers/ssn/pt_BR/__init__.py,sha256=_O8i3JMhZpkULgDJdHYflPM1ELgqctoFqmvSVPy4Raw,1041
faker/providers/ssn/sv_SE/__init__.py,sha256=5B5auIimOw51OoxWn_5LsOBQYL-fTee3t_eN91DsO3Q,1578
faker/providers/ssn/uk_UA/__init__.py,sha256=JAt7N5Kerdc9LIdEGWdx0SQMdGw_9fBXuD_R8jz4pZA,520
faker/providers/ssn/zh_CN/__init__.py,sha256=F9O8BsT1fdmRGryjKtQ-0IeXeqayOukki05d0N13yl8,42201
faker/providers/ssn/zh_TW/__init__.py,sha256=NnK14RduF2uA-ssPKPPpBo27bVBJAdoKWu68bN2at8M,267
faker/providers/user_agent/__init__.py,sha256=2TWrKJe-GDZLozMvubkaCsleo3MSjobR5kANqlO0u54,6783
faker/providers/user_agent/en_US/__init__.py,sha256=-YuaCsO4rg_jih7K1DlcTfUUfk2WWxCan53toKHSe6M,91
faker/tests/__init__.py,sha256=aQvJ-HIQz5YnkVDIeWu84cQr8Ad2IqX-KS7TBPxxBDQ,23322
faker/tests/en_GB/__init__.py,sha256=uXYJJjJNaitO8h99l4tVN5MQP8J0Gw5qV6mmiQURmh0,487
faker/tests/hr_HR/__init__.py,sha256=uWCqU24d2G-y6GznBwkYH-u7xby5yBhcIbokhGvOrbk,883
faker/tests/ja_JP/__init__.py,sha256=SXJwMEH6ESexT1QRHPt5k6BEoB0FJoYFTbfrdZ5vE4M,5884
faker/tests/mymodule/__init__.py,sha256=rQ5ZwFgZXjZtZdnDD1UVzeiHIcSpXEiXYBbU84QuOlA,17
faker/tests/mymodule/en_US/__init__.py,sha256=QcpKWwbf4EbSskN1VeF3NCJmUtobLP9Qiik6RkLpvag,153
faker/tests/ne_np/__init__.py,sha256=kohb6y-1mifLHm1ewzE6T5Qh4B_8C3qjIheJjkgWPKc,1387
faker/tests/pt_BR/__init__.py,sha256=z0oCoFk1FIP7GXdD92AlOoX6-EKWErp8T1-_XkiCAh0,746
faker/tests/zh_CN/__init__.py,sha256=JCvB5QcW3NRWdo90Sv9QkHNOAomxCkAcu0tKdJzHeMA,390
faker/utils/__init__.py,sha256=MA5BiS4oFfml22odj7JGrTq1F4LYc06677kxyMUwjYM,228
faker/utils/datasets.py,sha256=PpGsjyClhdI_6_vnPG0zuoXXbUM43DDOXNyoVnLl59A,493
faker/utils/datetime_safe.py,sha256=V4ZoOKJAHjIObqrhMknN6Hc7xtAxQPJtkEKv5eIqVh8,2881
faker/utils/decorators.py,sha256=QgIlzH0zkiyMrnGgZOHbRuIUEfMSEFQV5joLFj39bW8,534
faker/utils/distribution.py,sha256=tHB7syGc_16G8iSlk5FGgdKWonY53BQfDq2tOE0UHzE,479
faker/utils/loading.py,sha256=CjvQDZShhufI8wWlmp5nBi-EjspCEQdgtLQWNJHHaWc,1013
faker/utils/text.py,sha256=rLwQPZuz1_QtxlA4Z1Ub_YhoYjGNTpX6CbtcXyGL1HM,3127
../../../bin/faker,sha256=geNNkSukcsWC0f6RSW5S_M3Upaa2nsmGbif0Q6LAGrQ,291
Faker-0.7.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
faker/providers/ssn/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/uk_UA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/ja_JP/__pycache__/__init__.cpython-34.pyc,,
faker/tests/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/lv_LV/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/text.cpython-34.pyc,,
faker/providers/internet/de_DE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/credit_card/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/zh_TW/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/fi_FI/__pycache__/__init__.cpython-34.pyc,,
faker/tests/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/ja_JP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/hi_IN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/hi_IN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/en_GB/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/tr_TR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/fr_FR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/es_ES/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/bg_BG/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/lt_LT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/en_GB/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/cs_CZ/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/de_DE/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/factory.cpython-34.pyc,,
faker/providers/phone_number/en_CA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/nl_NL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/python/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/distribution.cpython-34.pyc,,
faker/providers/company/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/ja_JP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/profile/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/es_MX/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/dk_DK/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/zh_TW/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/no_NO/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/dk_DK/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/no_NO/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/sl_SI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/ne_NP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/profile/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/ja_JP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/cs_CZ/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/ko_KR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/fr_FR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/ko_KR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/es_ES/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/el_GR/__pycache__/__init__.cpython-34.pyc,,
faker/tests/ne_np/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/decorators.cpython-34.pyc,,
faker/tests/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/lorem/ru_RU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/zh_TW/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/uk_UA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/sk_SK/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/fa_IR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/en/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/pt_PT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/sv_SE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/ko_KR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/es/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/cs_CZ/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/el_GR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/no_NO/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/en_AU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/pl_PL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/pt_PT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/ko_KR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/fa_IR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/it_IT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/fa_IR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/tr_TR/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/cli.cpython-34.pyc,,
faker/providers/internet/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/user_agent/__pycache__/__init__.cpython-34.pyc,,
faker/tests/mymodule/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/color/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/sv_SE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/sl_SI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/fi_FI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/pl_PL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/ne_NP/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/datetime_safe.cpython-34.pyc,,
faker/providers/ssn/sv_SE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/sv_SE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/it_IT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/de_AT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/it_IT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/fi_FI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/no_NO/__pycache__/__init__.cpython-34.pyc,,
faker/providers/lorem/el_GR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/__pycache__/__init__.cpython-34.pyc,,
faker/providers/credit_card/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/ko_KR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/nl_NL/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/documentor.cpython-34.pyc,,
faker/providers/company/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/fi_FI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/ru_RU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/el_GR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/pt_PT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/pt_PT/__pycache__/__init__.cpython-34.pyc,,
faker/tests/en_GB/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/config.cpython-34.pyc,,
faker/providers/ssn/uk_UA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/it_IT/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/generator.cpython-34.pyc,,
faker/providers/company/fa_IR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/fa_IR/__pycache__/__init__.cpython-34.pyc,,
faker/tests/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/es_MX/__pycache__/__init__.cpython-34.pyc,,
faker/tests/ja_JP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/sl_SI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/sk_SK/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/fi_FI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/currency/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/fr_FR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/de_DE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/de_DE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/date_time/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/es_MX/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/en_GB/__pycache__/__init__.cpython-34.pyc,,
faker/providers/__pycache__/__init__.cpython-34.pyc,,
faker/providers/lorem/la/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/fa_IR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/el_GR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/lt_LT/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/__main__.cpython-34.pyc,,
faker/providers/company/__pycache__/__init__.cpython-34.pyc,,
faker/tests/mymodule/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/fr_CH/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/bg_BG/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/ne_NP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/bs_BA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/pt_BR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/nl_NL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/sv_SE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/zh_TW/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/cs_CZ/__pycache__/__init__.cpython-34.pyc,,
faker/providers/barcode/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/es_MX/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/fr_FR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/cs_CZ/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/ru_RU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/python/__pycache__/__init__.cpython-34.pyc,,
faker/providers/lorem/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/bg_BG/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/de_AT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/pl_PL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/barcode/__pycache__/__init__.cpython-34.pyc,,
faker/providers/color/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/loading.cpython-34.pyc,,
faker/providers/internet/bs_BA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/sk_SK/__pycache__/__init__.cpython-34.pyc,,
faker/providers/file/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/fr_FR/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/no_NO/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/es_ES/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/sv_SE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/currency/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/ko_KR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/en_CA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/en_AU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/en/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/uk_UA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/en_AU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/nl_NL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/file/__pycache__/__init__.cpython-34.pyc,,
faker/providers/internet/sk_SK/__pycache__/__init__.cpython-34.pyc,,
faker/providers/user_agent/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/date_time/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/hi_IN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/fi_FI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/zh_TW/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/sl_SI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/utils/__pycache__/datasets.cpython-34.pyc,,
faker/providers/address/de_DE/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/ru_RU/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/hr_HR/__pycache__/__init__.cpython-34.pyc,,
faker/providers/job/pl_PL/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/ja_JP/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/bg_BG/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/sl_SI/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/pt_PT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/ssn/en_CA/__pycache__/__init__.cpython-34.pyc,,
faker/providers/person/__pycache__/__init__.cpython-34.pyc,,
faker/__pycache__/build_docs.cpython-34.pyc,,
faker/providers/misc/en_US/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/lv_LV/__pycache__/__init__.cpython-34.pyc,,
faker/providers/address/zh_CN/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/zh_TW/__pycache__/__init__.cpython-34.pyc,,
faker/providers/company/it_IT/__pycache__/__init__.cpython-34.pyc,,
faker/providers/misc/__pycache__/__init__.cpython-34.pyc,,
faker/providers/phone_number/fr_FR/__pycache__/__init__.cpython-34.pyc,,

View File

@ -1,6 +0,0 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.30.0.a0)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any

View File

@ -1,3 +0,0 @@
[console_scripts]
faker = faker.cli:execute_from_command_line

View File

@ -1 +0,0 @@
{"classifiers": ["Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing", "Topic :: Utilities", "License :: OSI Approved :: MIT License"], "extensions": {"python.commands": {"wrap_console": {"faker": "faker.cli:execute_from_command_line"}}, "python.details": {"contacts": [{"email": "joke2k@gmail.com", "name": "joke2k", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://github.com/joke2k/faker"}}, "python.exports": {"console_scripts": {"faker": "faker.cli:execute_from_command_line"}}}, "extras": [], "generator": "bdist_wheel (0.30.0.a0)", "keywords": ["faker", "fixtures", "data", "test", "mock", "generator"], "license": "MIT License", "metadata_version": "2.0", "name": "Faker", "platform": "any", "run_requires": [{"requires": ["python-dateutil (>=2.4)", "six"]}, {"environment": "python_version==\"2.7\"", "requires": ["ipaddress"]}, {"environment": "python_version==\"3.0\"", "requires": ["importlib"]}, {"environment": "python_version==\"3.2\"", "requires": ["ipaddress"]}], "summary": "Faker is a Python package that generates fake data for you.", "version": "0.7.3"}

View File

@ -1,16 +0,0 @@
try:
import ast
from _markerlib.markers import default_environment, compile, interpret
except ImportError:
if 'ast' in globals():
raise
def default_environment():
return {}
def compile(marker):
def marker_fn(environment=None, override=None):
# 'empty markers are True' heuristic won't install extra deps.
return not marker.strip()
marker_fn.__doc__ = marker
return marker_fn
def interpret(marker, environment=None, override=None):
return compile(marker)()

View File

@ -1,119 +0,0 @@
# -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platform
platform.version = platform.version()
platform.machine = platform.machine()
platform.python_implementation = platform.python_implementation()
a free string, like '2.6', or 'win32'
"""
__all__ = ['default_environment', 'compile', 'interpret']
import ast
import os
import platform
import sys
import weakref
_builtin_compile = compile
try:
from platform import python_implementation
except ImportError:
if os.name == "java":
# Jython 2.5 has ast module, but not platform.python_implementation() function.
def python_implementation():
return "Jython"
else:
raise
# restricted set of variables
_VARS = {'sys.platform': sys.platform,
'python_version': '%s.%s' % sys.version_info[:2],
# FIXME parsing sys.platform is not reliable, but there is no other
# way to get e.g. 2.7.2+, and the PEP is defined with sys.version
'python_full_version': sys.version.split(' ', 1)[0],
'os.name': os.name,
'platform.version': platform.version(),
'platform.machine': platform.machine(),
'platform.python_implementation': python_implementation(),
'extra': None # wheel extension
}
for var in list(_VARS.keys()):
if '.' in var:
_VARS[var.replace('.', '_')] = _VARS[var]
def default_environment():
"""Return copy of default PEP 385 globals dictionary."""
return dict(_VARS)
class ASTWhitelist(ast.NodeTransformer):
def __init__(self, statement):
self.statement = statement # for error messages
ALLOWED = (ast.Compare, ast.BoolOp, ast.Attribute, ast.Name, ast.Load, ast.Str)
# Bool operations
ALLOWED += (ast.And, ast.Or)
# Comparison operations
ALLOWED += (ast.Eq, ast.Gt, ast.GtE, ast.In, ast.Is, ast.IsNot, ast.Lt, ast.LtE, ast.NotEq, ast.NotIn)
def visit(self, node):
"""Ensure statement only contains allowed nodes."""
if not isinstance(node, self.ALLOWED):
raise SyntaxError('Not allowed in environment markers.\n%s\n%s' %
(self.statement,
(' ' * node.col_offset) + '^'))
return ast.NodeTransformer.visit(self, node)
def visit_Attribute(self, node):
"""Flatten one level of attribute access."""
new_node = ast.Name("%s.%s" % (node.value.id, node.attr), node.ctx)
return ast.copy_location(new_node, node)
def parse_marker(marker):
tree = ast.parse(marker, mode='eval')
new_tree = ASTWhitelist(marker).generic_visit(tree)
return new_tree
def compile_marker(parsed_marker):
return _builtin_compile(parsed_marker, '<environment marker>', 'eval',
dont_inherit=True)
_cache = weakref.WeakValueDictionary()
def compile(marker):
"""Return compiled marker as a function accepting an environment dict."""
try:
return _cache[marker]
except KeyError:
pass
if not marker.strip():
def marker_fn(environment=None, override=None):
""""""
return True
else:
compiled_marker = compile_marker(parse_marker(marker))
def marker_fn(environment=None, override=None):
"""override updates environment"""
if override is None:
override = {}
if environment is None:
environment = default_environment()
environment.update(override)
return eval(compiled_marker, environment)
marker_fn.__doc__ = marker
_cache[marker] = marker_fn
return _cache[marker]
def interpret(marker, environment=None):
return compile(marker)(environment)

View File

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
__version__ = "2.6.0"

View File

@ -1,33 +0,0 @@
"""
Common code used in multiple modules.
"""
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __call__(self, n):
if n == self.n:
return self
else:
return self.__class__(self.weekday, n)
def __eq__(self, other):
try:
if self.weekday != other.weekday or self.n != other.n:
return False
except AttributeError:
return False
return True
__hash__ = None
def __repr__(self):
s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]
if not self.n:
return s
else:
return "%s(%+d)" % (s, self.n)

View File

@ -1,89 +0,0 @@
# -*- coding: utf-8 -*-
"""
This module offers a generic easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year, method=EASTER_WESTERN):
"""
This method was ported from the work done by GM Arts,
on top of the algorithm by Claus Tondering, which was
based in part on the algorithm of Ouding (1940), as
quoted in "Explanatory Supplement to the Astronomical
Almanac", P. Kenneth Seidelmann, editor.
This algorithm implements three different easter
calculation methods:
1 - Original calculation in Julian calendar, valid in
dates after 326 AD
2 - Original method, with date converted to Gregorian
calendar, valid in years 1583 to 4099
3 - Revised method, in Gregorian calendar, valid in
years 1583 to 4099 as well
These methods are represented by the constants:
* ``EASTER_JULIAN = 1``
* ``EASTER_ORTHODOX = 2``
* ``EASTER_WESTERN = 3``
The default method is method 3.
More about the algorithm may be found at:
http://users.chariot.net.au/~gmarts/eastalg.htm
and
http://www.tondering.dk/claus/calendar.html
"""
if not (1 <= method <= 3):
raise ValueError("invalid method")
# g - Golden year - 1
# c - Century
# h - (23 - Epact) mod 30
# i - Number of days from March 21 to Paschal Full Moon
# j - Weekday for PFM (0=Sunday, etc)
# p - Number of days from March 21 to Sunday on or before PFM
# (-6 to 28 methods 1 & 3, to 56 for method 2)
# e - Extra days to add for method 2 (converting Julian
# date to Gregorian date)
y = year
g = y % 19
e = 0
if method < 3:
# Old method
i = (19*g + 15) % 30
j = (y + y//4 + i) % 7
if method == 2:
# Extra dates to convert Julian to Gregorian date
e = 10
if y > 1600:
e = e + y//100 - 16 - (y//100 - 16)//4
else:
# New method
c = y//100
h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
j = (y + y//4 + i + 2 - c + c//4) % 7
# p can be from -6 to 56 corresponding to dates 22 March to 23 May
# (later dates apply to method 2, although 23 May never actually occurs)
p = i - j + e
d = 1 + (p + 27 + (p + 6)//40) % 31
m = 3 + (p + 26)//30
return datetime.date(int(y), int(m), int(d))

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More