ChangeLog | 3 +++
newt_syrup/menuscreen.py | 2 +-
newt_syrup/utils.py | 38 ++++++++++++++++++++++++++++++++++++++
setup.py | 2 +-
4 files changed, 43 insertions(+), 2 deletions(-)
New commits:
commit 4214448038fbbdc2f84c38d7698257f486766ada
Author: Darryl L. Pierce <dpierce(a)redhat.com>
Date: Tue Jul 12 14:26:33 2011 -0400
Added the utils module and updated its use.
diff --git a/ChangeLog b/ChangeLog
index 42062c7..1a24930 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
Change Log:
* Version 0.1.2:
+ - Added the utils module.
* Version 0.1.1:
- Added support for color sets.
diff --git a/newt_syrup/menuscreen.py b/newt_syrup/menuscreen.py
index 1700e8c..7527112 100644
--- a/newt_syrup/menuscreen.py
+++ b/newt_syrup/menuscreen.py
@@ -19,7 +19,7 @@
from snack import *
import traceback
-import utils
+import newt_syrup.utils
import logging
EXIT_MENU = 99
diff --git a/newt_syrup/utils.py b/newt_syrup/utils.py
new file mode 100644
index 0000000..b79d243
--- /dev/null
+++ b/newt_syrup/utils.py
@@ -0,0 +1,38 @@
+# utils.py - Copyright (C) 2009 Red Hat, Inc.
+# Written by Darryl L. Pierce <dpierce(a)redhat.com>
+#
+# 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 Street, Fifth Floor, Boston,
+# MA 02110-1301, USA. A copy of the GNU General Public License is
+# also available at
http://www.gnu.org/copyleft/gpl.html.
+
+import re
+
+def string_is_not_blank(value):
+ if len(value) > 0:
+ return True
+ return False
+
+def string_has_no_spaces(value):
+ if re.match("^[a-zA-Z0-9_]*$", value):
+ return True
+ return False
+
+def size_as_mb_or_gb(size):
+ '''Takes a size value in bytes and returns it as either a
+ value in megabytes or gigabytes.'''
+ if size / 1024.0**3 < 1.0:
+ result = "%0.2f MB" % (size / 1024.0**2)
+ else:
+ result = "%0.2f GB" % (size / 1024.0**3)
+ return result
commit c8be52a0a8234edca5cb4e2c464d4db3c1bad29a
Author: Darryl L. Pierce <dpierce(a)redhat.com>
Date: Fri Sep 10 16:04:25 2010 -0400
Setup changes for version 0.1.2 development.
diff --git a/ChangeLog b/ChangeLog
index 574fb0c..42062c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
Change Log:
+ * Version 0.1.2:
+
* Version 0.1.1:
- Added support for color sets.
- Added support for using compact buttons.
diff --git a/setup.py b/setup.py
index 57a339e..af22130 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
from setuptools import setup, find_packages
setup(name = "newt_syrup",
- version = "0.1.1",
+ version = "0.1.2",
packages = find_packages(),
author = "Darryl L. Pierce",
author_email = "dpierce(a)redhat.com",