I'm not able to display a new line in 'gi.repository Notification'. It works when i use string constant within a program, but fails when i read string from configuration file using ConfigParser class.
test.ini
[NOTIFICATIONS]
test1 = Hello,\n{username}!
test.py:
import ConfigParser
from gi.repository import Notify
# notifyText = "Hello, {username}" - will work
data = {'username': 'sudo', 'test': 'test'}
if __name__ == '__main__':
cfg = ConfigParser.ConfigParser()
cfg.read('test.ini')
notifyText = cfg.get('NOTIFICATIONS', 'test1').format(**data)
Notify.init('Test')
notification = Notify.Notification('Test', notifyText)
notification.show()
The output of current program will be: 'Hello\nsudo!' However, if i hardcode this string (commented line) in my program then it's displayed as it should.