mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 07:22:29 +03:00
Merge branch 'purge-description-formatting' into 'master'
Purge description formatting Closes #845 and #678 See merge request fdroid/fdroidserver!828
This commit is contained in:
commit
ac5ed93428
17 changed files with 88 additions and 1558 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