Skip to content

Commit 0a3e6db

Browse files
committed
rename getLocale to get_locale , to allow python param define
1 parent ce6b4e5 commit 0a3e6db

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lazyscripts/command.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def _get_user_preferpool(self):
251251
#{{{def _ask_user_selectpool(self):
252252
def _ask_user_selectpool(self):
253253
conf = env.resource('config')
254-
lang = env.getLocale()
254+
lang = env.get_locale()
255255
pools = conf.get_support_pools(distro.Distribution().name, distro.Distribution().version, lang)
256256
if not pools:
257257
pools = conf.get_support_pools(distro.Distribution().name, distro.Distribution().version, 'en_US')

lazyscripts/console.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _build_scripts_index(self):
4646
for poolname in os.listdir(root):
4747
poolpath = os.path.join(root, poolname)
4848
pool = lzspool.ScriptsPool(poolpath)
49-
for cat, scripts in pool.scripts(None, env.getLocale()).items():
49+
for cat, scripts in pool.scripts(None, env.get_locale()).items():
5050
if not scripts: continue
5151
for script in scripts:
5252
contents.append("%s/%s/%s - %s " % (poolname, cat, script.id, script.name))

lazyscripts/env.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def get_realhome():
4545
return ''.join(lines[2][17:]).replace('\n','').replace('"','')
4646
#}}}
4747

48-
#{{{def getLocale():
49-
def getLocale():
48+
#{{{def get_locale():
49+
def get_locale():
5050
lang = os.getenv('LANG')
5151
try:
5252
# zh_TW.UTF-8 or zh_TW:zh.UTF-8
@@ -183,7 +183,7 @@ def resource(query):
183183

184184
#{{{def prepare_runtimeenv():
185185
def prepare_runtimeenv():
186-
lang = getLocale()
186+
lang = get_locale()
187187
if lang == 'en_US':
188188
locale.setlocale (locale.LC_ALL, "en_US.UTF-8")
189189
else:

lazyscripts/gui/gtklib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def download_scripts (self):
306306
#{{{def load_tree(self, list_store):
307307
def load_tree(self, list_store):
308308
self.download_scripts()
309-
lzs_loc = env.getLocale()
309+
lzs_loc = env.get_locale()
310310
use_recommand = query_yes_no(_('gui.gtklib.toolpage.query_recommand'))
311311
for category in self.pool.categories():
312312
tool_page = ToolPage()

0 commit comments

Comments
 (0)