From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A4CCC13838B for ; Sat, 27 Sep 2014 02:21:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8EFBFE0BA9; Sat, 27 Sep 2014 02:20:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B2B51E0B85 for ; Sat, 27 Sep 2014 02:20:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4A797340284 for ; Sat, 27 Sep 2014 02:20:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DEA04660E for ; Sat, 27 Sep 2014 02:20:49 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1411782045.3fd088ac3f9eb20b09c27bce96a8c35889565dc1.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/, pym/portage/emaint/, pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/emaint/main.py pym/portage/emaint/module.py pym/portage/emaint/progress.py pym/portage/module.py pym/portage/progress.py pym/portage/sync/__init__.py pym/portage/sync/controller.py X-VCS-Directories: pym/portage/sync/ pym/portage/emaint/ pym/portage/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 3fd088ac3f9eb20b09c27bce96a8c35889565dc1 X-VCS-Branch: plugin-sync Date: Sat, 27 Sep 2014 02:20:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9ad83646-2e97-4877-bbeb-f1537371d547 X-Archives-Hash: b6aba2033b9c2252b93863d6548b2cb5 commit: 3fd088ac3f9eb20b09c27bce96a8c35889565dc1 Author: Brian Dolbec gentoo org> AuthorDate: Thu Sep 4 00:13:03 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Sep 27 01:40:45 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3fd088ac Move module.py and progress.py from emaint to portage namespace This makes it more centrally available as it is used by more than just the emaint module. moule.py: make path and namepace params mandatory. They are not as easily predictable. --- pym/portage/emaint/main.py | 12 +++++++++--- pym/portage/{emaint => }/module.py | 14 +++----------- pym/portage/{emaint => }/progress.py | 0 pym/portage/sync/__init__.py | 2 +- pym/portage/sync/controller.py | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/pym/portage/emaint/main.py b/pym/portage/emaint/main.py index 6292338..fea4832 100644 --- a/pym/portage/emaint/main.py +++ b/pym/portage/emaint/main.py @@ -9,8 +9,8 @@ import textwrap import portage from portage import os -from portage.emaint.module import Modules -from portage.emaint.progress import ProgressBar +from portage.module import Modules +from portage.progress import ProgressBar from portage.emaint.defaults import DEFAULT_OPTIONS from portage.util._argparse import ArgumentParser @@ -153,7 +153,13 @@ def emaint_main(myargv): # files (such as the world file) have sane permissions. os.umask(0o22) - module_controller = Modules(namepath="portage.emaint.modules") + module_path = os.path.join( + (os.path.dirname( + os.path.realpath(__file__))), "modules" + ) + module_controller = Modules( + path=module_path, + namepath="portage.emaint.modules") module_names = module_controller.module_names[:] module_names.insert(0, "all") diff --git a/pym/portage/emaint/module.py b/pym/portage/module.py similarity index 93% rename from pym/portage/emaint/module.py rename to pym/portage/module.py index 07a0cb7..d961574 100644 --- a/pym/portage/emaint/module.py +++ b/pym/portage/module.py @@ -80,17 +80,9 @@ class Modules(object): defaults to the directory name of this file + '.modules' """ - def __init__(self, path=None, namepath=None): - if path: - self._module_path = path - else: - self._module_path = os.path.join(( - os.path.dirname(os.path.realpath(__file__))), "modules") - if namepath: - self._namepath = namepath - else: - self._namepath = '.'.join(os.path.dirname( - os.path.realpath(__file__)), "modules") + def __init__(self, path, namepath): + self._module_path = path + self._namepath = namepath self._modules = self._get_all_modules() self.modules = ProtectedDict(self._modules) self.module_names = sorted(self._modules) diff --git a/pym/portage/emaint/progress.py b/pym/portage/progress.py similarity index 100% rename from pym/portage/emaint/progress.py rename to pym/portage/progress.py diff --git a/pym/portage/sync/__init__.py b/pym/portage/sync/__init__.py index b74c89e..58a1298 100644 --- a/pym/portage/sync/__init__.py +++ b/pym/portage/sync/__init__.py @@ -3,7 +3,7 @@ import os -from portage.emaint.module import Modules +from portage.module import Modules from portage.sync.controller import SyncManager from portage.sync.config_checks import check_type diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py index f0d1c05..2b3dbad 100644 --- a/pym/portage/sync/controller.py +++ b/pym/portage/sync/controller.py @@ -10,7 +10,7 @@ import pwd import portage from portage import os -from portage.emaint.progress import ProgressBar +from portage.progress import ProgressBar #from portage.emaint.defaults import DEFAULT_OPTIONS #from portage.util._argparse import ArgumentParser from portage.util import writemsg_level