mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
auto-clean newlines and spaces in repo/archive descriptions
This gives us flexibility in how the blocks of text can be formatted in config.py, but also provides a more useful format for displaying since the client can decide where to wrap the text.
This commit is contained in:
parent
c7962e7c6d
commit
f34c842f55
3 changed files with 80 additions and 13 deletions
48
tests/description-parsing.py
Executable file
48
tests/description-parsing.py
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.join(os.getcwd(), '..', 'fdroidserver'))
|
||||
import common
|
||||
|
||||
config = common.get_default_config()
|
||||
|
||||
testtext = '''
|
||||
This is a block of text that has been wrapped to fit nicely in PEP8 style:
|
||||
|
||||
GnuPrivacyGuard extends the gpgcli command line tool to bring an integrated
|
||||
privacy engine to your Android. It gives you command line access to the entire
|
||||
GnuPG suite of encryption software. It also serves as the test bed for
|
||||
complete Android integration for all of GnuPG's crypto services, including
|
||||
OpenPGP, symmetric encryption, and more.
|
||||
|
||||
GPG is GNU’s tool for end-to-end secure communication and encrypted data
|
||||
storage. This trusted protocol is the free software alternative to PGP. This
|
||||
app is built upon GnuPG 2.1, the new modularized version of GnuPG that now
|
||||
supports S/MIME.
|
||||
|
||||
GPG aims to provide an integrated experience, so clicking on PGP files should
|
||||
"just work". You can also share files to GPG to encrypt them. GPG will also
|
||||
respond when you click on a PGP fingerprint URL (one that starts with
|
||||
openpgp4fpr:).
|
||||
|
||||
Before using GPG, be sure to launch the app and let it finish its installation
|
||||
process. Once it has completed, then you're ready to use it. The easiest way
|
||||
to get started with GPG is to install [[jackpal.androidterm]]. GPG will
|
||||
automatically configure Android Terminal Emulator as long as you have the
|
||||
"Allow PATH extensions" settings enabled.
|
||||
'''
|
||||
|
||||
archive_description = """
|
||||
The repository of older versions of applications from the main demo repository.
|
||||
"""
|
||||
|
||||
|
||||
print('\n\n\n----------------------------------------------------')
|
||||
print(common.clean_description(testtext))
|
||||
print('\n\n\n----------------------------------------------------')
|
||||
print(common.clean_description(archive_description))
|
||||
print('\n\n\n----------------------------------------------------')
|
||||
print(common.clean_description(config['repo_description']))
|
Loading…
Add table
Add a link
Reference in a new issue