Nathaniel van Diepen 3 years ago
parent
commit
d951762020
3 changed files with 9 additions and 4 deletions
  1. 5 1
      pacman_repo/__init__.py
  2. 2 2
      pacman_repo/repo.py
  3. 2 1
      pacman_repo/server.py

+ 5 - 1
pacman_repo/__init__.py

@@ -6,6 +6,7 @@ from .util import term
 from .repo import Repo
 from . import server
 
+
 def update(args, config):
     for repo in config.repos:
         repo = Repo(repo)
@@ -15,9 +16,11 @@ def update(args, config):
             print("  {0}: {1}".format(package.name, package.url))
             package.makepkg(args.force)
 
+
 def webserver(args, config):
     server.start()
 
+
 def main(argv):
     # Setup argument parser
     parser = argparse.ArgumentParser(
@@ -28,7 +31,8 @@ def main(argv):
         default='/etc/pacman-repo.d',
         help="Configuration folder path"
     )
-    subparsers = parser.add_subparsers(required=True, dest='command', metavar='command')
+    subparsers = parser.add_subparsers(
+        required=True, dest='command', metavar='command')
     # Update command
     update_parser = subparsers.add_parser('update', help='Update repository')
     update_parser.add_argument(

+ 2 - 2
pacman_repo/repo.py

@@ -3,6 +3,7 @@ import subprocess
 
 from .pkgbuild import PKGBUILD
 
+
 class Package(object):
     def __init__(self, repo, config):
         self.repo = repo
@@ -14,7 +15,7 @@ class Package(object):
                     text=True)
 
         except subprocess.CalledProcessError as e:
-            print("\n".join([e.stdout,e.stderr]))
+            print("\n".join([e.stdout, e.stderr]))
 
     def _git(self, *args):
         self._exec('git', *args)
@@ -41,7 +42,6 @@ class Package(object):
     def path(self):
         return os.path.join(self.repo.config.config['cachedir'], self.name)
 
-
     @property
     def PKGBUILD(self):
         if not os.path.exists(self.path):

+ 2 - 1
pacman_repo/server.py

@@ -1,12 +1,12 @@
 from aiohttp import web
 from aiohttp.web import middleware
-from aiohttp.web import View
 
 
 async def handle(request):
     name = request.match_info.get('name', "Anonymous")
     return web.json_response(dict(text="Hello, {}".format(name)))
 
+
 @middleware
 async def auth(request, handler):
     # TODO - check auth cookie
@@ -21,5 +21,6 @@ def start():
     ])
     web.run_app(app)
 
+
 if __name__ == '__main__':
     start()