commit:     92f7f0c65c819e54e5be0033c4179d5fc9e906fb
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 15 19:52:12 2014 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Fri Aug 15 21:42:42 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=92f7f0c6

Converts archive code to plug-in module

---
 layman/overlays/{ => modules}/archive.py           |  0
 layman/overlays/modules/squashfs/__init__.py       | 25 ++++++++++++++++++++++
 layman/overlays/{ => modules/squashfs}/squashfs.py |  8 +++----
 layman/overlays/modules/tar/__init__.py            | 25 ++++++++++++++++++++++
 layman/overlays/{ => modules/tar}/tar.py           |  8 +++----
 5 files changed, 58 insertions(+), 8 deletions(-)

diff --git a/layman/overlays/archive.py b/layman/overlays/modules/archive.py
similarity index 100%
rename from layman/overlays/archive.py
rename to layman/overlays/modules/archive.py

diff --git a/layman/overlays/modules/squashfs/__init__.py 
b/layman/overlays/modules/squashfs/__init__.py
new file mode 100644
index 0000000..753fe21
--- /dev/null
+++ b/layman/overlays/modules/squashfs/__init__.py
@@ -0,0 +1,25 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+'''
+Squashfs plug-in module for layman.
+'''
+
+module_spec = {
+    'name': 'squashfs',
+    'description': __doc__,
+    'provides':{
+        'squashfs-module': {
+            'name': 'squashfs',
+            'class': 'SquashfsOverlay',
+            'description': __doc__,
+            'functions': ['add', 'supported', 'sync'],
+            'func_desc': {
+                'add': 'Fetches overlay package and mounts it locally',
+                'supported': 'Confirms if overlay type is supported',
+                'sync': 'Refetches overlay package and mounts it locally',
+            },
+        }
+    }
+}
+

diff --git a/layman/overlays/squashfs.py 
b/layman/overlays/modules/squashfs/squashfs.py
similarity index 94%
rename from layman/overlays/squashfs.py
rename to layman/overlays/modules/squashfs/squashfs.py
index 48711ce..d7307bd 100644
--- a/layman/overlays/squashfs.py
+++ b/layman/overlays/modules/squashfs/squashfs.py
@@ -28,10 +28,10 @@ import os
 import shutil
 import sys
 
-from   layman.constants        import FILE_EXTENSIONS
-from   layman.overlays.archive import ArchiveOverlay
-from   layman.overlays.source  import require_supported
-from   layman.utils            import path
+from   layman.constants                import FILE_EXTENSIONS
+from   layman.overlays.modules.archive import ArchiveOverlay
+from   layman.overlays.source          import require_supported
+from   layman.utils                    import path
 
 
#===============================================================================
 #

diff --git a/layman/overlays/modules/tar/__init__.py 
b/layman/overlays/modules/tar/__init__.py
new file mode 100644
index 0000000..c3a5ca8
--- /dev/null
+++ b/layman/overlays/modules/tar/__init__.py
@@ -0,0 +1,25 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+'''
+Tar plug-in module for layman.
+'''
+
+module_spec = {
+    'name': 'tar',
+    'description': __doc__,
+    'provides':{
+        'tar-module': {
+            'name': 'tar',
+            'class': 'TarOverlay',
+            'description': __doc__,
+            'functions': ['add', 'supported', 'sync'],
+            'func_desc': {
+                'add': 'Creates the base dir and extracts the tar repository',
+                'supported': 'Confirms if overlay type is supported',
+                'sync': 'Performs a sync on the repository',
+            },
+        }
+    }
+}
+

diff --git a/layman/overlays/tar.py b/layman/overlays/modules/tar/tar.py
similarity index 91%
rename from layman/overlays/tar.py
rename to layman/overlays/modules/tar/tar.py
index bcba32c..322b46c 100644
--- a/layman/overlays/tar.py
+++ b/layman/overlays/modules/tar/tar.py
@@ -28,10 +28,10 @@ __version__ = "$Id: tar.py 310 2007-04-09 16:30:40Z wrobel 
$"
 
 import sys
 
-from   layman.constants         import FILE_EXTENSIONS
-from   layman.overlays.archive  import ArchiveOverlay
-from   layman.overlays.source   import require_supported
-from   layman.utils             import run_command
+from   layman.constants                import FILE_EXTENSIONS
+from   layman.overlays.modules.archive import ArchiveOverlay
+from   layman.overlays.source          import require_supported
+from   layman.utils                    import run_command
 
 
#===============================================================================
 #

Reply via email to