Пример #1
0
def read_output(command, probar):
    call('service hald stop', shell=True)
    GLib.idle_add(update_progess, probar, "Creating pcinstall.cfg")

    # If rc.conf.ghostbsd exists run gbsd_cfg
    if os.path.exists(rcconfgbsd):
        gbsd_cfg()
        call('umount /media/GhostBSD', shell=True)
    # If rc.conf.desktopbsd exists run dbsd_cfg
    elif os.path.exists(rcconfdbsd):
        dbsd_cfg()
        call('umount /media/DESKTOPBSD', shell=True)
    sleep(2)
    if os.path.exists(tmp + 'delete'):
        GLib.idle_add(update_progess, probar, "Deleting partition")
        rDeleteParttion()
        sleep(1)
    # destroy disk partition and create scheme
    if os.path.exists(tmp + 'destroy'):
        GLib.idle_add(update_progess, probar, "Creating disk partition")
        destroyParttion()
        sleep(1)
    # create partition
    if os.path.exists(tmp + 'create'):
        GLib.idle_add(update_progess, probar, "Creating new partitions")
        makingParttion()
        sleep(1)
    p = Popen(command,
              shell=True,
              stdin=PIPE,
              stdout=PIPE,
              stderr=STDOUT,
              close_fds=True)
    while True:
        line = p.stdout.readline()
        if not line:
            break
        bartext = line.rstrip()
        GLib.idle_add(update_progess, probar, bartext)
        # Those for next 4 line is for debugin only.
        # filer = open("/tmp/.gbi/tmp", "a")
        # filer.writelines(bartext)
        # filer.close
        print(bartext)
    call('service hald start', shell=True)
    if bartext.rstrip() == "Installation finished!":
        Popen('python2 %send.py' % gbi_path, shell=True, close_fds=True)
        call("rm -rf /tmp/.gbi/", shell=True, close_fds=True)
        Gtk.main_quit()
    else:
        Popen('python2 %serror.py' % gbi_path, shell=True, close_fds=True)
        Gtk.main_quit()
Пример #2
0
    def __init__(self, button3):
        gbsd_cfg()
        cfg_file = open(pcinstallcfg, 'r')
        cfg_text = cfg_file.read()
        cfg_file.close()
        button3.set_sensitive(True)
        # Add a Default vertical box
        self.vbox1 = Gtk.VBox(False, 0)
        self.vbox1.show()
        # Add a second vertical box
        label = Gtk.Label("Installation Summary", name="Header")
        label.set_property("height-request", 40)
        self.vbox1.pack_start(label, False, False, 0)
        grid = Gtk.Grid()
        self.vbox1.pack_start(grid, True, True, 0)
        grid.set_row_spacing(10)
        grid.set_column_spacing(3)
        grid.set_column_homogeneous(True)
        grid.set_row_homogeneous(True)
        grid.set_margin_left(10)
        grid.set_margin_right(10)
        grid.set_margin_top(10)
        grid.set_margin_bottom(10)
        # Adding a Scrolling Window
        scrolledwindow = Gtk.ScrolledWindow()
        scrolledwindow.set_hexpand(True)
        scrolledwindow.set_vexpand(True)
        scrolledwindow.show()
        grid.attach(scrolledwindow, 0, 1, 3, 1)

        self.textview = Gtk.TextView()
        self.textbuffer = self.textview.get_buffer()
        self.textbuffer.set_text(cfg_text)
        scrolledwindow.add(self.textview)

        # self.wellcometext = Gtk.Label(welltext)
        # self.wellcometext.set_use_markup(True)
        # table = Gtk.Table()
        # table.attach(self.wellcome, 0, 1, 1, 2)
        # wall = Gtk.Label()
        # table.attach(wall, 0, 1, 2, 3)
        # table.attach(self.wellcometext, 0, 1, 3, 4)
        # vhbox.pack_start(table, False, False, 5)
        # image = Gtk.Image()
        # image.set_from_file(logo)
        # image.show()
        # grid.attach(self.wellcome, 1, 1, 3, 1)
        # vhbox.pack_start(image, True, True, 5)
        # grid.attach(vhbox, 2, 2, 2, 9)
        grid.show()
        return
Пример #3
0
def read_output(command, probar):
    call('service hald stop', shell=True)
    GLib.idle_add(update_progess, probar, "Creating pcinstall.cfg")

    # If rc.conf.ghostbsd exists run gbsd_cfg
    if os.path.exists(rcconfgbsd):
        gbsd_cfg()
        call('umount /media/GhostBSD', shell=True)
    # If rc.conf.desktopbsd exists run dbsd_cfg
    elif os.path.exists(rcconfdbsd):
        dbsd_cfg()
        call('umount /media/DESKTOPBSD', shell=True)
    sleep (2)
    if os.path.exists(tmp + 'delete'):
        GLib.idle_add(update_progess, probar, "Deleting partition")
        rDeleteParttion()
        sleep(1)
    # destroy disk partition and create scheme
    if os.path.exists(tmp + 'destroy'):
        GLib.idle_add(update_progess, probar, "Creating disk partition")
        destroyParttion()
        sleep(1)
    # create partition
    if os.path.exists(tmp + 'create'):
        GLib.idle_add(update_progess, probar, "Creating new partitions")
        makingParttion()
        sleep(1)
    p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE,
              stderr=STDOUT, close_fds=True)
    while True:
        line = p.stdout.readline()
        if not line:
            break
        bartext = line.rstrip()
        GLib.idle_add(update_progess, probar, bartext)
        # Those for next 4 line is for debugin only.
        # filer = open("/tmp/.gbi/tmp", "a")
        # filer.writelines(bartext)
        # filer.close
        print(bartext)
    call('service hald start', shell=True)
    if bartext.rstrip() == "Installation finished!":
        Popen('python %send.py' % gbi_path, shell=True, close_fds=True)
        call("rm -rf /tmp/.gbi/", shell=True, close_fds=True)
        Gtk.main_quit()
    else:
        Popen('python %serror.py' % gbi_path, shell=True, close_fds=True)
        Gtk.main_quit()
Пример #4
0
def read_output(command, probar):
    GLib.idle_add(update_progess, probar, "Creating pcinstall.cfg")
    gbsd_cfg()
    sleep(1)
    if os.path.exists(tmp + 'delete'):
        GLib.idle_add(update_progess, probar, "Deleting partition")
        deletePartition()
        sleep(1)
    # destroy disk partition and create scheme
    if os.path.exists(tmp + 'destroy'):
        GLib.idle_add(update_progess, probar, "Creating disk partition")
        destroyPartition()
        sleep(1)
    # create partition
    if os.path.exists(tmp + 'create'):
        GLib.idle_add(update_progess, probar, "Creating new partitions")
        addPartition()
        sleep(1)
    p = Popen(command,
              shell=True,
              stdin=PIPE,
              stdout=PIPE,
              stderr=STDOUT,
              close_fds=True,
              universal_newlines=True)
    while True:
        line = p.stdout.readline()
        if not line:
            break
        bartext = line.rstrip()
        GLib.idle_add(update_progess, probar, bartext)
        # Those for next 4 line is for debugin only.
        # filer = open("/tmp/.gbi/tmp", "a")
        # filer.writelines(bartext)
        # filer.close
        print(bartext)
    if bartext.rstrip() == "Installation finished!":
        Popen(f'python {gbi_path}end.py', shell=True, close_fds=True)
        Gtk.main_quit()
    else:
        Popen(f'python {gbi_path}error.py', shell=True, close_fds=True)
        Gtk.main_quit()