Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
misc patches for deepin and elementary os
Browse files Browse the repository at this point in the history
  • Loading branch information
gaining committed Apr 30, 2017
1 parent ac98a94 commit c0a4975
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 30 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Resetter 0.2.4-rc1
# Resetter 0.2.5-rc2
![alt tag](https://github.com/gaining/Resetter/blob/master/Resetter/resetter-screenshot.png)

It is an application built with python and pyqt that will help to reset an Ubuntu or Linux-Mint system to stock, as if it's been just installed without having to manually re-install by using a live cd/dvd image. It will detect packages that have been installed after the initial system install.

# Status
- The first release candidate has been released!
- Release candidate 0.2.4 contains new looks, tons of new useful features, and more.
- Release candidate 0.2.5 contains new looks, tons of new useful features, and more.
- Feedback will be greatly appreciated.
- current version is 0.2.4-rc1
- current version is 0.2.5-rc2
- Please check the changelog for more details.
- If you find a bug, please create an issue on github.
- If you do not have a github account please send your bug report at [email protected].


# How to install
Install via deb file found ![here](https://github.com/gaining/Resetter/releases/tag/v0.2.4-rc). PPA will be created soon.
Install via deb file found ![here](https://github.com/gaining/Resetter/releases/tag/v0.2.5-rc2). PPA will be created soon.
It is easier to install any deb files via gdebi, especially on elementary os with no graphical way of installing a deb file.
On the terminal, run `sudo apt install gdebi`.
- Linux deepin users must first fetch the python-evdev module
Expand Down
4 changes: 2 additions & 2 deletions Resetter/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: resetter
Version: 0.2.4-rc1
Version: 0.2.5-rc2
Installed-Size: 1224
Maintainer: gaining <[email protected]>
Section: python
Homepage: https://github.com/gaining/resetter
Architecture: all
Priority: optional
Depends: python-qt4 (>=4.10), python-apt (>=0.9.3), coreutils (>=7.0), python-evdev (>=0.4), python-mechanize (>=1:0.2.5), python-bs4 (>=4.2)
Depends: python-qt4 (>=4.10), python-apt (>=0.9.3), coreutils (>=7.0), python-evdev (>=0.4), python-mechanize (>=1:0.2.5), python-bs4 (>=4.2), add-apt-key (>=1.0)
Pre-Depends: python (>=2.7.5), policykit-1 (>=0.105)
Description: Resets Ubuntu/Linux-Mint to stock
Resetter is an easy way to reset your debian based linux back to stock. It also has other useful tools such as a ppa manager, an installer and a way to install ppa's straight from launchpad.net.
Expand Down
4 changes: 1 addition & 3 deletions Resetter/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
add install option for reading packages from generated list (backup) #due for next release.
upgrade to python3 and pyqt5
support more debian based linux distributions
create better launcher icon
upgrade to python3 and pyqt5
add command line options


2 changes: 1 addition & 1 deletion Resetter/usr/lib/resetter/AboutPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, parent=None):
cr_text = "Copyright (c) 2017 all rights reserved"
desc_text = "Built With PyQt\n\n " \
"This is a great utility software that will help you reset your linux installation its stock state"
version_text = "Version: 0.2.4-beta"
version_text = "Version: 0.2.5-rc2"
donate_text = 'If you liked my project, please ' \
'<a href="https://github.com/gaining/Resetter/blob/master/DONATE.md">Donate </a>'
more_text = 'To find out more about this project, please visit my github:' \
Expand Down
8 changes: 5 additions & 3 deletions Resetter/usr/lib/resetter/EasyInstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import textwrap
from PyQt4 import QtCore, QtGui


class EasyInstaller(QtGui.QDialog):
def __init__(self):
super(EasyInstaller, self).__init__()
Expand Down Expand Up @@ -117,7 +116,8 @@ def selectAll(self):

def openBackup(self):
try:
backup = QtGui.QFileDialog.getOpenFileName(self, 'Choose Backup', 'Backup', "(*.rbf)")
dpath = os.path.abspath(os.path.join("Backup", "../../../"))
backup = QtGui.QFileDialog.getOpenFileName(self, 'Choose Backup', dpath, "(*.rbf)")
if os.path.isfile(backup):
with open(backup, "r") as bk:
for line in bk:
Expand Down Expand Up @@ -162,6 +162,8 @@ def installPackages(self):
self.install = Install("install", "Installing packages", True)
self.install.show()
self.install.exec_()
self.removeItems()
print "Done"

def closeview(self):
self.cache.close()
Expand All @@ -187,7 +189,7 @@ def showMessage(self, package):
msg.setIcon(QtGui.QMessageBox.Information)
msg.setText("The package that you've tried to add is not found in the cache")
msg.setDetailedText("If you've recently added a ppa containing this package, "
"please use <b>EasyPPA - refresh sources</b> feature, "
"please use [EasyPPA - refresh sources] feature, "
"then try adding the package again.")
msg.exec_()

Expand Down
22 changes: 12 additions & 10 deletions Resetter/usr/lib/resetter/EasyRepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ def isThereInternet(self):
return False

def codeName(self):
xenial_fam = (['serena', 'sarah', 'loki'])
if self.os_info['CODENAME'] == 'rosa':
return "trusty"
elif self.os_info['CODENAME'] == 'sarah' or 'loki' or 'serena':
elif self.os_info['CODENAME'] in xenial_fam:
return "xenial"
else:
return self.os_info['CODENAME']
Expand Down Expand Up @@ -210,20 +211,21 @@ def addPPA(self, ppa):
QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)
x = str(ppa[index.row()])
y = str(x[7:]).split(' ', 1)[0]
repo = ('deb', y, self.codeName(), ['main'])
print repo, ppa[index.row()][2]

entry = self.sources.add('deb', y, self.codeName(), ['main'])
entry.set_enabled(True)
self.sources.save()
p = subprocess.Popen(['apt-key', 'adv', '--keyserver keyserver.ubuntu.com', '--recv-keys',
ppa[index.row()][2]], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()

p = subprocess.check_output(['apt-key', 'adv', '--keyserver', 'keyserver.ubuntu.com', '--recv-keys',
ppa[index.row()][2]])
print p
QtGui.QApplication.restoreOverrideCursor()
except Exception as e:
print "failed {}".format(e)
self.successMessage()
QtGui.QApplication.restoreOverrideCursor()
self.error_msg.setIcon(QtGui.QMessageBox.Critical)
self.error_msg.setText("Unable fetch PPA key")
self.error_msg.setDetailedText("Error: {}".format(e))
self.error_msg.exec_()
else:
self.successMessage()
else:
self.showMessage()

Expand Down
2 changes: 1 addition & 1 deletion Resetter/usr/lib/resetter/Resetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def save(self):
time = strftime("%Y-%m-%d %H:%M:%S", gmtime())
name = "snapshot - {}".format(time)
filename, extension = QtGui.QFileDialog.getSaveFileNameAndFilter(
self, 'Save Backup file', name, filter=self.tr(".rbf"))
self, 'Save Backup file', '/home/{}/{}'.format(self.user, name), filter=self.tr(".rbf"))
try:
with open("installed", 'r') as inst, open(filename + extension, "w") as backup:
for line in inst:
Expand Down
13 changes: 8 additions & 5 deletions Resetter/usr/lib/resetter/Sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,21 @@ def editSources(self, title, tip):
self.btnEnable.setVisible(True)

for dirpath, dirs, files in os.walk('/etc/apt/'):
word = 'deb'
for filename in fnmatch.filter(files, "*.list"):
source_list = os.path.join(dirpath, filename)
self.sourceslists.append(source_list)
with open(source_list, "r") as sources:
for line in sources:
if line.startswith('deb') or line.startswith('#'):
self.item = QtGui.QStandardItem(line)
self.item.setCheckable(True)
self.item.setCheckState(QtCore.Qt.Unchecked)
self.model.appendRow(self.item)
if line.startswith(word) or line.startswith('#') \
and line[2:].split(' ')[0][:3] == word:
self.item = QtGui.QStandardItem(line)
self.item.setCheckable(True)
self.item.setCheckState(QtCore.Qt.Unchecked)
self.model.appendRow(self.item)
self.list_view.setModel(self.model)


def setItems(self, item):
if item.checkState() == QtCore.Qt.Checked:
self.items.append(item.text())
Expand Down
Binary file modified Resetter/usr/share/doc/resetter/changelog.gz
Binary file not shown.
9 changes: 9 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
resetter (0.2.5-rc2) trusty; urgency=low
* Added dependency add-apt-key as it isn't included in some distros by default
* Fixed easy ppa for elementary os
* PPA manager improvements
* Easy PPA misc improvements

-- gaining <[email protected]> Sun, 30 Apr 2017 17:25:27 -0400


resetter (0.2.4-rc1) trusty; urgency=medium

* Release Candidate 1
Expand Down

0 comments on commit c0a4975

Please sign in to comment.