Ejemplo n.º 1
0
def _get_accel_map_filename():
    """
    The Gaphor accelMap file ($HOME/.gaphor/accelmap).
    """

    user_data_dir = get_user_data_dir()

    if not os.path.exists(user_data_dir):
        os.mkdir(user_data_dir)
    return os.path.join(user_data_dir, 'accelmap')
Ejemplo n.º 2
0
def _get_accel_map_filename():
    """
    The Gaphor accelMap file ($HOME/.gaphor/accelmap).
    """
    
    user_data_dir = get_user_data_dir()
    
    if not os.path.exists(user_data_dir):
        os.mkdir(user_data_dir)
    return os.path.join(user_data_dir, 'accelmap')
Ejemplo n.º 3
0
 def load_console_py(self):
     """
     Load default script for console. Saves some repetative typing.
     """
     console_py = os.path.join(get_user_data_dir(), 'console.py')
     try:
         with open(console_py) as f:
             for line in f:
                 self.console.push(line)
     except IOError:
         log.info('No initiation script %s' % console_py)
Ejemplo n.º 4
0
 def load_console_py(self):
     """
     Load default script for console. Saves some repetative typing.
     """
     console_py = os.path.join(get_user_data_dir(), "console.py")
     try:
         with open(console_py) as f:
             for line in f:
                 self.console.push(line)
     except IOError:
         log.info("No initiation script %s" % console_py)
Ejemplo n.º 5
0
 def __init__(self, datadir=get_user_data_dir()):
     """Constructor.  Initialize the directory used for storing 
     properties."""
     
     self.datadir = datadir