[Spambayes] ini file fumbling broke
Tim Stone - Four Stones Expressions
tim at fourstonesExpressions.com
Wed Feb 12 22:11:19 EST 2003
2/12/2003 9:33:36 PM, "Meyer, Tony" <T.A.Meyer at massey.ac.nz> wrote:
>> Someone recently decreed that all files mentioned in
>> BAYESCUSTOMIZE must end
>> in ".ini" and modified Options.py (I named my customize file
>> ~/hammie.opt).
>> Was this related to the embedded-spaces-in-paths problem?
>
>Yes. TimS used the magic of regex to 'fix' this problem. To be fair, it did
fix that problem... ;)
Guilty as charged. .ini seemed to be the agreed upon extension. If we can
agree upon some set of extensions, the solution still works. If not, then
we'll have to comma separate or something like that. The wind'ohs way of
handling this is to double quote the filename if spaces are embedded. Doesn't
matter to me, wasn't my itch in the first place... <wink> -TimS
>
>> If spaces are common in filenames, we need to pick a better
>> separator.
>[...]
>> Thoughts?
>
>(I suggested this prior to the regex fix, but it became obsolete).
>
>What about tokenising the separator character?
>
>i.e. a function SafeifyFilename (with a better name, obviously) takes a
file+path (string) and returns a string with the separator character (whatever
it is) replaced by a special character string, and all instances of the
special character string by another one. For example if the separator was a
space, then spaces would be replaced by (eg) '/s', and '/' would be replaced
by '//'. Another function, UnsafeifyFilename, would take that string and
replace all the '/s' substrings by a space, and all the '//' substrings by
'/'. The separator character and the '/' character could be some global or
option somewhere, it doesn't really mattter.
>
>I'd suggest in code, but I imagine that regex is the nicest way to do this,
and I'm not so good at regex.
>
>Isn't this the 'usual' way of handling this sort of problem?
>
>=Tony Meyer
>
>_______________________________________________
>Spambayes mailing list
>Spambayes at python.org
>http://mail.python.org/mailman/listinfo/spambayes
>
>
c'est moi - TimS
http://www.fourstonesExpressions.com
http://wecanstopspam.org
More information about the Spambayes
mailing list