summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-01-27 16:18:15 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-01-27 16:18:15 +0100
commit42a17772c7c83261bf4097b53f2396b8fedd4a5e (patch)
tree3285e2170632df92fe20d7a749c2b9ff6f5e4b50 /portato
parent6224da7a5810ef8a9309bc0fd919759e832edcf6 (diff)
downloadportato-42a17772c7c83261bf4097b53f2396b8fedd4a5e.tar.gz
portato-42a17772c7c83261bf4097b53f2396b8fedd4a5e.tar.bz2
portato-42a17772c7c83261bf4097b53f2396b8fedd4a5e.zip
Use session name as default section name
Diffstat (limited to '')
-rw-r--r--portato/session.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/portato/session.py b/portato/session.py
index 440d4bf..89684be 100644
--- a/portato/session.py
+++ b/portato/session.py
@@ -42,6 +42,7 @@ class Session (object):
self._cfg = None
self._handlers = []
+ self._name = name
if not (os.path.exists(SESSION_DIR) and os.path.isdir(SESSION_DIR)):
os.mkdir(SESSION_DIR)
@@ -124,20 +125,26 @@ class Session (object):
self._cfg.write()
- def set (self, key, value, section):
+ def set (self, key, value, section = ""):
+ if not section: section = self._name
+
try:
self._cfg.add(key, value, section, with_blankline = False)
except SectionNotFoundException:
self._cfg.add_section(section)
self._cfg.add(key, value, section, with_blankline = False)
- def get (self, key, section):
+ def get (self, key, section = ""):
+ if not section: section = self._name
+
try:
return self._cfg.get(key, section)
except KeyError:
return None
- def get_boolean (self, key, section):
+ def get_boolean (self, key, section = ""):
+ if not section: section = self._name
+
try:
return self._cfg.get_boolean(key, section)
except KeyError:
href='/dotfiles.git/commit/.zsh/zshrc?id=4595adbc3de01228bb122575264d9385f6cbd9b4&follow=1'>Set terminal title not only on path change, but for each new prompt.René 'Necoro' Neumann1-2/+2 2013-10-22cwd-spawn: Use M-Return instead of M-o for consistency.René 'Necoro' Neumann1-2/+2 2013-10-22Add cwd-spawn to urxvt to allow spawning a new terminal from the currentRené 'Necoro' Neumann3-2/+199 2013-10-22Use chpwd_functions and precmd_functions instead of putting everything inRené 'Necoro' Neumann1-19/+23 2013-09-30urxvt: execute the wgetpaste check each timeRené 'Necoro' Neumann1-2/+5 2013-09-30urxvt: wgetpaste fixRené 'Necoro' Neumann1-4/+4 2013-09-30Allow HOME variable in .Xresources.René 'Necoro' Neumann2-3/+3 2013-09-30wgetpaste support for urxvt.René 'Necoro' Neumann2-1/+28 2013-09-30Urxvt autotransform for <filename>:<line>.René 'Necoro' Neumann1-1/+4 2013-09-30Remove tabbed(x) from urxvt. We use i3 -- no need for it.René 'Necoro' Neumann1-9/+0 2013-09-30Do not display icon in urxvt. It's not supported by i3 anyway.René 'Necoro' Neumann1-1/+1 2013-09-29Remove wrong monitors lineRené 'Necoro' Neumann1-1/+0 2013-09-29Delete vimperator paste plugin -- seems not to work anymore with new FFRené 'Necoro' Neumann1-266/+0 2013-09-29Use $HOST instead of Cauchiy in titleRené 'Necoro' Neumann1-1/+1 2013-09-24Remove herbstluftwmRené 'Necoro' Neumann1-1/+0 2013-09-24Conky changesRené 'Necoro' Neumann2-5/+13 2013-09-15Remove trailing slash from \~ulpRené 'Necoro' Neumann1-1/+1 2013-09-15Make cci explicitly use python2René 'Necoro' Neumann1-1/+1 2013-09-10Node/NPM preparationRené 'Necoro' Neumann3-1/+13