changeset 32:ba88b8114b98

Fixed issue with throwing an exception on stat usage. IN: - Created better error message when ignores file is not found. IN: - Fixed spelling error in HgWeb configuration file error message. IN: -
author John Schneiderman <JohnMS@CodeGNU.com>
date Fri, 08 Aug 2014 13:15:38 -0500
parents 6cd1a810f95a
children a444cc89d51e
files doc/TODO src/manager.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/TODO	Thu Aug 07 21:10:21 2014 -0500
+++ b/doc/TODO	Fri Aug 08 13:15:38 2014 -0500
@@ -34,7 +34,6 @@
 - Manager should handle the HgWeb configuration file settings.
 - Manager should provide a REST API for repository management.
 - Manager should have an API key per user permission values.
-- Specify from command line where to search for a configuration file.
 - Manager should prevent two repositories from using the same display name.
 - Manager should list all managed repositories like Display_Name(Storage_Name).
 - Change functions to use exceptions for error handling, except for the command-line module.
--- a/src/manager.py	Thu Aug 07 21:10:21 2014 -0500
+++ b/src/manager.py	Fri Aug 08 13:15:38 2014 -0500
@@ -43,6 +43,7 @@
 	import os
 	import shutil
 	import filelock as guard
+	import stat
 
 	print "Acquiring manager lock ..."
 	lock = guard.FileLock('HWM')
@@ -249,6 +250,9 @@
 	ignores = {}
 	try:
 		ignores = ignorepo.extract('ignores.xml')
+	except IOError as e:
+		print >>sys.stderr, "Failed to locate ignores, error: %s" % e.message
+		return False
 	except xml.parsers.expat.ExpatError as e:
 		print >>sys.stderr, "Failed to extract ignores, error: %s" % e.message
 		return False
@@ -400,7 +404,7 @@
 
 	parser = SafeConfigParser()
 	if not parser.read(settings.HgWebPath + os.sep + 'hgweb.config'):
-		print >>sys.stderr, "Failed to located HgWeb configuration file."
+		print >>sys.stderr, "Failed to locate HgWeb configuration file."
 		return False
 
 	if parser.has_section('paths'):
@@ -542,7 +546,7 @@
 
 	parser = SafeConfigParser()
 	if not parser.read(settings.HgWebPath + os.sep + 'hgweb.config'):
-		print >>sys.stderr, "Failed to located HgWeb configuration file."
+		print >>sys.stderr, "Failed to locate HgWeb configuration file."
 		return False
 
 	if parser.has_section('paths'):