aboutsummaryrefslogtreecommitdiff
path: root/ventoo
blob: c7bff1c3832879f1aa307cec66f8cc0cec49bc19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python

import sys
import pygtk
pygtk.require('2.0')
import gtk
import os.path as osp
import ventoo.main
import augeas
import shutil
import os

sandboxDir = '/'

if len(sys.argv) > 1:
    sandboxDir = sys.argv[1]
if not osp.isdir(sandboxDir):
    print(sandboxDir + " is not a directory.")
    sys.exit(0)
        
print('Starting augeas...')
    #None could be a 'loadpath'
a = augeas.Augeas(sandboxDir, None, augeas.Augeas.SAVE_NEWFILE)
print('Creating window...')

ventoo.main.sandboxDir = sandboxDir
sys.path.append("/tmp")

#Note, it IS possible to create mutiple windows and augeas
#instances to edit multiple "roots" at the same time. 
window = ventoo.main.MainWindow(a)
window.show_all()
window.hideApplyDiffButton() #TODO: overload show_all to preserve apply button state.

#clear the diff storage place...
shutil.rmtree(ventoo.augeas_utils.getDiffRoot(), True)
os.makedirs(ventoo.augeas_utils.getDiffRoot())
gtk.main()