]> git.decadent.org.uk Git - dak.git/blobdiff - utils.py
Fix checking for source files with +'s in them.
[dak.git] / utils.py
index ef86b5adc736f80ed8afd30814236e9f5a144f1a..409113ef93da6dad8084e3245d088fe995c6e0d4 100644 (file)
--- a/utils.py
+++ b/utils.py
@@ -1,6 +1,6 @@
 # Utility functions
 # Copyright (C) 2000  James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.5 2000-11-30 04:19:30 troup Exp $
+# $Id: utils.py,v 1.6 2000-12-01 17:33:29 troup Exp $
 
 # 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
@@ -256,3 +256,12 @@ def which_conf_file ():
 
 ######################################################################################
 
+# Escape characters which have meaning to SQL's regex comparison operator ('~')
+# (woefully incomplete)
+
+def regex_safe (s):
+    s = string.replace(s, '+', '\\\\+');
+    return s
+
+######################################################################################
+