refactor some cwd code and start setting some vte attributes

This commit is contained in:
Chris Jones 2009-08-11 23:48:19 +01:00
parent f110bca103
commit 4150249f87
2 changed files with 13 additions and 2 deletions

View File

@ -5,9 +5,16 @@
import platform import platform
import os import os
import pwd
from util import dbg from util import dbg
def get_pidcwd(): def get_default_cwd():
"""Determine a reasonable default cwd"""
cwd = os.getcwd()
if not os.path.exists(cwd) or not os.path.isdir(cwd):
cwd = pwd.getpwuid(os.getuid())[5]
def get_pid_cwd():
"""Determine an appropriate cwd function for the OS we are running on""" """Determine an appropriate cwd function for the OS we are running on"""
func = lambda pid: None func = lambda pid: None

View File

@ -4,7 +4,6 @@
"""terminal.py - classes necessary to provide Terminal widgets""" """terminal.py - classes necessary to provide Terminal widgets"""
import sys import sys
import pygtk import pygtk
pygtk.require('2.0') pygtk.require('2.0')
import gobject import gobject
@ -22,6 +21,8 @@ except ImportError:
ERROR.run() ERROR.run()
sys.exit(1) sys.exit(1)
from cwd import get_pid_cwd, get_default_cwd
class Terminal(gtk.VBox): class Terminal(gtk.VBox):
"""Class implementing the VTE widget and its wrappings""" """Class implementing the VTE widget and its wrappings"""
@ -32,5 +33,8 @@ class Terminal(gtk.VBox):
gtk.VBox.__init__(self) gtk.VBox.__init__(self)
self.vte = vte.Terminal() self.vte = vte.Terminal()
self.vte.set_size(80, 24)
self.vte._expose_data = None
self.vte.show()
# vim: set expandtab ts=4 sw=4: # vim: set expandtab ts=4 sw=4: