From: Oleg Broytman Date: Tue, 9 Jul 2013 01:03:44 +0000 (+0000) Subject: Get filesystem encoding from config X-Git-Tag: v4.0.0~8 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=807ba6a14b26938e70d59a2e7a1f67d31be9598c;p=xsetbg.git Get filesystem encoding from config git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@60 143022c7-580b-0410-bae3-87f2bf5d3141 --- diff --git a/print-filename.py b/print-filename.py index 0c8e8f9..6d14255 100755 --- a/print-filename.py +++ b/print-filename.py @@ -62,7 +62,12 @@ else: filename = global_db[key] global_db.close() -from m_lib.defenc import default_encoding -filename = unicode(filename, default_encoding) +from ConfigParser import SafeConfigParser +config = SafeConfigParser() +config.read("xsetbg.conf") + +fs_encoding = config.get("images", "fs_encoding") +filename = unicode(filename, fs_encoding) +from m_lib.defenc import default_encoding print filename.encode(default_encoding) diff --git a/xsetbg.conf b/xsetbg.conf index cda0176..3dd1bf5 100644 --- a/xsetbg.conf +++ b/xsetbg.conf @@ -1,4 +1,5 @@ [images] +fs_encoding = koi8-r directory0 = ~/lib/xsetbg/images [httpd]