Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to work with newer dependencies #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ If you do wish to run the program from source, below are the steps I took to run
##### Linux
[sudo] apt-get install libxext-dev python-qt4 qt4-dev-tools libqt4-dev libqt4-core libqt4-gui build-essential

Download SIP: http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.2/sip-4.16.2.tar.gz/
Download SIP: https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/sip-4.19.13.tar.gz/

Download PyQt: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.1/PyQt-x11-gpl-4.11.1.tar.gz/
Download PyQt: https://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz/

Extract both tarballs

cd sip-4.16.2
cd sip-4.19.13
python configure.py
make
[sudo] make install

cd PyQt-x11-gpl-4.11.1
cd PyQt-x11-gpl-4.12.3
python configure.py
make
[sudo] make install
Expand Down Expand Up @@ -159,3 +159,4 @@ http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.1/PyQt4-4.11.1-gpl-Py
And now you should be ready to run the reddit Data Extractor! main.py is where all the magic starts.

python main.py

6 changes: 3 additions & 3 deletions RedditDataExtractor/GUI/genericListModelObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ def __init__(self, name):
"""
A user in a user list
"""
super().__init__(name)
GenericListModelObj.__init__(self, name)


class Subreddit(GenericListModelObj):
def __init__(self, name):
"""
A subreddit in a subreddit list
"""
super().__init__(name)
GenericListModelObj.__init__(self, name)

