Cosmetics
This commit is contained in:
parent
711ecf5df2
commit
6bfdcbafec
@ -37,7 +37,6 @@ import ssl
|
||||
import threading
|
||||
import subprocess
|
||||
import wsgiref.simple_server
|
||||
import re
|
||||
import zlib
|
||||
from http import client
|
||||
from urllib.parse import unquote, urlparse
|
||||
|
@ -159,7 +159,7 @@ class Auth(BaseAuth):
|
||||
|
||||
"""
|
||||
hash_value = hash_value.replace(
|
||||
"{SSHA}", "").encode("ascii").decode('base64')
|
||||
"{SSHA}", "").encode("ascii").decode("base64")
|
||||
password = password.encode(self.configuration.get("encoding", "stock"))
|
||||
hash_value = hash_value[:20]
|
||||
salt_value = hash_value[20:]
|
||||
|
@ -45,7 +45,7 @@ def start(name="radicale", filename=None, debug=False):
|
||||
# Configuration taken from file
|
||||
configure_from_file(logger, filename, debug)
|
||||
# Reload config on SIGHUP (UNIX only)
|
||||
if hasattr(signal, 'SIGHUP'):
|
||||
if hasattr(signal, "SIGHUP"):
|
||||
def handler_generator(logger, filename, debug):
|
||||
def handler(signum, frame):
|
||||
configure_from_file(logger, filename, debug)
|
||||
|
@ -104,7 +104,7 @@ class Rights(BaseRights):
|
||||
self.rights_type = configuration.get("rights", "type").lower()
|
||||
|
||||
def authorized(self, user, collection, permission):
|
||||
user = user or ''
|
||||
user = user or ""
|
||||
if user and not storage.is_safe_path_component(user):
|
||||
# Prevent usernames like "user/calendar.ics"
|
||||
raise ValueError("Unsafe username")
|
||||
|
@ -402,6 +402,7 @@ class Collection(BaseCollection):
|
||||
if not tag and collection:
|
||||
tag = collection[0].name
|
||||
self = cls(href)
|
||||
|
||||
if tag == "VCALENDAR":
|
||||
self.set_meta("tag", "VCALENDAR")
|
||||
if collection:
|
||||
@ -411,7 +412,7 @@ class Collection(BaseCollection):
|
||||
items.extend(getattr(collection, "%s_list" % content, []))
|
||||
|
||||
def get_uid(item):
|
||||
return hasattr(item, 'uid') and item.uid.value
|
||||
return hasattr(item, "uid") and item.uid.value
|
||||
|
||||
items_by_uid = groupby(
|
||||
sorted(items, key=get_uid), get_uid)
|
||||
@ -429,6 +430,7 @@ class Collection(BaseCollection):
|
||||
for card in collection:
|
||||
file_name = hex(getrandbits(32))[2:]
|
||||
self.upload(file_name, card)
|
||||
|
||||
return self
|
||||
|
||||
def list(self):
|
||||
|
@ -28,4 +28,4 @@ from radicale import auth
|
||||
|
||||
class Auth(auth.BaseAuth):
|
||||
def is_authenticated(self, user, password):
|
||||
return user == 'tmp'
|
||||
return user == "tmp"
|
||||
|
@ -778,7 +778,7 @@ def proppatch(path, xml_request, collection):
|
||||
_add_propstat_to(response, short_name, 200)
|
||||
|
||||
for short_name in props_to_remove:
|
||||
collection.set_meta(short_name, '')
|
||||
collection.set_meta(short_name, "")
|
||||
_add_propstat_to(response, short_name, 200)
|
||||
|
||||
return _pretty_xml(multistatus)
|
||||
|
Loading…
Reference in New Issue
Block a user