]> git.phdru.name Git - xsetbg.git/commitdiff
Get filesystem encoding from config
authorOleg Broytman <phd@phdru.name>
Tue, 9 Jul 2013 01:03:44 +0000 (01:03 +0000)
committerOleg Broytman <phd@phdru.name>
Tue, 9 Jul 2013 01:03:44 +0000 (01:03 +0000)
git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@60 143022c7-580b-0410-bae3-87f2bf5d3141

print-filename.py
xsetbg.conf

index 0c8e8f9369b61158082ac8aac92945bd45415ecc..6d142550f2d1a45fee744ab3981870ae78076355 100755 (executable)
@@ -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)
index cda0176ae92796fd0168ba48870d8bbbb19f5d2f..3dd1bf58b064a48e2165d5d49faf5ad75827db63 100644 (file)
@@ -1,4 +1,5 @@
 [images]
+fs_encoding = koi8-r
 directory0 = ~/lib/xsetbg/images
 
 [httpd]