mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
purge code that modifies the repo descriptions
YAML now provides nice ways of handling blocks of text, including removing indents and newlines. Remove the custom hack.
This commit is contained in:
parent
828d6015ef
commit
c98b15e72a
5 changed files with 4 additions and 68 deletions
|
@ -355,10 +355,6 @@ def read_config(opts):
|
|||
|
||||
fill_config_defaults(config)
|
||||
|
||||
for k in ["repo_description", "archive_description"]:
|
||||
if k in config:
|
||||
config[k] = clean_description(config[k])
|
||||
|
||||
if 'serverwebroot' in config:
|
||||
if isinstance(config['serverwebroot'], str):
|
||||
roots = [config['serverwebroot']]
|
||||
|
@ -671,19 +667,6 @@ def get_extension(filename):
|
|||
publish_name_regex = re.compile(r"^(.+)_([0-9]+)\.(apk|zip)$")
|
||||
|
||||
|
||||
def clean_description(description):
|
||||
'Remove unneeded newlines and spaces from a block of description text'
|
||||
returnstring = ''
|
||||
# this is split up by paragraph to make removing the newlines easier
|
||||
for paragraph in re.split(r'\n\n', description):
|
||||
paragraph = re.sub('\r', '', paragraph)
|
||||
paragraph = re.sub('\n', ' ', paragraph)
|
||||
paragraph = re.sub(' {2,}', ' ', paragraph)
|
||||
paragraph = re.sub(r'^\s*(\w)', r'\1', paragraph)
|
||||
returnstring += paragraph + '\n\n'
|
||||
return returnstring.rstrip('\n')
|
||||
|
||||
|
||||
def publishednameinfo(filename):
|
||||
filename = os.path.basename(filename)
|
||||
m = publish_name_regex.match(filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue