Example #1
0
 def runTest(self):
     song = self.sqlaSession.query(libmgr.Song).all()[0]
     if song not in self.playlist:
         self.playlist.songs.append(song)
         self.sqlaSession.commit()
     assert self.playlist.name == "Favorite Songs"
     assert song in self.playlist
     libmgr.dump(os.path.join(modulePath, "dump.txt"))
Example #2
0
        actions = self.ui.addToRepositoryMenu.actions()
        for action in actions:
            if action.text() == repositoryName:
                self.ui.addToRepositoryMenu.removeAction(action)


if __name__ == "__main__":

    resources = QtCore.QDir(os.path.join(mistPath, "resources"))
    libmgr.setupSqlAlchemy(resources.filePath("database.db"))
    sqlaSession = SqlaSession()

    app = QtGui.QApplication(sys.argv)

    styleSheet = open(resources.filePath("mainstylesheet.qss")).read()

    app.setOrganizationName("Jonathan")
    app.setApplicationName("Mist")
    app.setStyleSheet(styleSheet)
    mainWindow = MainWindow()
    mainWindow.setWindowIcon(QtGui.QIcon(resources.filePath("icons/package-manager-icon.svg")))

    mainWindow.show()
    libmgr.workerQueue.put([libmgr.loadAllSongs, ()])
    libmgr.workerQueue.put([libmgr.loadAllTags, ()])
    libmgr.loadAllRepositories()
    libmgr.loadAllPlaylists()

    libmgr.dump("/home/jonathan/Desktop/mist_db.txt")
    sys.exit(app.exec_())