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:
Hans-Christoph Steiner 2020-11-17 14:19:27 +01:00
parent 828d6015ef
commit c98b15e72a
5 changed files with 4 additions and 68 deletions

View file

@ -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)