- edited description
locale
Because script is run after reboot by root before locales are properly loaded (or something like that) POSIX locales are used. This is problem because I need non English ones for proper names of days/months.
If I run Medio.py manual, everything is OK.
Can You add locales configurable during installing proces? (add it also to cfg.ini)
List of supported locales in DSM 6.1: (locale -a)
C
cs_CZ.utf8
da_DK.utf8
de_DE.utf8
en_US.utf8
es_ES.utf8
fr_FR.utf8
hu_HU.utf8
it_IT.utf8
ja_JP.utf8
ko_KR.utf8
nb_NO.utf8
nl_NL.utf8
pl_PL.utf8
POSIX
pt_BR.utf8
pt_PT.utf8
ru_RU.utf8
sv_SE.utf8
tr_TR.utf8
zh_CN.utf8
zh_TW.utf8
I've try minor fix located on the end of script (Source, destination, ...):
os.environ['LC_ALL'] = 'cs_CZ.utf8'
which solve the problem.
Comments (7)
-
reporter -
repo owner Thanks for the report and the diff! I’ll take a look when I get a chance and release a new version.
- JP
-
repo owner Where did you add the
os.environ['LC_ALL'] = 'cs_CZ.utf8'
exactly? -
reporter Just at the end of Medio.py
if __name__ == '__main__': try: cfg = Config() workq = Queue.Queue() watchq = Queue.Queue() worker = Worker(cfg, workq) watcher = Watcher(cfg, workq, watchq) wm = pyinotify.WatchManager() notifier = pyinotify.Notifier(wm, EventHandler(cfg, workq, watchq)) mask = pyinotify.IN_CREATE | pyinotify.IN_MOVED_TO | pyinotify.IN_CLOSE_WRITE wdd = wm.add_watch(os.path.join(PHOTO_DIR, cfg.UI_SRCDIR), mask) os.environ['LC_ALL'] = 'cs_CZ.utf8' log('Source directory: %s' % os.path.join(PHOTO_DIR, cfg.UI_SRCDIR)) log('Destination directory: %s' % os.path.join(PHOTO_DIR, cfg.UI_DSTDIR)) log('Destination filename format: %s' % cfg.UI_DSTFMT) log('Watching for changes...') notifier.loop() except: err = traceback.format_exc(2) log(err)
-
repo owner - changed status to resolved
fix issue
#12: force locale→ <<cset 57b6986e22d0>>
-
repo owner Good news!
This will be in the 1.0 package. It’s now a configuration option during install.
https://bitbucket.org/polandj/medio/commits/57b6986e22d0bec44b3663116a9cb3d400412edf
-
reporter Thank a lot! It is really helpful. Just small request - a list of available locales will help other not so skilled users to choose.
- Log in to comment