#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 作者: ptptptptptpt < ptptptptptpt@163.com >
# 使用方法: sudo sh main.sh
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import os
import gtk
import vte
import user
class MainWindow(gtk.Window):
def __init__(self, parent=None):
gtk.Window.__init__(self)
self.connect('destroy', gtk.main_quit)
self.set_title('ubuntu-cloner v3.3.7')
self.set_icon_from_file('pics/ubuntu-cloner.png')
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.set_resizable(True)
vbox = gtk.VBox()
self.add(vbox)
hbox0 = gtk.HBox()
hbox1 = gtk.HBox()
hbox2 = gtk.HBox()
hbox1.set_border_width(10)
button1 = gtk.Button('克隆当前系统')
button1.set_border_width(9)
button1.connect('clicked', self.clone, None)
size = button1.size_request()
button1.set_size_request(size[0]+10, size[1]+30)
hbox1.pack_start(button1, expand = True)
button2 = gtk.Button('备份当前系统')
button2.set_border_width(9)
button2.connect('clicked', self.backup_current, None)
size = button2.size_request()
button2.set_size_request(size[0]+10, size[1]+30)
hbox1.pack_start(button2, expand = True)
button3 = gtk.Button('恢复系统')
button3.set_border_width(9)
button3.connect('clicked', self.restore, None)
size = button3.size_request()
button3.set_size_request(size[0]+36, size[1]+30)
hbox1.pack_start(button3, expand = True)
self.vte1 = vte.Terminal()
self.vte1.set_size_request(600, 320)
self.vte1.connect ("child-exited", self.on_vte_exit, None)
self.vte1.feed('请选择一个任务...')
scrollbar = gtk.VScrollbar()
adjustment = self.vte1.get_adjustment()
scrollbar.set_adjustment(adjustment)
hbox2.set_border_width(5)
hbox2.pack_start(self.vte1)
hbox2.pack_start(scrollbar, expand=False)
vbox.pack_start(hbox0, False)
vbox.pack_start(hbox1, False)
vbox.pack_start(hbox2, False)
def on_vte_exit(self, vte, data):
self.vte1.feed('\n\n子进程已终止。')
def clone(self, widget, data):
self.vte1.reset(True,True)
command_string = './ubuntu-cloner-main.sh clone'
command = command_string.split(' ')
self.vte1.fork_command(command=command[0], argv=command)
def backup_current(self, widget, data):
self.vte1.reset(True,True)
command_string = './ubuntu-cloner-main.sh backup'
command = command_string.split(' ')
self.vte1.fork_command(command=command[0], argv=command)
def restore(self, widget, data):
self.vte1.reset(True,True)
command_string = './ubuntu-cloner-main.sh restore'
command = command_string.split(' ')
self.vte1.fork_command(command=command[0], argv=command)
def main():
win = MainWindow();
win.show_all()
gtk.main()
if __name__ == '__main__':
main()
Ubuntu-Cloner系统备份、恢复、克隆、批量部署
5星 · 超过95%的资源 需积分: 34 133 浏览量
2010-06-28
13:50:51
上传
评论 1
收藏 15KB GZ 举报
lzy90201
- 粉丝: 1
- 资源: 2
最新资源
- XILINXFPGA源码Xilinxspratan3xcs100E(VGAPS2)
- XILINXFPGA源码XilinxSPARTAN-3E入门开发板实例
- XILINXFPGA源码XilinxSdramVerilog和VHDL版本文档
- 物联网智能家居方案-基于Nucleo-STM32L073&机智云(大赛作品,文档齐全,可直接运行)(文档加Matlab源码)
- XILINXFPGA源码XilinxISE9.xFPGACPLD设计源码
- 成都市地图含高新区(高新南区,高新西区),天府新区,东部新区虚拟行政区划
- XILINXFPGA源码XilinxEDK设计试验
- XILINXFPGA源码XilinxEDKMicroBlaze内置USB固件程序
- 基于 django 的视频点播后台管理系统源代码+数据库
- 基于Java的网上医院预约挂号系统的设计与实现(部署视频)-kaic.mp4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论1