public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/mirrorselect:master commit in: /, mirrorselect/, bin/
@ 2012-11-12  7:46 Brian Dolbec
  0 siblings, 0 replies; only message in thread
From: Brian Dolbec @ 2012-11-12  7:46 UTC (permalink / raw
  To: gentoo-commits

commit:     729f667ac9db835ac800b698dd01c436162d8a65
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 12 01:32:14 2012 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Nov 12 07:22:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/mirrorselect.git;a=commit;h=729f667a

move main.py into site-packages, create and use a minimal script to start it.

---
 bin/mirrorselect                |   65 +++++++++++++++++++++++++++++++++++++++
 main.py => mirrorselect/main.py |    0
 2 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/bin/mirrorselect b/bin/mirrorselect
new file mode 100755
index 0000000..ef3b6af
--- /dev/null
+++ b/bin/mirrorselect
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+
+"""Mirrorselect 2.x
+ Tool for selecting Gentoo source and rsync mirrors.
+
+Copyright 2005-2012 Gentoo Foundation
+
+	Copyright (C) 2005 Colin Kingsley <tercel@gentoo.org>
+	Copyright (C) 2008 Zac Medico <zmedico@gentoo.org>
+	Copyright (C) 2009 Sebastian Pipping <sebastian@pipping.org>
+	Copyright (C) 2009 Christian Ruppert <idl0r@gentoo.org>
+
+Distributed under the terms of the GNU General Public License v2
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+"""
+
+from __future__ import print_function
+
+
+
+
+import sys
+
+# This block ensures that ^C interrupts are handled quietly.
+try:
+	import signal
+
+	def exithandler(signum,frame):
+		signal.signal(signal.SIGINT, signal.SIG_IGN)
+		signal.signal(signal.SIGTERM, signal.SIG_IGN)
+		print('Caught signal %s. Exiting' % signum)
+		sys.exit(1)
+
+	signal.signal(signal.SIGINT, exithandler)
+	signal.signal(signal.SIGTERM, exithandler)
+	signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+except KeyboardInterrupt:
+	print()
+	sys.exit(1)
+
+
+from mirrorselect.main import main
+
+try:
+	main(sys.argv)
+except KeyboardInterrupt:
+	print("Aborted.")
+	sys.exit(130)
+sys.exit(0)
+

diff --git a/main.py b/mirrorselect/main.py
similarity index 100%
rename from main.py
rename to mirrorselect/main.py


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-12  7:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12  7:46 [gentoo-commits] proj/mirrorselect:master commit in: /, mirrorselect/, bin/ Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox