mythbuntu-dev team mailing list archive
-
mythbuntu-dev team
-
Mailing list archive
-
Message #00035
[Merge] lp:~tgm4883/mythbuntu/mythbuntu-common into lp:~mythbuntu/mythbuntu/mythbuntu-common
Thomas Mashos has proposed merging lp:~tgm4883/mythbuntu/mythbuntu-common into lp:~mythbuntu/mythbuntu/mythbuntu-common.
Requested reviews:
mythbuntu-dev (mythbuntu-dev)
Related bugs:
#565769 Codec loading problem in MCC 10.04
https://bugs.launchpad.net/bugs/565769
Added mythbuntu-bare
--
https://code.launchpad.net/~tgm4883/mythbuntu/mythbuntu-common/+merge/32386
Your team mythbuntu-dev is requested to review the proposed merge of lp:~tgm4883/mythbuntu/mythbuntu-common into lp:~mythbuntu/mythbuntu/mythbuntu-common.
=== modified file 'debian/changelog'
--- debian/changelog 2010-03-28 05:57:52 +0000
+++ debian/changelog 2010-08-11 21:17:40 +0000
@@ -1,3 +1,32 @@
+mythbuntu-common (0.50-0ubuntu2) UNRELEASED; urgency=low
+
+ * Added Mythbuntu-bare plugin
+
+ -- Thomas Mashos <tgm4883@xxxxxxxxx> Wed, 11 Aug 2010 14:12:48 -0700
+
+mythbuntu-common (0.50-0ubuntu1) lucid; urgency=low
+
+ * Added PATH to proprietary codecs plugin (LP: #565769)
+
+ -- Thomas Mashos <tgm4883@xxxxxxxxx> Sun, 18 Apr 2010 16:42:31 -0700
+
+mythbuntu-common (0.49-0ubuntu2) lucid; urgency=low
+
+ * debian/control:
+ - Depends on vnc4server instead since vnc4-common has been removed
+ from the archive.
+
+ -- Mario Limonciello <superm1@xxxxxxxxxx> Sat, 03 Apr 2010 19:23:02 -0500
+
+mythbuntu-common (0.49-0ubuntu1) lucid; urgency=low
+
+ * debian/control:
+ - Update branches to pull from ~mythbuntu-dev
+ * debian/mythbuntu.make:
+ - Set packages to pull from ~mythbuntu-dev
+
+ -- Mario Limonciello <superm1@xxxxxxxxxx> Sat, 03 Apr 2010 17:41:54 -0500
+
mythbuntu-common (0.48-0ubuntu1) lucid; urgency=low
[ Marc Randolph ]
=== modified file 'debian/control'
--- debian/control 2010-03-28 05:57:29 +0000
+++ debian/control 2010-08-11 21:17:40 +0000
@@ -3,8 +3,8 @@
Priority: optional
Maintainer: Ubuntu MythTV Team <ubuntu-mythtv@xxxxxxxxxxxxxxxx>
Build-Depends: debhelper (>=7), python-central, python, python-distutils-extra
-XS-Vcs-Bzr: http://bazaar.launchpad.net/~mythbuntu/mythbuntu/mythbuntu-common
-XS-Vcs-Browser: http://codebrowse.launchpad.net/~mythbuntu/mythbuntu/mythbuntu-common
+XS-Vcs-Bzr: http://bazaar.launchpad.net/~mythbuntu-dev/mythbuntu/mythbuntu-common
+XS-Vcs-Browser: http://codebrowse.launchpad.net/~mythbuntu-dev/mythbuntu/mythbuntu-common
XS-Python-Version: current
Standards-Version: 3.8.4
@@ -15,7 +15,7 @@
python-pexpect,
python-xkit,
python-mysqldb,
- vnc4-common,
+ vnc4server | vnc4-common,
python-gconf,
lsb-release,
software-properties-gtk,
=== modified file 'debian/mythbuntu.make'
--- debian/mythbuntu.make 2010-02-16 06:51:09 +0000
+++ debian/mythbuntu.make 2010-08-11 21:17:40 +0000
@@ -2,7 +2,7 @@
DEB_SOURCE_PACKAGE+=$(shell egrep '^Source: ' debian/control | cut -f2 -d ' ')
DEB_UPSTREAM_VERSION+=$(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ' | cut -d: -f2- | sed 's/-[^-]*$$//')
-BZR_BRANCH+=http://bazaar.launchpad.net/~mythbuntu/mythbuntu/$(DEB_SOURCE_PACKAGE)
+BZR_BRANCH+=http://bazaar.launchpad.net/~mythbuntu-dev/mythbuntu/$(DEB_SOURCE_PACKAGE)
TARFILE+=$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz
get-orig-source:
=== modified file 'debian/rules'
--- debian/rules 2010-03-28 05:57:52 +0000
+++ debian/rules 2010-08-11 21:17:40 +0000
@@ -1,5 +1,5 @@
#!/usr/bin/make -f
-BZR_REVISION+=213
+BZR_REVISION+=221
include debian/mythbuntu.make
#We can't use the one from mythbuntu.make because it likes Makefiles more than setup.py
=== added file 'plugins/python/mythbackup.py'
--- plugins/python/mythbackup.py 1970-01-01 00:00:00 +0000
+++ plugins/python/mythbackup.py 2010-08-11 21:17:40 +0000
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+import os
+import tarfile
+import time
+import shutil
+import subprocess
+
+class Backup():
+
+ def BackupJob(self, Location, BackupDB):
+ """Backup all the files"""
+ ## Array of files to Backup
+ BACKUPFILES = [
+ "/etc/mythtv/config.xml",
+ "/etc/mythtv/mysql.txt",
+ "/etc/lirc/lircd.conf",
+ "/etc/lirc/hardware.conf",
+ "/etc/hostname",
+ "/etc/hosts",
+ ]
+ USER=os.getenv("HOME")
+ BACKUPFILES.append(USER+"/.lirc")
+ ## Set up backup location
+ TMPDIR="/tmp/mythbuntu-bare"
+ if not os.path.exists(TMPDIR):
+ os.makedirs(TMPDIR)
+ BACKUPFILES.append(TMPDIR)
+ ## Set status file
+ STATUSFILE="/tmp/mythbuntu-bare-status"
+ if os.path.isfile(STATUSFILE):
+ os.remove(STATUSFILE)
+ timestamp=time.strftime("%Y%m%d-%H%M", time.localtime())
+ ## Backup database only if told to do so
+ if BackupDB == True:
+ os.system("echo '20\nBacking up database (this could take a few minutes)'>"+STATUSFILE)
+# os.system("echo '20' > "+STATUSFILE)
+# os.system("echo 'Backing up database (this could take a few minutes)' >> "+STATUSFILE)
+ #Run DB Backup
+ #/usr/share/mythtv/mythconverg_backup.pl
+ ## Temp testing backup script location. Need to pull backup script from mythtv-backend as backup doesn't require that. Can be run from a frontend.
+ backupscript="/home/thomas/test/mythconverg_backup.pl"
+ pipe = subprocess.Popen([backupscript, '--directory', TMPDIR], stdout=subprocess.PIPE).communicate()
+ ## Setup for final tar file
+ tarfilename=Location+'/mythbuntu-system-backup-'+timestamp+'.tar.gz'
+ TF=tarfile.open(tarfilename,mode='w:gz')
+ os.system("echo '90\nZipping up files'>"+STATUSFILE)
+# os.system("echo '90' > "+STATUSFILE)
+# os.system("echo 'Zipping up files' >> "+STATUSFILE)
+ for item in BACKUPFILES:
+ TF.add(item)
+ TF.close()
+ ## Remove tmp Backup directory and status file
+ if os.path.exists(TMPDIR):
+ shutil.rmtree(TMPDIR)
+ if os.path.isfile(STATUSFILE):
+ os.remove(STATUSFILE)
=== added file 'plugins/python/mythbuntu-bare.py'
--- plugins/python/mythbuntu-bare.py 1970-01-01 00:00:00 +0000
+++ plugins/python/mythbuntu-bare.py 2010-08-11 21:17:40 +0000
@@ -0,0 +1,411 @@
+## -*- coding: utf-8 -*-
+#
+# «skeletor» - An Example Plugin for showing how to use MCC as a developer
+#
+# Copyright (C) 2009, Mario Limonciello, for Mythbuntu
+#
+#
+# Mythbuntu 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 application; if not, write to the Free Software Foundation, Inc., 51
+# Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##################################################################################
+
+from MythbuntuControlCentre.plugin import MCCPlugin
+import gtk
+import time
+import os
+import tarfile
+import shutil
+import subprocess
+from mythbackup import Backup
+from mythrestore import Restore
+from threading import Thread
+
+class MythbuntuBaRePlugin(MCCPlugin):
+ """An Example Plugin for showing how to use MCC as a developer"""
+ #
+ #Load GUI & Calculate Changes
+ #
+ CONFIGFILE = "/etc/default/mythbuntu-bare"
+
+ USER=os.getenv("HOME")
+
+ BACKUPFILES = [
+ "/etc/mythtv/config.xml",
+ "/etc/mythtv/mysql.txt",
+ "/etc/lirc/lircd.conf",
+ "/etc/lirc/hardware.conf",
+ ]
+
+ BACKUPFILES.append(USER+"/.lirc")
+
+ BACKUP_LOCATION = USER
+ BACKUP_DB=False
+ restore_file = '/tmp'
+
+ def __init__(self):
+ #Initialize parent class
+ information = {}
+ information["name"] = "Backup and Restore"
+ information["icon"] = "revert"
+ information["ui"] = "tab_mythbuntu-bare"
+ MCCPlugin.__init__(self,information)
+ import ConfigParser
+ self.config = ConfigParser.ConfigParser()
+
+ def captureState(self):
+ """Determines the state of the items on managed by this plugin
+ and stores it into the plugin's own internal structures"""
+ import os
+ self.changes = {}
+ self.changes['backup_schedule'] = os.path.exists('/etc/cron.daily/mythbuntu-bare')
+ if os.path.exists(self.CONFIGFILE):
+ self.config.read(self.CONFIGFILE)
+ self.changes['BackupLocation'] = self.config.get("Backup", "BackupLocation")
+ else:
+ self.changes['BackupLocation'] = "NOWHERE"
+
+ def applyStateToGUI(self):
+ """Takes the current state information and sets the GUI
+ for this plugin"""
+ self.button_box.hide()
+ self.hide_tabs()
+ self.vbox_start.show()
+# self.vbox_backup.hide()
+ self.vbox_restore.hide()
+ self.vbox_choices.hide()
+ self.radio_backup.set_active(False)
+ self.radio_restore.set_active(False)
+ self.backup_now.set_active(False)
+ self.backup_dir_button.set_active(False)
+ self.on_radio_backup_toggled(None)
+ self.on_backup_dir_button_toggled(None)
+# self.on_backup_schedule_toggled(None)
+ if self.changes['backup_schedule']:
+ self.scheduled_label.set_text("Enabled")
+ else:
+ self.scheduled_label.set_text("Disabled")
+ if self.query_installed('mythtv-backend-master') == True:
+ self.db_backup_checkbutton.set_active(True)
+ self.db_backup_checkbutton.set_sensitive(False)
+ else:
+ self.db_backup_checkbutton.set_sensitive(True)
+ self.db_backup_checkbutton.set_active(False)
+ ## Disable non-implemented items
+# self.backup_schedule.set_sensitive(False)
+ self.backup_u1_button.set_sensitive(False)
+ self.backup_dropbox_button.set_sensitive(False)
+# self.radio_restore.set_sensitive(False)
+
+ def compareState(self):
+ """Determines what items have been modified on this plugin"""
+ MCCPlugin.clearParentState(self)
+ if self.radio_backup.get_active():
+ print "BACKUP"
+ if self.backup_dir_button.get_active():
+ self.BACKUP_LOCATION=self.backup_location.get_filename()
+ elif self.backup_u1_button.get_active():
+ #TODO
+ print "U1 Location"
+ elif self.backup_dropbox_button.get_active():
+ #TODO
+ print "Dropbox Location"
+ if self.backup_now.get_active():
+ self._markReconfigureUser('Backup Now',self.BACKUP_LOCATION)
+ elif self.backup_schedule.get_active():
+ #TODO
+ self._markReconfigureRoot('Save Backup Location',self.BACKUP_LOCATION)
+ if self.BACKUP_LOCATION != self.changes['BackupLocation']:
+ self._markReconfigureRoot('backup_location',True)
+ self._markReconfigureRoot('backup_schedule',True)
+# if self.backup_schedule_status.get_active() != self.changes['backup_schedule']:
+# self._markReconfigureRoot('backup_schedule',self.backup_schedule_status.get_active())
+ print "schedule only"
+ if self.db_backup_checkbutton.get_active() == True:
+ self.BACKUP_DB = True
+ else:
+ self.BACKUP_DB = False
+ if self.radio_restore.get_active():
+ self._markReconfigureRoot('restore',self.restore_file.get_filename())
+# if self.restore_db.get_active():
+ self._markReconfigureRoot('restore_db',self.restore_db.get_active())
+
+ #
+ # Callbacks
+ #
+
+# def on_backup_schedule_toggled(self,widget,data=None):
+ #TODO
+# print "Populate setup data"
+# if self.changes['BackupLocation'] != "NOWHERE":
+# self.backup_location.set_filename(self.changes['BackupLocation'])
+
+ def on_restore_file_selection_changed(self,widget,data=None):
+ tarfilename=self.restore_file.get_filename()
+ TF=tarfile.open(tarfilename,mode='r:gz')
+ for line in TF.getnames():
+ if line.endswith('sql.gz'):
+ self.RESTORE_DB_EXISTS=True
+ break
+ else:
+ self.RESTORE_DB_EXISTS=False
+ self.restore_db.set_active(False)
+ TF.close()
+
+ def on_button_started_clicked(self,widget,data=None):
+ self.CUR_TAB = "vbox_choices"
+ self.vbox_start.hide()
+ self.vbox_choices.show()
+ self.button_box.show()
+ self.next_button.set_sensitive(True)
+
+ def on_next_button_clicked(self,widget,data=None):
+ self.change_tab(self.CUR_TAB,"next")
+
+ def on_back_button_clicked(self,widget,data=None):
+ self.change_tab(self.CUR_TAB,"back")
+
+ def change_tab(self,CURRENT,DIRECTION):
+ """Monkee around to display the correct wizard page"""
+ self.hide_tabs()
+ if self.CUR_TAB == "vbox_choices":
+ if DIRECTION == "back":
+ self.CUR_TAB = "vbox_start"
+ self.vbox_start.show()
+ self.button_box.hide()
+ elif DIRECTION == "next":
+ if self.radio_backup.get_active():
+ self.CUR_TAB = "vbox_backup_choice"
+ self.vbox_backup_choice.show()
+ else:
+ self.CUR_TAB = "vbox_restore"
+ self.vbox_restore.show()
+ elif self.CUR_TAB == "vbox_backup_choice":
+ if DIRECTION == "back":
+ self.CUR_TAB = "vbox_choices"
+ self.vbox_choices.show()
+ elif DIRECTION == "next":
+ if self.backup_now.get_active():
+ self.CUR_TAB = "vbox_backup_location"
+ self.vbox_backup_location.show()
+ self.backup_type = "now"
+ elif self.backup_schedule.get_active():
+ self.CUR_TAB = "vbox_backup_schedule"
+ self.vbox_backup_schedule.show()
+ self.backup_type = "scheduled"
+ elif self.CUR_TAB == "vbox_restore":
+ if DIRECTION == "back":
+ self.CUR_TAB = "vbox_choices"
+ self.vbox_choices.show()
+ elif DIRECTION == "next":
+ if self.RESTORE_DB_EXISTS:
+ self.CUR_TAB = "vbox_restore_db"
+ self.vbox_restore_db.show()
+ else:
+ self.CUR_TAB = "vbox_final"
+ self.vbox_final.show()
+ self.next_button.set_sensitive(False)
+ elif self.CUR_TAB == "vbox_restore_db":
+ if DIRECTION == "back":
+ self.CUR_TAB = "vbox_restore"
+ self.vbox_restore.show()
+ elif DIRECTION == "next":
+ self.CUR_TAB = "vbox_final"
+ self.vbox_final.show()
+ self.next_button.set_sensitive(False)
+ elif self.CUR_TAB == "vbox_backup_location":
+ if DIRECTION == "back":
+ if self.backup_type == "now":
+ self.CUR_TAB = "vbox_backup_choice"
+ self.vbox_backup_choice.show()
+ elif self.backup_type == "scheduled":
+ self.CUR_TAB = "vbox_backup_schedule"
+ self.vbox_backup_schedule.show()
+ elif DIRECTION == "next":
+ self.CUR_TAB = "vbox_final"
+ self.vbox_final.show()
+ self.next_button.set_sensitive(False)
+ elif self.CUR_TAB == "vbox_backup_schedule":
+ if DIRECTION == "back":
+ self.CUR_TAB = "vbox_backup_choice"
+ self.vbox_backup_choice.show()
+ elif DIRECTION == "next":
+ self.CUR_TAB = "vbox_backup_location"
+ self.vbox_backup_location.show()
+ elif self.CUR_TAB == "vbox_final":
+ if DIRECTION == "back":
+ self.next_button.set_sensitive(True)
+ if self.radio_backup.get_active():
+ self.CUR_TAB = "vbox_backup_location"
+ self.vbox_backup_location.show()
+ else:
+ if self.RESTORE_DB_EXISTS:
+ self.CUR_TAB = "vbox_restore_db"
+ self.vbox_restore_db.show()
+ else:
+ self.CUR_TAB = "vbox_restore"
+ self.vbox_restore.show()
+
+ def on_radio_backup_toggled(self,widget,data=None):
+ """Show backup or restore settings depeding on user input"""
+ was_selected = self.radio_backup.get_active()
+# if was_selected:
+# self.vbox_backup.show()
+# self.vbox_restore.hide()
+# else:
+# self.vbox_backup.hide()
+# self.vbox_restore.show()
+
+ def on_backup_dir_button_toggled(self,widget,data=None):
+ """Prompt user for save location if needed"""
+ self.hide_all()
+ if self.backup_dir_button.get_active():
+ self.backup_location.show()
+ elif self.backup_u1_button.get_active():
+ self.preconfigured_label.show()
+ elif self.backup_dropbox_button.get_active():
+ self.preconfigured_label.show()
+ else:
+ print "Error: Unknown option selected"
+
+# def on_backup_schedule_toggled(self,widget,data=None):
+# """Show backup schedule options if needed"""
+# if self.backup_schedule.get_active():
+# self.backup_schedule_status.show()
+# if self.changes['BackupLocation'] != "NOWHERE":
+# self.backup_location.set_filename(self.changes['BackupLocation'])
+# else:
+# self.backup_schedule_status.hide()
+
+ def hide_tabs(self):
+ self.vbox_start.hide()
+ self.vbox_restore.hide()
+ self.vbox_restore_db.hide()
+ self.vbox_backup_schedule.hide()
+ self.vbox_choices.hide()
+ self.vbox_backup_choice.hide()
+ self.vbox_backup_location.hide()
+ self.vbox_final.hide()
+
+ def hide_all(self):
+ """Hide everything before showing what is needed"""
+ self.preconfigured_label.hide()
+ self.backup_location.hide()
+
+ #
+ # Process selected activities
+ #
+
+ def root_scripted_changes(self,reconfigure):
+ """System-wide changes that need root access to be applied.
+ This function is ran by the dbus backend"""
+# self.emit_progress("Setting to 20 percent as a root", 20)
+ self.config.add_section("Backup")
+ time.sleep(2)
+ RESTORE_SET=False
+ RESTORE_DB_SET=False
+ STATUSFILE = "/tmp/mythbuntu-bare-status"
+# print RESTORE_DB_SET
+# print RESTORE_SET
+# for item in self.BACKUPFILES:
+# print item
+ for item in reconfigure:
+ if item == "Save Backup Location":
+ self.BACKUP_LOCATION = reconfigure[item]
+ for item in reconfigure:
+ if item == "backup_location":
+ self.emit_progress("Setting to 40 percent as a root", 40)
+ time.sleep(2)
+ self.config.set("Backup", "backuplocation", self.BACKUP_LOCATION)
+ with open('/etc/default/mythbuntu-bare', 'wb') as configfile:
+ self.config.write(configfile)
+ if item == "backup_schedule":
+ #TODO
+ if reconfigure[item]:
+ self.emit_progress("Setting to 60 percent as a root", 60)
+ time.sleep(2)
+ file = open('/etc/cron.daily/mythbuntu-bare', "w")
+ location = self.BACKUP_LOCATION
+ self.emit_progress("Setting to 80 percent as a root", 80)
+ time.sleep(2)
+ #TODO
+ file.writelines("Testing"+location)
+ file.close()
+ else:
+ import os
+ os.remove('/etc/cron.daily/mythbuntu-bare')
+ if item == "restore":
+ RESTORE_LOCATION=reconfigure[item]
+ RESTORE_SET=True
+ if item == "restore_db":
+ RESTORE_DB=reconfigure[item]
+ RESTORE_DB_SET=True
+ print RESTORE_DB_SET
+ print RESTORE_SET
+ if RESTORE_SET == True and RESTORE_DB_SET == True:
+ #TODO
+ self.emit_progress("Restoring files", 20)
+ rj = Thread(target=Restore().RestoreJob, args=(RESTORE_LOCATION,RESTORE_DB))
+ rj.start()
+ while rj.isAlive():
+ f = open(STATUSFILE, 'r')
+ ANS1 = f.readline().rstrip('\n')
+ ANS2 = f.readline().rstrip('\n')
+ status = int(ANS1)
+ self.emit_progress(ANS2, status)
+ f.close()
+ while ANS2 == 'Backing up database (this could take a few minutes)':
+ f = open(STATUSFILE, 'r')
+ ANS1 = f.readline().rstrip('\n')
+ ANS2 = f.readline().rstrip('\n')
+ f.close()
+ if status <= 90:
+ status=status+0.1
+ self.emit_progress(ANS2, status)
+ time.sleep(0.1)
+ time.sleep(0.1)
+ self.emit_progress("Restore Job Complete", 100)
+ time.sleep(2)
+
+
+ def user_scripted_changes(self,reconfigure):
+ """Local changes that can be performed by the user account.
+ This function will be ran by the frontend"""
+ time.sleep(0.5)
+ for item in reconfigure:
+ if item == "Backup Now":
+ STATUSFILE = "/tmp/mythbuntu-bare-status"
+ bj = Thread(target=Backup().BackupJob, args=(self.BACKUP_LOCATION,self.BACKUP_DB))
+ bj.start()
+ self.emit_progress("Starting Backup", 10)
+ time.sleep(2)
+ status=10
+ while bj.isAlive():
+ f = open(STATUSFILE, 'r')
+ ANS1 = f.readline().rstrip('\n')
+ ANS2 = f.readline().rstrip('\n')
+ status = int(ANS1)
+ self.emit_progress(ANS2, status)
+ f.close()
+ while ANS2 == 'Backing up database (this could take a few minutes)':
+ f = open(STATUSFILE, 'r')
+ ANS1 = f.readline().rstrip('\n')
+ ANS2 = f.readline().rstrip('\n')
+ f.close()
+ if status <= 85:
+ status=status+0.1
+ self.emit_progress(ANS2, status)
+ time.sleep(0.1)
+ time.sleep(0.1)
+ self.emit_progress("Backup Finished", 100)
+ time.sleep(2)
=== added file 'plugins/python/mythrestore.py'
--- plugins/python/mythrestore.py 1970-01-01 00:00:00 +0000
+++ plugins/python/mythrestore.py 2010-08-11 21:17:40 +0000
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import shutil
+import os
+import tarfile
+
+class Restore():
+
+ def RestoreJob(self, Location, RestoreDB):
+ print "Restoring from file: "+Location
+# USER=os.getenv("HOME")
+ ## Set temp directory and status file
+# TMPDIR="/tmp/mythbuntu-bare/"
+# STATUSFILE="/tmp/mythbuntu-bare-status"
+ ##Remove temp DB dir and statusfile first in case it already exists
+# if os.path.exists(STATUSFILE):
+# os.remove(STATUSFILE)
+# if os.path.exists(TMPDIR):
+# shutil.rmtree(TMPDIR)
+ ## Open and Extract tarfile
+# TF=tarfile.open(Location,mode='r')
+# TF.extractall(path="/", members=None)
+# TF.close()
+ if RestoreDB == True:
+ print "Yes we are restoring the database!"
+# os.system("echo '20\nBacking up database (this could take a few minutes)'>"+STATUSFILE)
+ ##TODO
+ # mythconverg_restore.pl --directory TMPDIR
+ ## Add section
+ ## Remove Temp directory and status file
+# os.system("echo '90\nCleaning up temp files'>"+STATUSFILE)
+# if os.path.exists(TMPDIR):
+# shutil.rmtree(TMPDIR)
+# if os.path.exists(STATUSFILE):
+# os.remove(STATUSFILE)
=== modified file 'plugins/python/proprietary_codecs.py'
--- plugins/python/proprietary_codecs.py 2010-02-04 06:53:49 +0000
+++ plugins/python/proprietary_codecs.py 2010-08-11 21:17:40 +0000
@@ -80,11 +80,9 @@
def root_scripted_changes(self,reconfigure):
"""System-wide changes that need root access to be applied.
This function is ran by the dbus backend"""
- #TODO
- # - add the gpg key (nicely)
- # - do an apt update (nicely)
+ os.environ['PATH']='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
for item in reconfigure:
if item == "DVD Support":
csspath = self.search("/usr/share/doc/", "install-css.sh")
- run = subprocess.Popen([csspath+'/install-css.sh'], stdout=subprocess.PIPE)
+ run = subprocess.Popen([csspath+'/install-css.sh'])
run.communicate()
=== added file 'plugins/ui/tab_mythbuntu-bare.ui'
--- plugins/ui/tab_mythbuntu-bare.ui 1970-01-01 00:00:00 +0000
+++ plugins/ui/tab_mythbuntu-bare.ui 2010-08-11 21:17:40 +0000
@@ -0,0 +1,635 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkVBox" id="tab_mythbuntu-bare">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkLabel" id="graphics_drivers_title">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><big><b>Backup and Restore</b></big></property>
+ <property name="use_markup">True</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHSeparator" id="hseparator6">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">6</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox11">
+ <property name="visible">True</property>
+ <property name="spacing">10</property>
+ <child>
+ <object class="GtkVBox" id="vbox_start">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment17">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Welcome to Mythbuntu BaRe
+You can use this utility to backup and restore essential
+files to your Mythbuntu system.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment18">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="button_started">
+ <property name="label" translatable="yes">Get Started</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_button_started_clicked"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_choices">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Would you like to perform a backup or restore?</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment7">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <child>
+ <object class="GtkRadioButton" id="radio_backup">
+ <property name="label" translatable="yes">Backup</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_radio_backup_toggled"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">10</property>
+ <child>
+ <object class="GtkRadioButton" id="radio_restore">
+ <property name="label" translatable="yes">Restore</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_backup</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_backup_choice">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Would you like to:</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="top_padding">10</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkRadioButton" id="backup_now">
+ <property name="label" translatable="yes">Backup now</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="left_padding">10</property>
+ <child>
+ <object class="GtkRadioButton" id="backup_schedule">
+ <property name="label" translatable="yes">Configure scheduled daily backup</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">backup_now</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_backup_schedule">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">25</property>
+ <child>
+ <object class="GtkLabel" id="daily_backup_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Do you want to enable or disable the scheduled daily backup?</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment15">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">25</property>
+ <child>
+ <object class="GtkLabel" id="scheduled_label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Daily Backup is currrently: </property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment23">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="scheduled_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Disabled</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="underline" value="True"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment21">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkRadioButton" id="enable_backup_schedule">
+ <property name="label" translatable="yes">Enable Scheduled Backup</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="disable_backup_schedule">
+ <property name="label" translatable="yes">Disable Scheduled Backup</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">enable_backup_schedule</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_restore_db">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment25">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">A database was detected in the selected restore file</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment27">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkCheckButton" id="restore_db">
+ <property name="label" translatable="yes">Restore database from backup file?</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_restore">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment26">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Please choose the backup file to restore</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment24">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">25</property>
+ <child>
+ <object class="GtkFileChooserButton" id="restore_file">
+ <property name="visible">True</property>
+ <property name="create_folders">False</property>
+ <property name="title" translatable="yes">Select A File To Restore</property>
+ <property name="width_chars">20</property>
+ <signal name="selection_changed" handler="on_restore_file_selection_changed"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_backup_location">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment22">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Where would you like the backup to be stored?</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment11">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">25</property>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment12">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkRadioButton" id="backup_dir_button">
+ <property name="label" translatable="yes">Directory</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_backup_dir_button_toggled"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment13">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkRadioButton" id="backup_u1_button">
+ <property name="label" translatable="yes">Ubuntu One</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">backup_dir_button</property>
+ <signal name="toggled" handler="on_backup_dir_button_toggled"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkRadioButton" id="backup_dropbox_button">
+ <property name="label" translatable="yes">Dropbox</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">backup_dir_button</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment10">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">25</property>
+ <child>
+ <object class="GtkFileChooserButton" id="backup_location">
+ <property name="visible">True</property>
+ <property name="action">select-folder</property>
+ <property name="title" translatable="yes">Select Storage Location</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="left_padding">25</property>
+ <child>
+ <object class="GtkLabel" id="preconfigured_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save location preconfigured</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment16">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <property name="top_padding">10</property>
+ <child>
+ <object class="GtkCheckButton" id="db_backup_checkbutton">
+ <property name="label" translatable="yes">Backup Database?</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_final">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment9">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Please click apply to make your changes final.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="button_box">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment19">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="back_button">
+ <property name="label" translatable="yes">Back</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_back_button_clicked"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment20">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="next_button">
+ <property name="label" translatable="yes">Next</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_next_button_clicked"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">6</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+</interface>