mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
black
This commit is contained in:
parent
b7c8485f1e
commit
3dd349b577
3 changed files with 11 additions and 11 deletions
|
|
@ -13,7 +13,7 @@ cached_funcs = set()
|
|||
|
||||
|
||||
def get_username(user):
|
||||
""" Return username of a User instance """
|
||||
"""Return username of a User instance"""
|
||||
if hasattr(user, "get_username"):
|
||||
return user.get_username()
|
||||
else:
|
||||
|
|
@ -21,7 +21,7 @@ def get_username(user):
|
|||
|
||||
|
||||
def get_user(username):
|
||||
""" Return user from a username/ish identifier """
|
||||
"""Return user from a username/ish identifier"""
|
||||
return get_user_model().objects.get_by_natural_key(username)
|
||||
|
||||
|
||||
|
|
|
|||
16
docs/conf.py
16
docs/conf.py
|
|
@ -40,8 +40,8 @@ source_suffix = ".txt"
|
|||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = u"django-avatar"
|
||||
copyright = u"2013, django-avatar developers"
|
||||
project = "django-avatar"
|
||||
copyright = "2013, django-avatar developers"
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
|
|
@ -187,8 +187,8 @@ latex_documents = [
|
|||
(
|
||||
"index",
|
||||
"django-avatar.tex",
|
||||
u"django-avatar Documentation",
|
||||
u"django-avatar developers",
|
||||
"django-avatar Documentation",
|
||||
"django-avatar developers",
|
||||
"manual",
|
||||
),
|
||||
]
|
||||
|
|
@ -222,8 +222,8 @@ man_pages = [
|
|||
(
|
||||
"index",
|
||||
"django-avatar",
|
||||
u"django-avatar Documentation",
|
||||
[u"django-avatar developers"],
|
||||
"django-avatar Documentation",
|
||||
["django-avatar developers"],
|
||||
1,
|
||||
)
|
||||
]
|
||||
|
|
@ -241,8 +241,8 @@ texinfo_documents = [
|
|||
(
|
||||
"index",
|
||||
"django-avatar",
|
||||
u"django-avatar Documentation",
|
||||
u"django-avatar developers",
|
||||
"django-avatar Documentation",
|
||||
"django-avatar developers",
|
||||
"django-avatar",
|
||||
"One line description of project.",
|
||||
"Miscellaneous",
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ def root_mean_square_difference(image1, image2):
|
|||
"Calculate the root-mean-square difference between two images"
|
||||
diff = ImageChops.difference(image1, image2).convert("L")
|
||||
h = diff.histogram()
|
||||
sq = (value * (idx ** 2) for idx, value in enumerate(h))
|
||||
sq = (value * (idx**2) for idx, value in enumerate(h))
|
||||
sum_of_squares = sum(sq)
|
||||
rms = math.sqrt(sum_of_squares / float(image1.size[0] * image1.size[1]))
|
||||
return rms
|
||||
|
|
|
|||
Loading…
Reference in a new issue