From 51712bfec5ba30f4a23950db160b5cda4d6e2799 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 22 2015 15:22:37 +0000 Subject: Add a front page to the project --- diff --git a/mdapi/__init__.py b/mdapi/__init__.py index 3bb4bae..b2594ea 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -38,10 +38,16 @@ for key in dir(obj): if key.isupper(): CONFIG[key] = getattr(obj, key) + if 'MDAPI_CONFIG' in os.environ and os.path.exists(os.environ['MDAPI_CONFIG']): with open(os.environ['MDAPI_CONFIG']) as config_file: exec(compile(config_file.read(), os.environ['MDAPI_CONFIG'], 'exec'), CONFIG) +indexfile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'index.html') +INDEX = '' +with open(indexfile) as stream: + INDEX = stream.read() + def _get_pkg(branch, name): ''' Return the pkg information for the given package in the specified @@ -135,8 +141,7 @@ def list_branches(request): @asyncio.coroutine def index(request): - text = "Front page" - return web.Response(body=text.encode('utf-8')) + return web.Response(body=INDEX.encode('utf-8')) @asyncio.coroutine diff --git a/mdapi/index.html b/mdapi/index.html new file mode 100644 index 0000000..bbdd99f --- /dev/null +++ b/mdapi/index.html @@ -0,0 +1,102 @@ + + + + + + mdapi - {% block title %}{% endblock %} + + + + + _ _ + | | (_) + _ __ ___ __| | __ _ _ __ _ +| '_ ` _ \ / _` |/ _` | '_ \| | +| | | | | | (_| | (_| | |_) | | +|_| |_| |_|\__,_|\__,_| .__/|_| + | | + |_| + + +mdapi is a small API exposing the metadata contained in the different RPM +repository. + +USAGE +===== + +List all branches +----------------- + +The list of all branches for which mdapi contains information can be found +at: + + /branches + +Retrieve information about a package +------------------------------------ + +You can retrieve information about a specific package on a specific branch +by querying: + + /{branch}/pkg/{package name} + +So for example, for the kernel in rawhide: + + /rawhide/pkg/kernel + + +Retrieve the list of files in a package +--------------------------------------- + +You can retrieve the list of files present in the specific package on a +specific branch by querying: + + /{branch}/filelist/{package name} + +So for example, for the kernel in rawhide: + + /rawhide/filelist/kernel + + +Retrieve the changelog of a package +----------------------------------- + +You can retrieve the changelog of a specific package on a specific branch +by querying: + + /{branch}/changelog/{package name} + +So for example, for the kernel in rawhide: + + /rawhide/changelog/kernel + + + + + |‾| + | | + |‾|/‾‾˙ |‾'‾‾\|‾'‾‾\|‾| |‾| |‾| + | | (‾| | |‾) | |‾) | | | | | | + | |\ ‾, | ,‾ /| ,‾ / \ ‾ , ‾, | + ‾ ‾‾ ‾ ‾ ‾‾ | |‾‾ ‾‾‾ ‾‾ ‾ + (‾) | | + ‾ ‾ +© 2015 - RedHat Inc - GPLv2+ - Sources: https://pagure.io/mdapi + +