Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created March 26, 2012 11:00
Show Gist options
  • Select an option

  • Save AeroNotix/2204443 to your computer and use it in GitHub Desktop.

Select an option

Save AeroNotix/2204443 to your computer and use it in GitHub Desktop.
def set_locale_decorator(func):
import locale
if locale.getdefaultlocale()[0] == 'en_GB':
def curr_conv(string):
major_num = ''.join(string.split(','))
return major_num
delim = ','
elif locale.getdefaultlocale()[0] == 'de_DE':
def curr_conv(string):
major_num = string.replace('.', '').replace(',', '.')
return major_num
delim = ';'
else:
print "Locale settings not supported"
print
print "press Q to quit, or any other key to continue"
print "with default settings and hope that you don't"
print "end up with a crazy output."
key_in = raw_input("Enter your choice:")
if key_in.lower() == 'q':
quit()
else:
def curr_conv(string):
major_num = ''.join(string.split(','))
return major_num
delim = ','
return func
@set_locale_decorator
def whatevers(x, y):
print x, y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment