conduit r1700 - in trunk: . conduit conduit/dataproviders conduit/datatypes conduit/gtkui conduit/modules conduit/modules/BansheeModule conduit/modules/EvolutionModule conduit/modules/GoogleModule conduit/modules/N800Module conduit/modules/iPodModule conduit/platform conduit/utils data po test/python-tests test/python-tests/data
- From: jstowers svn gnome org
- To: svn-commits-list gnome org
- Subject: conduit r1700 - in trunk: . conduit conduit/dataproviders conduit/datatypes conduit/gtkui conduit/modules conduit/modules/BansheeModule conduit/modules/EvolutionModule conduit/modules/GoogleModule conduit/modules/N800Module conduit/modules/iPodModule conduit/platform conduit/utils data po test/python-tests test/python-tests/data
- Date: Fri, 29 Aug 2008 23:40:12 +0000 (UTC)
Author: jstowers
Date: Fri Aug 29 23:40:12 2008
New Revision: 1700
URL: http://svn.gnome.org/viewvc/conduit?rev=1700&view=rev
Log:
Merge from trunk
Added:
trunk/data/evolution-memos.png
trunk/data/evolution-tasks.png
Modified:
trunk/ (props changed)
trunk/ChangeLog
trunk/conduit/Settings.py
trunk/conduit/Vfs.py
trunk/conduit/conduit
trunk/conduit/dataproviders/DataProvider.py
trunk/conduit/datatypes/File.py
trunk/conduit/gtkui/Tree.py
trunk/conduit/gtkui/UI.py
trunk/conduit/modules/AudioVideoConverterModule.py
trunk/conduit/modules/BansheeModule/BansheeModule.py
trunk/conduit/modules/EvolutionModule/EvolutionModule.py
trunk/conduit/modules/GoogleModule/GoogleModule.py
trunk/conduit/modules/N800Module/N800Module.py
trunk/conduit/modules/iPodModule/config.glade
trunk/conduit/modules/iPodModule/iPodModule.py
trunk/conduit/platform/FileGio.py
trunk/conduit/platform/FileGnomeVfs.py
trunk/conduit/utils/Makefile.am
trunk/conduit/utils/MediaFile.py
trunk/data/Makefile.am
trunk/data/conduit.glade
trunk/po/ChangeLog
trunk/po/es.po
trunk/test/python-tests/TestCoreVfs.py
trunk/test/python-tests/data/folder.list
Modified: trunk/conduit/Settings.py
==============================================================================
--- trunk/conduit/Settings.py (original)
+++ trunk/conduit/Settings.py Fri Aug 29 23:40:12 2008
@@ -63,7 +63,7 @@
#Default values for conduit settings
DEFAULTS = {
- 'show_splashscreen' : True, #The splashscreen can be quite useful on slow computers
+ 'show_splashscreen' : False, #The splashscreen can be quite useful on slow computers
'show_dp_description' : False, #Should the treeview show the dataprovider description
'show_status_icon' : True, #Show an icon in the notification area indicating if a sync is running
'save_on_exit' : True, #Is the sync set saved on exit automatically?
@@ -80,6 +80,7 @@
'gui_initial_canvas_width' : 450, #Reduce for eepc, etc
'gui_use_rgba_colormap' : False, #Seems to corrupt gtkmozembed on some systems
'gui_show_hints' : True, #Show message area hints in the Conduit GUI
+ 'gui_show_treeview_lines' : False, #Show treeview lines
}
def __init__(self, **kwargs):
Modified: trunk/conduit/Vfs.py
==============================================================================
--- trunk/conduit/Vfs.py (original)
+++ trunk/conduit/Vfs.py Fri Aug 29 23:40:12 2008
@@ -25,7 +25,7 @@
Checks if the uri is valid (i.e. not a local path), and its type
is supported by the underlying file implementation
"""
- return uri[0] != "/" and uri.split("://")[0]+"://" in FileImpl.SCHEMES
+ return uri[0] != "/" and uri.split("://")[0]+"://" in FileImpl.FileImpl.SCHEMES
def uri_join(first, *rest):
"""
@@ -74,7 +74,7 @@
scheme = uri_get_scheme(uri)
if scheme == "file":
#len("file://") = 7
- return a[7:]
+ return uri[7:]
else:
return None
Modified: trunk/conduit/conduit
==============================================================================
--- trunk/conduit/conduit (original)
+++ trunk/conduit/conduit Fri Aug 29 23:40:12 2008
@@ -11,11 +11,11 @@
export LD_LIBRARY_PATH=/opt/gio/lib/
export PYTHONPATH=/opt/gio/lib/python2.5/site-packages/gtk-2.0/
-for d in `ls -d /usr/lib*/firefox* | sort -r`
+for d in `ls -d /usr/lib*/firefox* /usr/lib*/mozilla-firefox* 2> /dev/null | sort -r`
do
if [ -x $d/run-mozilla.sh ]; then
echo INFO: FOUND FIREFOX LIBS AT $d
- $d/run-mozilla.sh $(dirname $0)/conduit.real $*
+ $d/run-mozilla.sh `dirname $0`/conduit.real $*
exit
fi
done
@@ -23,5 +23,5 @@
echo "WARNING: COULD NOT FIND FIREFOX LIBRARIES"
echo "WARNING: CONDUIT MAY CRASH UNEXPECTEDLY"
echo "WARNING: PLEASE TALK TO THE PERSON WHO PACKAGED CONDUIT"
-$(dirname $0)/conduit.real $*
+`dirname $0`/conduit.real $*
Modified: trunk/conduit/dataproviders/DataProvider.py
==============================================================================
--- trunk/conduit/dataproviders/DataProvider.py (original)
+++ trunk/conduit/dataproviders/DataProvider.py Fri Aug 29 23:40:12 2008
@@ -406,8 +406,8 @@
@type putData: A L{conduit.DataType.DataType} derived type that this
dataprovider is capable of handling
@param overwrite: If this argument is True, the DP should overwrite
- an existing datatype instace (if one exists). Generally used in conflict
- resolution.
+ an existing datatype instance (if one exists). Generally used in
+ conflict resolution.
@type overwrite: C{bool}
@param LUID: A locally unique identifier representing the location
where the data was previously put.
Modified: trunk/conduit/datatypes/File.py
==============================================================================
--- trunk/conduit/datatypes/File.py (original)
+++ trunk/conduit/datatypes/File.py Fri Aug 29 23:40:12 2008
@@ -454,7 +454,7 @@
class ProxyFile(File):
"""
- Pretends to be a file for the sake of comparison and transer. Typically
+ Pretends to be a file for the sake of comparison and transfer. Typically
located on a remote, read only resource, such as http://. Once transferred
to the local filesystem, it behaves just like a file.
"""
Modified: trunk/conduit/gtkui/Tree.py
==============================================================================
--- trunk/conduit/gtkui/Tree.py (original)
+++ trunk/conduit/gtkui/Tree.py Fri Aug 29 23:40:12 2008
@@ -339,8 +339,7 @@
"""
gtk.TreeView.__init__(self, model)
self.set_property("enable-search", False)
- #FIXME: Work around a (py)gtk 2.8 bug
- if gtk.pygtk_version >= (2,10,0):
+ if gtk.pygtk_version >= (2,10,0) and conduit.GLOBALS.settings.get("gui_show_treeview_lines"):
self.set_property("enable-tree-lines", True)
#First column is an image and name
@@ -354,7 +353,7 @@
self.append_column(tvcolumn0)
# Second column is a description
- if conduit.GLOBALS.settings.get("show_dp_description") == True:
+ if conduit.GLOBALS.settings.get("show_dp_description"):
tvcolumn1 = gtk.TreeViewColumn(_("Description"), gtk.CellRendererText(), text=IDX_DESCRIPTION)
self.append_column(tvcolumn1)
self.set_headers_visible(True)
Modified: trunk/conduit/gtkui/UI.py
==============================================================================
--- trunk/conduit/gtkui/UI.py (original)
+++ trunk/conduit/gtkui/UI.py Fri Aug 29 23:40:12 2008
@@ -80,8 +80,6 @@
"""
gnome.ui.authentication_manager_init()
- self.conduitApplication = conduitApplication
-
#add some additional dirs to the icon theme search path so that
#modules can provider their own icons
icon_dirs = [
@@ -92,7 +90,9 @@
]
for i in icon_dirs:
gtk.icon_theme_get_default().prepend_search_path(i)
+ gtk.window_set_default_icon_name("conduit")
+ self.conduitApplication = conduitApplication
self.gladeFile = os.path.join(conduit.SHARED_DATA_DIR, "conduit.glade")
self.widgets = gtk.glade.XML(self.gladeFile, "MainWindow")
@@ -123,7 +123,6 @@
if colormap:
gtk.widget_set_default_colormap(colormap)
self.mainWindow.set_position(gtk.WIN_POS_CENTER)
- self.mainWindow.set_icon_name("conduit")
title = "Conduit"
if conduit.IS_DEVELOPMENT_VERSION:
title = title + " - %s (Development Version)" % conduit.VERSION
@@ -616,8 +615,6 @@
<menuitem action="Sync"/>
<menuitem action="Cancel"/>
<menuitem action="Quit"/>
- <separator/>
- <menuitem action="About"/>
</menu>
</menubar>
</ui>
@@ -626,14 +623,13 @@
('Menu', None, 'Menu'),
('Sync', gtk.STOCK_EXECUTE, _("_Synchronize All"), None, _("Synchronizes All Groups"), self.on_synchronize),
('Cancel', gtk.STOCK_CANCEL, _("_Cancel Synchronization"), None, _("Cancels Currently Synchronizing Groups"), self.on_cancel),
- ('Quit', gtk.STOCK_QUIT, _("_Quit"), None, _("Close Conduit"), self.on_quit),
- ('About', gtk.STOCK_ABOUT, _("_About"), None, _("About Conduit"), self.on_about)]
+ ('Quit', gtk.STOCK_QUIT, _("_Quit"), None, _("Close Conduit"), self.on_quit)]
ag = gtk.ActionGroup('Actions')
ag.add_actions(actions)
self.manager = gtk.UIManager()
self.manager.insert_action_group(ag, 0)
self.manager.add_ui_from_string(menu)
- self.menu = self.manager.get_widget('/Menubar/Menu/About').props.parent
+ self.menu = self.manager.get_widget('/Menubar/Menu/Quit').props.parent
self.cancelButton = self.manager.get_widget('/Menubar/Menu/Cancel')
self.connect('popup-menu', self.on_popup_menu)
self.connect('activate', self.on_click)
@@ -709,11 +705,6 @@
def on_quit(self, data):
self.conduitApplication.Quit()
- def on_about(self, data):
- dialog = AboutDialog()
- dialog.run()
- dialog.destroy()
-
def on_click(self, status):
if self.conduitApplication.HasGUI():
if self.conduitApplication.gui.is_visible():
Modified: trunk/conduit/modules/AudioVideoConverterModule.py
==============================================================================
--- trunk/conduit/modules/AudioVideoConverterModule.py (original)
+++ trunk/conduit/modules/AudioVideoConverterModule.py Fri Aug 29 23:40:12 2008
@@ -11,14 +11,20 @@
import conduit.datatypes.Video as Video
import gobject
-import pygst
-pygst.require('0.10')
-import gst
-from gst.extend import discoverer
-
-MODULES = {
- "AudioVideoConverter" : { "type": "converter" }
-}
+
+try:
+ import gst
+ from gst.extend import discoverer
+ from gst import Pipeline
+ MODULES = {
+ "AudioVideoConverter" : { "type": "converter" }
+ }
+ log.info("Module Information: %s" % Utils.get_module_information(gst, "pygst_version"))
+except ImportError:
+ class Pipeline:
+ pass
+ MODULES = {}
+ log.info("GStreamer transcoding disabled")
'''
GStreamer Conversion properties
@@ -48,7 +54,7 @@
specified, the other is calculated to keep the video proportional.
'''
-class GStreamerConversionPipeline(gst.Pipeline):
+class GStreamerConversionPipeline(Pipeline):
"""
Converts between different multimedia formats.
This class is event-based and needs a mainloop to work properly.
@@ -72,7 +78,7 @@
def __init__(self, **kwargs):
- gst.Pipeline.__init__(self)
+ Pipeline.__init__(self)
#if 'file_mux' not in kwargs:
# raise Exception('Output file format not specified')
self._has_video_enc = ('vcodec' in kwargs) or ('vcodec_pass1' in kwargs) or ('vcodec_pass2' in kwargs)
Modified: trunk/conduit/modules/BansheeModule/BansheeModule.py
==============================================================================
--- trunk/conduit/modules/BansheeModule/BansheeModule.py (original)
+++ trunk/conduit/modules/BansheeModule/BansheeModule.py Fri Aug 29 23:40:12 2008
@@ -33,7 +33,7 @@
_module_type_ = "source"
_in_type_ = "file/audio"
_out_type_ = "file/audio"
- _icon_ = "banshee"
+ _icon_ = "media-player-banshee"
_configurable_ = True
MUSIC_DB = os.path.join(os.path.expanduser("~"),".config", "banshee", "banshee.db")
Modified: trunk/conduit/modules/EvolutionModule/EvolutionModule.py
==============================================================================
--- trunk/conduit/modules/EvolutionModule/EvolutionModule.py (original)
+++ trunk/conduit/modules/EvolutionModule/EvolutionModule.py Fri Aug 29 23:40:12 2008
@@ -150,7 +150,7 @@
_module_type_ = "twoway"
_in_type_ = "contact"
_out_type_ = "contact"
- _icon_ = "contact-new"
+ _icon_ = "x-office-address-book"
def __init__(self, *args):
EvoBase.__init__(self, EvoContactTwoWay.DEFAULT_ADDRESSBOOK_URI)
@@ -201,7 +201,7 @@
_module_type_ = "twoway"
_in_type_ = "event"
_out_type_ = "event"
- _icon_ = "appointment-new"
+ _icon_ = "x-office-calendar"
def __init__(self, *args):
EvoBase.__init__(self, EvoCalendarTwoWay.DEFAULT_CALENDAR_URI)
@@ -259,7 +259,7 @@
_module_type_ = "twoway"
_in_type_ = "event"
_out_type_ = "event"
- _icon_ = "tomboy"
+ _icon_ = "evolution-tasks"
def __init__(self, *args):
EvoBase.__init__(self, EvoTasksTwoWay.DEFAULT_TASK_URI)
@@ -316,7 +316,7 @@
_module_type_ = "twoway"
_in_type_ = "note"
_out_type_ = "note"
- _icon_ = "tomboy"
+ _icon_ = "evolution-memos"
def __init__(self, *args):
EvoBase.__init__(self, EvoMemoTwoWay.DEFAULT_MEMO_URI)
Modified: trunk/conduit/modules/GoogleModule/GoogleModule.py
==============================================================================
--- trunk/conduit/modules/GoogleModule/GoogleModule.py (original)
+++ trunk/conduit/modules/GoogleModule/GoogleModule.py Fri Aug 29 23:40:12 2008
@@ -575,6 +575,9 @@
def _get_photo_formats (self):
return ("image/jpeg",)
+
+ def _get_photo_size(self):
+ return self.imageSize
def _upload_photo (self, uploadInfo):
try:
@@ -587,7 +590,7 @@
self.service.InsertTag(gphoto, str(tag))
return Rid(uid=gphoto.gphoto_id.text)
except Exception, e:
- raise Exceptions.SyncronizeError("Picasa Upload Error.")
+ raise Exceptions.SyncronizeError("Picasa Upload Error:\n%s" % e)
def _replace_photo(self, id, uploadInfo):
try:
@@ -607,7 +610,7 @@
return Rid(uid=gphoto.gphoto_id.text)
except Exception, e:
- raise Exceptions.SyncronizeError("Picasa Update Error.")
+ raise Exceptions.SyncronizeError("Picasa Update Error:\n%s" % e)
def _find_album(self):
for name,album in self._get_albums():
@@ -1269,9 +1272,6 @@
return False
def configure(self, window):
- """
- Configures the PicasaTwoWay
- """
import gtk
def make_combo(widget, docType, val, values):
Modified: trunk/conduit/modules/N800Module/N800Module.py
==============================================================================
--- trunk/conduit/modules/N800Module/N800Module.py (original)
+++ trunk/conduit/modules/N800Module/N800Module.py Fri Aug 29 23:40:12 2008
@@ -190,7 +190,7 @@
"""
_name_ = _("N800 Photos")
- _description_ = _("Synchronizes video to a N800 device")
+ _description_ = _("Synchronizes photo to a N800 device")
_in_type_ = "file/photo"
_out_type_ = "file/photo"
_icon_ = "image-x-generic"
Modified: trunk/conduit/modules/iPodModule/config.glade
==============================================================================
--- trunk/conduit/modules/iPodModule/config.glade (original)
+++ trunk/conduit/modules/iPodModule/config.glade Fri Aug 29 23:40:12 2008
@@ -78,4 +78,97 @@
</widget>
</child>
</widget>
+ <widget class="GtkDialog" id="PhotoConfigDialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">iPod Photos</property>
+ <property name="resizable">False</property>
+ <property name="default_width">250</property>
+ <property name="default_height">350</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="albumlabel">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">2</property>
+ <property name="ypad">2</property>
+ <property name="label" translatable="yes">Album:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkComboBoxEntry" id="album_combobox">
+ <property name="visible">True</property>
+ <child internal-child="entry">
+ <widget class="GtkEntry" id="comboboxentry-entry3">
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="delete_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-delete</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
Modified: trunk/conduit/modules/iPodModule/iPodModule.py
==============================================================================
--- trunk/conduit/modules/iPodModule/iPodModule.py (original)
+++ trunk/conduit/modules/iPodModule/iPodModule.py Fri Aug 29 23:40:12 2008
@@ -71,7 +71,7 @@
def get_category(self, udi, **kwargs):
return DataProviderCategory.DataProviderCategory(
kwargs['label'],
- "multimedia-player-ipod-video-white",
+ "multimedia-player-ipod-standard-color",
kwargs['mount'])
def get_dataproviders(self, udi, **kwargs):
@@ -348,6 +348,7 @@
_in_type_ = "file/photo"
_out_type_ = "file/photo"
_icon_ = "image-x-generic"
+ _configurable_ = True
SAFE_PHOTO_ALBUM = "Photo Library"
@@ -773,7 +774,7 @@
class IPodMusicTwoWay(IPodMediaTwoWay):
- _name_ = "iPod Music"
+ _name_ = "Music"
_description_ = "Sync your iPod music"
_module_type_ = "twoway"
_in_type_ = "file/audio"
@@ -797,7 +798,7 @@
class IPodVideoTwoWay(IPodMediaTwoWay):
- _name_ = "iPod Video"
+ _name_ = "Video"
_description_ = "Sync your iPod videos"
_module_type_ = "twoway"
_in_type_ = "file/video"
Modified: trunk/conduit/platform/FileGio.py
==============================================================================
--- trunk/conduit/platform/FileGio.py (original)
+++ trunk/conduit/platform/FileGio.py Fri Aug 29 23:40:12 2008
@@ -1,6 +1,5 @@
import gio
-import conduit.Vfs as Vfs
import conduit.platform
import logging
@@ -127,7 +126,7 @@
try:
info = self._file.query_filesystem_info("filesystem::type")
return info.get_attribute_string("filesystem::type")
- except gio.Error:
+ except gio.Error, e:
return None
class FileTransferImpl(conduit.platform.FileTransfer):
@@ -199,5 +198,55 @@
class FolderScanner(conduit.platform.FolderScanner):
def run(self):
+ delta = 0
+ t = 1
+ last_estimated = estimated = 0
+ while len(self.dirs)>0:
+ if self.cancelled:
+ return
+
+ dir = self.dirs.pop(0)
+ try:
+ f = gio.File(dir)
+ enumerator = f.enumerate_children('standard::type,standard::name,standard::is-hidden,standard::is-symlink')
+ except gio.Error:
+ log.warn("Folder %s Not found" % dir)
+ continue
+
+ try: fileinfo = enumerator.next()
+ except StopIteration: continue;
+ while fileinfo:
+ filename = fileinfo.get_name()
+ filetype = fileinfo.get_file_type()
+ hidden = fileinfo.get_is_hidden()
+ if filename != self.CONFIG_FILE_NAME:
+ if filetype == gio.FILE_TYPE_DIRECTORY:
+ #Include hidden directories
+ if not hidden or self.includeHidden:
+ self.dirs.append(dir+"/"+filename)
+ t += 1
+ elif filetype == gio.FILE_TYPE_REGULAR or (filetype == gio.FILE_TYPE_SYMBOLIC_LINK and self.followSymlinks):
+ uri = dir+"/"+filename
+ #Include hidden files
+ if not hidden or self.includeHidden:
+ self.URIs.append(uri)
+ else:
+ log.debug("Unsupported file type: %s (%s)" % (filename, filetype))
+ try: fileinfo = enumerator.next()
+ except StopIteration: break;
+
+ #Calculate the estimated complete percentags
+ estimated = 1.0-float(len(self.dirs))/float(t)
+ estimated *= 100
+ #Enly emit progress signals every 10% (+/- 1%) change to save CPU
+ if delta+10 - estimated <= 1:
+ log.debug("Folder scan %s%% complete" % estimated)
+ self.emit("scan-progress", len(self.URIs))
+ delta += 10
+ last_estimated = estimated
+
+ i = 0
+ total = len(self.URIs)
+ log.debug("%s files loaded" % total)
self.emit("scan-completed")
Modified: trunk/conduit/platform/FileGnomeVfs.py
==============================================================================
--- trunk/conduit/platform/FileGnomeVfs.py (original)
+++ trunk/conduit/platform/FileGnomeVfs.py Fri Aug 29 23:40:12 2008
@@ -307,11 +307,13 @@
while len(self.dirs)>0:
if self.cancelled:
return
+
dir = self.dirs.pop(0)
try: hdir = gnomevfs.DirectoryHandle(dir)
except:
log.warn("Folder %s Not found" % dir)
continue
+
try: fileinfo = hdir.next()
except StopIteration: continue;
while fileinfo:
@@ -337,6 +339,7 @@
log.debug("Unsupported file type: %s (%s)" % (filename, fileinfo.type))
try: fileinfo = hdir.next()
except StopIteration: break;
+
#Calculate the estimated complete percentags
estimated = 1.0-float(len(self.dirs))/float(t)
estimated *= 100
Modified: trunk/conduit/utils/Makefile.am
==============================================================================
--- trunk/conduit/utils/Makefile.am (original)
+++ trunk/conduit/utils/Makefile.am Fri Aug 29 23:40:12 2008
@@ -1,7 +1,9 @@
conduitdir = $(pythondir)/conduit/utils
conduit_PYTHON = \
__init__.py \
+ GstMetadata.py \
Memstats.py \
+ MediaFile.py \
CommandLineConverter.py \
Singleton.py
Modified: trunk/conduit/utils/MediaFile.py
==============================================================================
--- trunk/conduit/utils/MediaFile.py (original)
+++ trunk/conduit/utils/MediaFile.py Fri Aug 29 23:40:12 2008
@@ -1,14 +1,15 @@
+import threading
import conduit
import conduit.datatypes.File as File
import logging
log = logging.getLogger("datatypes.Audio")
-import pygst
-pygst.require('0.10')
-import gst
-from gst.extend import discoverer
-import threading
-from threading import Lock
+try:
+ import gst
+ from gst.extend import discoverer
+ GST_AVAILABLE = False
+except ImportError:
+ GST_AVAILABLE = False
class MediaFile(File.File):
@@ -46,11 +47,11 @@
return tags
def _get_metadata(self, name):
- tags = self.get_media_tags()
- if name in tags:
- return tags[name]
- else:
- return None
+ if GST_AVAILABLE:
+ tags = self.get_media_tags()
+ if name in tags:
+ return tags[name]
+ return None
def __getattr__(self, name):
# Get metadata only when needed
Modified: trunk/data/Makefile.am
==============================================================================
--- trunk/data/Makefile.am (original)
+++ trunk/data/Makefile.am Fri Aug 29 23:40:12 2008
@@ -36,6 +36,8 @@
resources_DATA = \
conduit.glade \
backpack.png \
+ evolution-tasks.png \
+ evolution-memos.png \
conduit-splash.png \
facebook.png \
feed.png \
Modified: trunk/data/conduit.glade
==============================================================================
--- trunk/data/conduit.glade (original)
+++ trunk/data/conduit.glade Fri Aug 29 23:40:12 2008
@@ -722,7 +722,7 @@
</widget>
<widget class="GtkDialog" id="PreferencesDialog">
<property name="visible">True</property>
- <property name="title" translatable="yes">Conduit Properties</property>
+ <property name="title" translatable="yes">Conduit Preferences</property>
<property name="default_width">350</property>
<property name="default_height">450</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
@@ -748,6 +748,7 @@
<child>
<widget class="GtkVBox" id="vbox29">
<property name="visible">True</property>
+ <property name="spacing">5</property>
<child>
<widget class="GtkCheckButton" id="save_settings_check">
<property name="visible">True</property>
@@ -835,6 +836,7 @@
<child>
<widget class="GtkVBox" id="vbox34">
<property name="visible">True</property>
+ <property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label78">
<property name="visible">True</property>
@@ -844,57 +846,74 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="deleted_ask_radio">
+ <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ask me what to do</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkRadioButton" id="deleted_ask_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Ask me what to do</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="deleted_replace_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Delete from the corresponding sink</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">deleted_ask_radio</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="deleted_skip_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Skip</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">deleted_ask_radio</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">12</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="deleted_replace_radio">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Delete from the corresponding sink</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">deleted_ask_radio</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="deleted_skip_radio">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Skip</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">deleted_ask_radio</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
<widget class="GtkLabel" id="label77">
<property name="visible">True</property>
<property name="xalign">0</property>
@@ -903,54 +922,72 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="conflict_ask_radio">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ask me what to do</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="conflict_replace_radio">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Replace the older item</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">conflict_ask_radio</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="conflict_skip_radio">
+ <widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Skip</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">conflict_ask_radio</property>
+ <child>
+ <widget class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkRadioButton" id="conflict_ask_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Ask me what to do</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="conflict_replace_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Replace the older item</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">conflict_ask_radio</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="conflict_skip_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Skip</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">conflict_ask_radio</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">12</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">7</property>
+ <property name="position">3</property>
</packing>
</child>
</widget>
Added: trunk/data/evolution-memos.png
==============================================================================
Binary files (empty file) and trunk/data/evolution-memos.png Fri Aug 29 23:40:12 2008 differ
Added: trunk/data/evolution-tasks.png
==============================================================================
Binary files (empty file) and trunk/data/evolution-tasks.png Fri Aug 29 23:40:12 2008 differ
Modified: trunk/test/python-tests/TestCoreVfs.py
==============================================================================
--- trunk/test/python-tests/TestCoreVfs.py (original)
+++ trunk/test/python-tests/TestCoreVfs.py Fri Aug 29 23:40:12 2008
@@ -3,86 +3,98 @@
import conduit.Vfs as Vfs
import conduit.utils as Utils
-safe = '/&=:@'
-unsafe = ' !<>#%()[]{}'
-safeunsafe = '%20%21%3C%3E%23%25%28%29%5B%5D%7B%7D'
-
-ok("Dont escape path characters",Vfs.uri_escape(safe+unsafe) == safe+safeunsafe)
-ok("Unescape back to original",Vfs.uri_unescape(safe+safeunsafe) == safe+unsafe)
-ok("Get protocol", Vfs.uri_get_protocol("file:///foo/bar") == "file://")
-name, ext = Vfs.uri_get_filename_and_extension("file:///foo/bar.ext")
-ok("Get filename (%s,%s)" % (name,ext), name == "bar" and ext == ".ext")
-ok("file:///home exists", Vfs.uri_exists("file:///home") == True)
-ok("/home exists", Vfs.uri_exists("/home") == True)
-ok("/home is folder", Vfs.uri_is_folder("/home") == True)
-ok("/foo/bar does not exist", Vfs.uri_exists("/foo/bar") == False)
-ok("format uri", Vfs.uri_format_for_display("file:///foo") == "/foo")
-
-tmpdiruri = Utils.new_tempdir()
-
-# Test the folder scanner theading stuff
-fileuri = Utils.new_tempfile("bla").get_local_uri()
-stm = Vfs.FolderScannerThreadManager(maxConcurrentThreads=1)
-
-def prog(*args): pass
-def done(*args): pass
-
-t1 = stm.make_thread("file:///tmp", False, False, prog, done)
-t2 = stm.make_thread("file://"+tmpdiruri, False, False, prog, done)
-stm.join_all_threads()
-
-ok("Scanned /tmp ok - found %s" % fileuri, "file://"+fileuri in t1.get_uris())
-ok("Scanned %s ok (empty)" % tmpdiruri, t2.get_uris() == [])
-
-# Test the volume management stuff
-ntfsUri = get_external_resources('folder')['ntfs-volume']
-fstype = Vfs.uri_get_filesystem_type(ntfsUri)
-ok("Get filesystem type (%s)" % fstype,fstype == "ntfs")
-ok("Escape illegal chars in filenames",
- Vfs.uri_sanitize_for_filesystem("invalid:name","ntfs") == "invalid name")
-ok("Escape illegal chars in uris",
- Vfs.uri_sanitize_for_filesystem("file:///i:n/i:n","ntfs") == "file:///i n/i n")
-
-localUri = get_external_resources('folder')['folder']
-ok("Local uri --> path", Vfs.uri_to_local_path(localUri) == "/tmp")
-ok("Local uri not removable", Vfs.uri_is_on_removable_volume(localUri) == False)
-
-removableUri = get_external_resources('folder')['removable-volume']
-ok("Removable volume detected removable", Vfs.uri_is_on_removable_volume(removableUri))
-ok("Removable volume calculate root path", Vfs.uri_get_volume_root_uri(removableUri).startswith("file:///media/"))
-
-URIS_TO_JOIN = (
- ( ("file:///foo/bar","gax","ssss"),
- "file:///foo/bar/gax/ssss"),
- ( ("smb://192.168.1.1","Disk-2","Travel%20Videos/","Switzerland"),
- "smb://192.168.1.1/Disk-2/Travel%20Videos/Switzerland"),
- ( ("ssh://john open grcnz com/home","john","phd"),
- "ssh://john open grcnz com/home/john/phd"),
- ( ("foo","bar","baz"),
- "foo/bar/baz")
-)
-
-for parts, result in URIS_TO_JOIN:
- ok("Join uri: %s" % result, Vfs.uri_join(*parts) == result)
-
-RELATIVE_URIS = (
- #from #to #relativ
-( "file:///foo/bar", "file:///baz/bob", "file:///baz/bob" ),
-( "file:///foo/bar", "file:///foo/bar/baz/bob", "baz/bob" ),
-( "file:///foo/bar", "file:///foo/bar/baz", "baz" ))
-for f,t,result in RELATIVE_URIS:
- ok("Get relative uri: %s" % result, Vfs.uri_get_relative(f,t) == result)
-
-VALID_URIS = (
- #uri #valid
-( "smb://192.168.1.1/foo/bar", True ),
-( "ftp://192.168.1.1/foo/bar", True ),
-( "file:///foo/bar", True ),
-( "file:/foo/bar", False ),
-( "ftp:192.168.1.1", False ),
-( "/foo/bar", False ))
-for uri,result in VALID_URIS:
- desc = ("Invalid","Valid")[int(result)]
- ok("%s uri: %s" % (desc,uri),Vfs.uri_is_valid(uri) == result)
+for impl in ("GIO", "GnomeVfs",):
+ conduit.FILE_IMPL = impl
+ reload(Vfs)
+ reload(Utils)
+
+ ok("--- TESTING VFS WITH FILE IMPL: %s" % impl, True)
+ #print Vfs.FolderScanner
+
+ safe = '/&=:@'
+ unsafe = ' !<>#%()[]{}'
+ safeunsafe = '%20%21%3C%3E%23%25%28%29%5B%5D%7B%7D'
+
+ ok("Dont escape path characters",Vfs.uri_escape(safe+unsafe) == safe+safeunsafe)
+ ok("Unescape back to original",Vfs.uri_unescape(safe+safeunsafe) == safe+unsafe)
+ ok("Get protocol", Vfs.uri_get_protocol("file:///foo/bar") == "file://")
+ name, ext = Vfs.uri_get_filename_and_extension("file:///foo/bar.ext")
+ ok("Get filename (%s,%s)" % (name,ext), name == "bar" and ext == ".ext")
+ ok("file:///home exists", Vfs.uri_exists("file:///home") == True)
+ ok("/home exists", Vfs.uri_exists("/home") == True)
+ ok("/home is folder", Vfs.uri_is_folder("/home") == True)
+ ok("/foo/bar does not exist", Vfs.uri_exists("/foo/bar") == False)
+ ok("format uri", Vfs.uri_format_for_display("file:///foo") == "/foo")
+
+ tmpdiruri = Utils.new_tempdir()
+
+ # Test the folder scanner theading stuff
+ fileuri = Utils.new_tempfile("bla").get_local_uri()
+ stm = Vfs.FolderScannerThreadManager(maxConcurrentThreads=1)
+
+ def prog(*args): pass
+ def done(*args): pass
+
+ t1 = stm.make_thread("file:///tmp", False, False, prog, done)
+ t2 = stm.make_thread("file://"+tmpdiruri, False, False, prog, done)
+ stm.join_all_threads()
+
+ ok("Scanned /tmp ok - found %s" % fileuri, "file://"+fileuri in t1.get_uris())
+ ok("Scanned %s ok (empty)" % tmpdiruri, t2.get_uris() == [])
+
+ # Test the volume management stuff
+ ntfsUri = get_external_resources('folder')['ntfs-volume']
+ if Vfs.uri_exists(ntfsUri):
+ fstype = Vfs.uri_get_filesystem_type(ntfsUri)
+ ok("Get filesystem type (%s)" % fstype,fstype == "ntfs", False)
+ #ok("Escape illegal chars in filenames",
+ # Vfs.uri_sanitize_for_filesystem("invalid:name","ntfs") == "invalid name")
+ #ok("Escape illegal chars in uris",
+ # Vfs.uri_sanitize_for_filesystem("file:///i:n/i:n","ntfs") == "file:///i n/i n")
+
+ localUri = get_external_resources('folder')['folder']
+ ok("Local uri --> path", Vfs.uri_to_local_path(localUri) == "/tmp")
+ ok("Local uri not removable", Vfs.uri_is_on_removable_volume(localUri) == False)
+
+ removableUri = get_external_resources('folder')['removable-volume']
+ if Vfs.uri_exists(removableUri):
+ fstype = Vfs.uri_get_filesystem_type(removableUri)
+ ok("Get filesystem type (%s)" % fstype,fstype in ("vfat","msdos"))
+ ok("Removable volume detected removable", Vfs.uri_is_on_removable_volume(removableUri))
+ ok("Removable volume calculate root path", Vfs.uri_get_volume_root_uri(removableUri).startswith("file:///media/"))
+
+ URIS_TO_JOIN = (
+ ( ("file:///foo/bar","gax","ssss"),
+ "file:///foo/bar/gax/ssss"),
+ ( ("smb://192.168.1.1","Disk-2","Travel%20Videos/","Switzerland"),
+ "smb://192.168.1.1/Disk-2/Travel%20Videos/Switzerland"),
+ ( ("ssh://john open grcnz com/home","john","phd"),
+ "ssh://john open grcnz com/home/john/phd"),
+ ( ("foo","bar","baz"),
+ "foo/bar/baz")
+ )
+
+ for parts, result in URIS_TO_JOIN:
+ ok("Join uri: %s" % result, Vfs.uri_join(*parts) == result)
+
+ RELATIVE_URIS = (
+ #from #to #relativ
+ ( "file:///foo/bar", "file:///baz/bob", "file:///baz/bob" ),
+ ( "file:///foo/bar", "file:///foo/bar/baz/bob", "baz/bob" ),
+ ( "file:///foo/bar", "file:///foo/bar/baz", "baz" ))
+ for f,t,result in RELATIVE_URIS:
+ ok("Get relative uri: %s" % result, Vfs.uri_get_relative(f,t) == result)
+
+ VALID_URIS = (
+ #uri #valid
+ ( "smb://192.168.1.1/foo/bar", True ),
+ ( "ftp://192.168.1.1/foo/bar", True ),
+ ( "file:///foo/bar", True ),
+ ( "file:/foo/bar", False ),
+ ( "ftp:192.168.1.1", False ),
+ ( "/foo/bar", False ))
+ for uri,result in VALID_URIS:
+ desc = ("Invalid","Valid")[int(result)]
+ ok("%s uri: %s" % (desc,uri),Vfs.uri_is_valid(uri) == result)
finished()
Modified: trunk/test/python-tests/data/folder.list
==============================================================================
--- trunk/test/python-tests/data/folder.list (original)
+++ trunk/test/python-tests/data/folder.list Fri Aug 29 23:40:12 2008
@@ -9,8 +9,8 @@
folder=file:///tmp
[john nzjrs-desktop]
-removable-volume=file:///media/media/MusicToSort/Kora
-ntfs-volume=file:///media/windows
+removable-volume=file:///media/JRS89
+ntfs-volume=file:///media/disk
[john nzjrs-uni]
removable-volume=file:///media/sda2/dell
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]