* [gentoo-commits] proj/catalyst:master commit in: bin/
@ 2015-10-11 18:19 Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2015-10-11 18:19 UTC (permalink / raw
To: gentoo-commits
commit: ea895af0e5a9f22f71ba695dcb7fd6c8f6f0ce70
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 11 18:19:13 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Oct 11 18:19:13 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ea895af0
pylint: scan all modules by default
Add a quick shortcut to scan all the modules in the tree.
bin/pylint | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/bin/pylint b/bin/pylint
index 1a50609..b001827 100755
--- a/bin/pylint
+++ b/bin/pylint
@@ -10,10 +10,27 @@ import os
import sys
+def find_all_modules(source_root):
+ """Locate all python modules in the tree for scanning"""
+ ret = []
+
+ for root, _dirs, files in os.walk(source_root, topdown=False):
+ # Add all of the .py modules in the tree.
+ ret += [os.path.join(root, x) for x in files if x.endswith('.py')]
+
+ # Add the main scripts that don't end in .py.
+ ret += [os.path.join(source_root, 'bin', x) for x in ('catalyst', 'pylint')]
+
+ return ret
+
+
def main(argv):
"""The main entry point"""
source_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+ if not argv:
+ argv = find_all_modules(source_root)
+
pympath = source_root
pythonpath = os.environ.get('PYTHONPATH')
if pythonpath is None:
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/catalyst:master commit in: bin/
@ 2015-11-19 4:00 Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2015-11-19 4:00 UTC (permalink / raw
To: gentoo-commits
commit: 16f3af32eb645f3485e9e54b2bb9d128503fa9ce
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 29 00:29:52 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 19 03:40:51 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=16f3af32
catalyst: add a wrapper for executing directly out of git
This is a smaller wrapper to set up the environment (both python and some
config options) so that all the code is used from the git repo. This way
you don't have to install it in order to test things.
bin/catalyst.git | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/bin/catalyst.git b/bin/catalyst.git
new file mode 100755
index 0000000..eb6234b
--- /dev/null
+++ b/bin/catalyst.git
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+"""Run catalyst from git using local modules/scripts."""
+
+from __future__ import print_function
+
+import os
+import sys
+import tempfile
+
+from snakeoil import process
+
+
+def main(argv):
+ """The main entry point"""
+ source_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+
+ pympath = source_root
+ pythonpath = os.environ.get('PYTHONPATH')
+ if pythonpath is None:
+ pythonpath = pympath
+ else:
+ pythonpath = pympath + ':' + pythonpath
+ os.environ['PYTHONPATH'] = pythonpath
+
+ with tempfile.NamedTemporaryFile(prefix='catalyst.conf.') as conf:
+ # Set up a config file with paths to the local tree.
+ conf.write(
+ ('sharedir=%(source_root)s\n'
+ 'shdir=%(source_root)s/targets\n'
+ 'envscript=%(source_root)s/etc/catalystrc\n'
+ % {'source_root': source_root}).encode('utf8')
+ )
+ conf.flush()
+ argv = [
+ '--config', os.path.join(source_root, 'etc', 'catalyst.conf'),
+ '--config', conf.name,
+ ] + argv
+
+ cmd = [os.path.join(source_root, 'bin', 'catalyst')]
+ pid = os.fork()
+ if pid == 0:
+ os.execvp(cmd[0], cmd + argv)
+ (_pid, status) = os.waitpid(pid, 0)
+ process.exit_as_status(status)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/catalyst:master commit in: bin/
@ 2015-11-19 4:00 Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2015-11-19 4:00 UTC (permalink / raw
To: gentoo-commits
commit: 24e7da46a9a6521ff89090c555babd12cfbe589a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 29 00:29:10 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 19 03:40:51 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=24e7da46
catalyst: switch to common python entry
Since the catalyst code base supports py2 & py3, we no longer need to
hardcode py2 in the shebang.
bin/catalyst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/catalyst b/bin/catalyst
index 1557ab8..24122b2 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -OO
+#!/usr/bin/python -OO
# Maintained in full by:
# Catalyst Team <catalyst@gentoo.org>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/catalyst:master commit in: bin/
@ 2015-10-06 17:03 Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2015-10-06 17:03 UTC (permalink / raw
To: gentoo-commits
commit: 3daff314c8d4927d13c663d921a4e1952ea038d1
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 6 15:54:06 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct 6 15:54:06 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3daff314
catalyst: clean up unused module imports
bin/catalyst | 2 --
1 file changed, 2 deletions(-)
diff --git a/bin/catalyst b/bin/catalyst
index d0bc153..577e899 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -32,8 +32,6 @@ except KeyboardInterrupt:
from catalyst.main import main
-from catalyst import __maintainer__
-from catalyst import __version__
try:
main()
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-19 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 18:19 [gentoo-commits] proj/catalyst:master commit in: bin/ Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2015-11-19 4:00 Mike Frysinger
2015-11-19 4:00 Mike Frysinger
2015-10-06 17:03 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox