dvdrip-queue-0.1.3/ 0000755 0001750 0001750 00000000000 11035631126 014317 5 ustar marillat marillat dvdrip-queue-0.1.3/.project 0000644 0001750 0001750 00000000556 11025316244 015774 0 ustar marillat marillat
dvdrip-queue
org.python.pydev.PyDevBuilder
org.python.pydev.pythonNature
dvdrip-queue-0.1.3/src/ 0000755 0001750 0001750 00000000000 11035631126 015106 5 ustar marillat marillat dvdrip-queue-0.1.3/src/dvdripQueue/ 0000755 0001750 0001750 00000000000 11035631126 017403 5 ustar marillat marillat dvdrip-queue-0.1.3/src/dvdripQueue/dvdrip_lib.py 0000644 0001750 0001750 00000004014 11025350003 022061 0 ustar marillat marillat #!/usr/bin/env python
#
#
# This file is part of DvdRip Queue
#
# DvdRip Queue 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 3 of the License, or
# (at your option) any later version.
#
# DvdRip Queue 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 DvdRip Queue. If not, see .
#
import os
from ConfigParser import ConfigParser
def getPref(prefName, getDefaultValue = False):
#Get home directory for datadirectory preference default value
homeDir = os.path.expanduser("~")
# if the config file exists...
if (os.path.exists(homeDir + "/.dvdrip-queue") and os.path.isfile(homeDir + "/.dvdrip-queue")):
# make an instance of the config-file parser and load it
configdict = ConfigParser()
configdict.read(homeDir + "/.dvdrip-queue")
try:
# If the user wants the default value, just raise an exception
# to simulate not having a prefs file
if getDefaultValue == True:
raise
# try to load the preference from the config file
prefValue = os.path.expanduser(configdict.defaults()[prefName])
except:
# If the preference isn't found, load a default instead
if prefName == "datadirectory":
if (os.path.exists(homeDir + "/dvdrip-data") and os.path.isdir(homeDir + "/dvdrip-data")):
prefValue = homeDir + "/dvdrip-data"
else:
prefValue = homeDir
elif prefName == "maxencodetime":
prefValue = 360.0
# return the value of the preference
return prefValue dvdrip-queue-0.1.3/src/dvdripQueue/prefsWindow.py 0000644 0001750 0001750 00000011766 11025350020 022265 0 ustar marillat marillat #!/usr/bin/env python
#
#
# This file is part of DvdRip Queue
#
# DvdRip Queue 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 3 of the License, or
# (at your option) any later version.
#
# DvdRip Queue 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 DvdRip Queue. If not, see .
#
import gtk, os
from ConfigParser import ConfigParser
from dvdrip_lib import getPref
class prefsWindow:
def __init__(self, app):
self.app = app
# Set Glade File
self.gladefile = "./gui/dvdrip-queue-prefs.glade"
self.wTree = gtk.glade.XML(self.gladefile)
# Get the Main window and connect the "destroy" event
self.Window = self.wTree.get_widget("prefsWindow")
# Define which function gets called for each signal (from the gui)
dic = { "on_prefsApplyButton_clicked" : self.applyPrefs,
"on_prefsCancelButton_clicked" : self.cancelPrefs,
"on_prefsWindow_destroy_event" : self.cancelPrefs,
"on_btn2_clicked" : self.btn2_clicked,
"on_btn4_clicked" : self.btn4_clicked,
"on_btn6_clicked" : self.btn6_clicked,
"on_btn12_clicked" : self.btn12_clicked,
"on_btnResetData_clicked" : self.resetDataDir,
"on_btnResetTime_clicked" : self.resetMaxEncodeTime,
"on_btnResetAll_clicked" : self.resetAll
}
self.wTree.signal_autoconnect(dic)
self.loadPrefsDataToWidgets()
self.Window.show()
def loadPrefsDataToWidgets(self):
# Set up the Data Directory fileChooser widget
self.fileChooser = self.wTree.get_widget("prefsFileChooser")
self.fileChooser.set_action(2) #Set the filechooser to choose a Directory
self.fileChooser.set_current_folder( getPref("datadirectory") ) #Set current value
# Set up the Max Encode Time SpinButton Widget
self.prefsWaitTimeChooser = self.wTree.get_widget("prefsWaitTimeChooser")
self.prefsWaitTimeChooser.set_value( float(getPref("maxencodetime")) ) #Set current value
def resetDataDir(self, widget):
self.fileChooser.set_current_folder(getPref("datadirectory", True))
def resetMaxEncodeTime(self, widget):
self.prefsWaitTimeChooser.set_value( float(getPref("maxencodetime", True)) )
def resetAll(self, widget):
self.resetDataDir(None)
self.resetMaxEncodeTime(None)
def btnX_clicked(self, time):
self.prefsWaitTimeChooser.set_value(time*60)
def btn2_clicked(self, widget):
self.btnX_clicked(2)
def btn4_clicked(self, widget):
self.btnX_clicked(4)
def btn6_clicked(self, widget):
self.btnX_clicked(6)
def btn12_clicked(self, widget):
self.btnX_clicked(12)
def applyPrefs(self, widget):
# set new data directory
datadirectory = self.fileChooser.get_current_folder()
maxEncodeTime = self.prefsWaitTimeChooser.get_value()
# Try to open the config file. If it doesn't exist, create it
try:
configFile = open(os.path.expanduser("~/.dvdrip-queue"), "r")
except:
configFile = open(os.path.expanduser("~/.dvdrip-queue"), "w")
configFile.close()
configFile = open(os.path.expanduser("~/.dvdrip-queue"), "r")
#make a ConfigParser instance and load the config file into it
config = ConfigParser()
config.readfp(configFile, ".dvdrip-queue")
# close the config file so we can write to it
configFile.close()
#if the config file doesn't have a 'default' section make one
if (not config.has_section("DEFAULT")):
config.add_section("DEFAULT")
#add 'datadirectory = /wherever/the/data/directory/is' to config file
config.set("DEFAULT", "datadirectory", datadirectory)
config.set("DEFAULT", "maxEncodeTime", maxEncodeTime)
configFile = open(os.path.expanduser("~/.dvdrip-queue"), "w")
config.write(configFile)
configFile.close()
# Tell the main window to reload the *.rip files with the new data directory
self.app.loadRipFiles()
# Close the Preferences dialog
self.closePrefs()
def cancelPrefs(self, widget):
self.closePrefs()
def closePrefs(self):
self.Window.hide()
self.Window.destroy() dvdrip-queue-0.1.3/src/dvdripQueue/doEncode.pyc 0000644 0001750 0001750 00000011660 11025350245 021643 0 ustar marillat marillat ³ò
ÿÏUHc @ s· d d k Z d d k l Z d d k l Z d d k l Z l Z d d k l Z d d k Z d d k
Z d d k l Z d d k
l Z d e f d „ ƒ YZ d
d d „ ƒ YZ d S(
iÿÿÿÿN( t Thread( t Popen( t timet sleep( t SIGTERM( t changeStockButtonText( t getPreft doEncodec B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( sµ
This is the class we use to call DvdRip... it calls it on a seperate
thread so that the main application doesn't hang (at least that's
what I think I've done here)
c C s, t i | ƒ | | _ t | _ | | _ d S( sµ
This is the class we use to call DvdRip... it calls it on a seperate thread so that the main application doesn't hang (at least that's what I think I've done here)
N( R t __init__t ripQueuet Falset cancelEncodet app( t selfR R ( ( sD /home/jim/eclipse_workspace/dvdrip-queue/src/dvdripQueue/doEncode.pyR &