@GenericListModelObj.mostRecentDownloadTimestamp.setter
def mostRecentDownloadTimestamp(self, utc):
Expand All @@ -110,4 +110,4 @@ def submissionBeforeLastDownload(self, submission):
:rtype: bool
"""
return GenericListModelObj.subSort != "new" or (
self._mostRecentDownloadTimestamp is None or submission.created_utc > self._mostRecentDownloadTimestamp)
self._mostRecentDownloadTimestamp is None or submission.created_utc > self._mostRecentDownloadTimestamp)
2 changes: 1 addition & 1 deletion RedditDataExtractor/GUI/imgurClientIdGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ def _enterLater(self):

def accept(self):
self.imgurAPIClientID = self.clientIdLineEdit.text()
super().accept()
QDialog.accept(self)
5 changes: 3 additions & 2 deletions RedditDataExtractor/GUI/listModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, lst, lstObjType, parent=QObject()):
:type lst: list
:type lstObjType: function
"""
super().__init__(parent)
QAbstractListModel.__init__(self, parent)
self.lst = lst
self.lstObjType = lstObjType
self.stringsInLst = set([lstObj.name.lower() for lstObj in self.lst])
Expand Down Expand Up @@ -117,6 +117,7 @@ def setData(self, index, value, role=Qt.EditRole):
row = index.row()
obj = self.lst[row]
oldName = obj.name
value = str(value.toString())
if value.lower() in self.stringsInLst:
# Can't add duplicates
return False
Expand Down Expand Up @@ -157,4 +158,4 @@ def removeRows(self, position, rows, parent=QModelIndex()):
self.lst.remove(obj)
self.removeFromStringsInLst(obj.name)
self.endRemoveRows()
return True
return True
16 changes: 8 additions & 8 deletions RedditDataExtractor/GUI/redditDataExtractorGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self, rddtDataExtractor, queue, userOrSub, listType):
:type userOrSub: set[RedditDataExtractor.GUI.genericListModelObjects.GenericListModelObj]
:type listType: RedditDataExtractor.redditDataExtractor.ListType
"""
super().__init__()
QObject.__init__(self)
self._rddtDataExtractor = rddtDataExtractor
self._queue = queue
self._userOrSub = userOrSub
Expand Down Expand Up @@ -112,7 +112,7 @@ def __init__(self, gui, lstChooser, chooserDict, defaultLstName, classToUse, nam
:type classToUse: function
:type name: str
"""
super().__init__(gui.centralwidget)
QListView.__init__(self, gui.centralwidget)
self.setContextMenuPolicy(Qt.ActionsContextMenu)
self.setObjectName(name)
self._lstChooser = lstChooser
Expand Down Expand Up @@ -211,7 +211,7 @@ def __init__(self, gui):
Subclass of ListViewAndChooser specifically for a User View
:type gui: RedditDataExtractor.GUI.redditDataExtractorGUI.RddtDataExtractorGUI
"""
super().__init__(gui, gui.userListChooser, gui._rddtDataExtractor.userLists,
ListViewAndChooser.__init__(self, gui, gui.userListChooser, gui._rddtDataExtractor.userLists,
gui._rddtDataExtractor.defaultUserListName, User, "user")
self._rddtDataExtractor.currentUserListName = self._defaultLstName

Expand Down Expand Up @@ -273,7 +273,7 @@ def __init__(self, gui):
Subclass of ListViewAndChooser specifically for a Subreddit View
:type gui: RedditDataExtractor.GUI.redditDataExtractorGUI.RddtDataExtractorGUI
"""
super().__init__(gui, gui.subredditListChooser, gui._rddtDataExtractor.subredditLists,
ListViewAndChooser.__init__(self, gui, gui.subredditListChooser, gui._rddtDataExtractor.subredditLists,
gui._rddtDataExtractor.defaultSubredditListName, Subreddit, "subreddit")
self._rddtDataExtractor.currentSubredditListName = self._defaultLstName

Expand Down Expand Up @@ -600,7 +600,7 @@ def notifyInvalidSubreddit(self, subredditName):
model.removeRows(index, 1)

def selectDirectory(self):
directory = QFileDialog.getExistingDirectory(QFileDialog())
directory = str(QFileDialog.getExistingDirectory(QFileDialog()))
if len(directory) > 0:
directory = pathlib.Path(directory).resolve()
if directory.exists():
Expand Down Expand Up @@ -711,7 +711,7 @@ def displayAbout(self):
See <a href="https://github.com/NSchrading/redditDataExtractor/blob/master/LICENSE.txt">LICENSE.txt</a> for more information.
</p>
""")
msgBox.exec()
msgBox.exec_()

def viewRemainingImgurRequests(self):
if self._rddtDataExtractor.currentlyDownloading:
Expand All @@ -736,7 +736,7 @@ def viewRemainingImgurRequests(self):
else:
msgBox.setText(
"You do not currently have an Imgur client-id set. To set one, go to settings and check 'Change / Reset Client-id'")
msgBox.exec()
msgBox.exec_()

def setUnsavedChanges(self, unsaved):
"""
Expand Down Expand Up @@ -783,4 +783,4 @@ def closeEvent(self, event):

def saveState(self):
successful = self._rddtDataExtractor.saveState()
self.setUnsavedChanges(not successful)
self.setUnsavedChanges(not successful)
10 changes: 5 additions & 5 deletions RedditDataExtractor/GUI/settingsGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, row, filterTable, filtTableConnectCol, connectMap):
:type filtTableConnectCol: int
:type connectMap: dict
"""
super().__init__()
QComboBox.__init__(self)
self.row = row
self.filterTable = filterTable
self.filtTableConnectCol = filtTableConnectCol
Expand Down Expand Up @@ -85,7 +85,7 @@ def __init__(self, row, propCombobox):
:type row: int
:type propCombobox: QComboBox
"""
super().__init__()
QComboBox.__init__(self)
self.row = row
self.addItem("Submission")
self.addItem("Comment")
Expand All @@ -109,7 +109,7 @@ def __init__(self, row, operCombobox, validOperForPropMap):
:type operCombobox: QComboBox
:type validOperForPropMap: dict
"""
super().__init__()
QComboBox.__init__(self)
self.row = row
self.operCombobox = operCombobox
self.validOperForPropMap = validOperForPropMap
Expand Down Expand Up @@ -164,7 +164,7 @@ def __init__(self, row):
A class to handle the operator comboboxes and what happens when the user changes the text
:type row: int
"""
super().__init__()
QComboBox.__init__(self)
self.row = row

def changeOpers(self, validOpers):
Expand Down Expand Up @@ -416,5 +416,5 @@ def checkFilterTable(self):

def accept(self):
if self.checkFilterTable():
super().accept()
QDialog.accept(self)

Loading