summaryrefslogtreecommitdiffstats
path: root/server/yaml/implicit.py
diff options
context:
space:
mode:
authorSeth Vidal <skvidal@fedoraproject.org>2007-09-20 21:28:51 -0400
committerSeth Vidal <skvidal@fedoraproject.org>2007-09-20 21:28:51 -0400
commit8d168259f1cb0af25a7ee342bd1c32cd5bfdd424 (patch)
tree9c1d80b6da18a902b03ba7b21ec6bd0a60aabbfa /server/yaml/implicit.py
parenta83c4bcc40aae7c8b8058d831667ee1e07a969dc (diff)
parent98010f591948fb4bf297c1c0c32def42f766edca (diff)
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
* 'master' of ssh://git.fedoraproject.org/git/hosted/func: (27 commits) just a friendly reminder we are not vf_server, change I!*N domain Add virt module. Add test code for virt. add a very simple, very dumb commandline client: Remove messages.pot from po dir, since its automatically generated Get rid of extra / in module loading error pychecker cleanups Add po dir to git Prevent XMLRPC server from printing to console. Catch FuncException when the config file is missing and exit gracefully Implement a quickie service control module Removing VF items + misc cleanup Clean up some speclint warnings Baseobj bites the dust. remove all the --debug "try to run from the src tree" crap debug spew cleanup to protect the unwashed masses from foo poisoning fix up config_data to use ConfigParser correctly attempt to let us run with --debug flag to run from src checkout attempts at letting us run from a installed, or local modules ...
Diffstat (limited to 'server/yaml/implicit.py')
-rwxr-xr-xserver/yaml/implicit.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/server/yaml/implicit.py b/server/yaml/implicit.py
deleted file mode 100755
index 6172564..0000000
--- a/server/yaml/implicit.py
+++ /dev/null
@@ -1,46 +0,0 @@
-import re
-import string
-from timestamp import timestamp, matchTime
-
-DATETIME_REGEX = re.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}$")
-FLOAT_REGEX = re.compile("^[-+]?[0-9][0-9,]*\.[0-9]*$")
-SCIENTIFIC_REGEX = re.compile("^[-+]?[0-9]+(\.[0-9]*)?[eE][-+][0-9]+$")
-OCTAL_REGEX = re.compile("^[-+]?([0][0-7,]*)$")
-HEX_REGEX = re.compile("^[-+]?0x[0-9a-fA-F,]+$")
-INT_REGEX = re.compile("^[-+]?(0|[1-9][0-9,]*)$")
-
-def convertImplicit(val):
- if val == '~':
- return None
- if val == '+':
- return 1
- if val == '-':
- return 0
- if val[0] == "'" and val[-1] == "'":
- val = val[1:-1]
- return string.replace(val, "''", "\'")
- if val[0] == '"' and val[-1] == '"':
- if re.search(r"\u", val):
- val = "u" + val
- unescapedStr = eval (val)
- return unescapedStr
- if matchTime.match(val):
- return timestamp(val)
- if INT_REGEX.match(val):
- return int(cleanseNumber(val))
- if OCTAL_REGEX.match(val):
- return int(val, 8)
- if HEX_REGEX.match(val):
- return int(val, 16)
- if FLOAT_REGEX.match(val):
- return float(cleanseNumber(val))
- if SCIENTIFIC_REGEX.match(val):
- return float(cleanseNumber(val))
- return val
-
-def cleanseNumber(str):
- if str[0] == '+':
- str = str[1:]
- str = string.replace(str,',','')
- return str
-