The branch, eden-pre has been updated
       via  f4f394473477a787cfcd9f5bf244100fca5cf25e (commit)
       via  a9ddb499af125bf60a108bcf43dfd605f55cbae5 (commit)
      from  98c2c787e601d3cfa6e8f0c330e42ca0a8440781 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=f4f394473477a787cfcd9f5bf244100fca5cf25e

commit f4f394473477a787cfcd9f5bf244100fca5cf25e
Author: spiff <[email protected]>
Date:   Thu May 12 18:53:07 2011 +0200

    [plugin.image.iphoto] updated to version 1.5.1

diff --git a/plugin.image.iphoto/addon.py b/plugin.image.iphoto/addon.py
index 63d7cba..b0d219d 100644
--- a/plugin.image.iphoto/addon.py
+++ b/plugin.image.iphoto/addon.py
@@ -11,20 +11,24 @@ import sys
 import time
 import os
 import glob
-import shutil
 
 import xbmc
 import xbmcgui as gui
 import xbmcplugin as plugin
 import xbmcaddon
 
-#try:
-#    import xbmcvfs
-#except ImportError:
-#    import shutil
-#    copyfile = shutil.copyfile
-#else:
-#    copyfile = xbmcvfs.copy
+try:
+    import xbmcvfs
+except ImportError:
+    import shutil
+    copyfile = shutil.copyfile
+else:
+    copyfile = xbmcvfs.copy
+
+try:
+    from hashlib import md5
+except ImportError:
+    import md5
 
 addon = xbmcaddon.Addon(id="plugin.image.iphoto")
 ALBUM_DATA_XML = "AlbumData.xml"
@@ -65,6 +69,16 @@ else:
     media_sort_col = "NULL"
 
 
+def md5sum(filename):
+    try:
+       m = md5()
+    except:
+       m = md5.new()
+    with open(filename, 'rb') as f:
+       for chunk in iter(lambda: f.read(128 * m.block_size), ''):
+           m.update(chunk)
+    return m.hexdigest()
+
 def render_media(media):
     global view_mode
 
@@ -479,16 +493,13 @@ if (__name__ == "__main__"):
        except:
            pass
 
-    # we used to store the file path to the XML instead of the iPhoto Library
-    # directory.
+    # we used to store the file path to the XML instead of the iPhoto Library 
directory.
     if (os.path.basename(xmlpath) == ALBUM_DATA_XML):
        xmlpath = os.path.dirname(xmlpath)
        addon.setSetting('albumdata_xml_path', xmlpath)
 
     origxml = os.path.join(xmlpath, ALBUM_DATA_XML)
     xmlfile = xbmc.translatePath(os.path.join(addon.getAddonInfo("Profile"), 
"iphoto.xml"))
-    shutil.copyfile(origxml, xmlfile)
-    shutil.copystat(origxml, xmlfile)
 
     enable_places = True
     e = addon.getSetting('places_enable')
@@ -553,15 +564,13 @@ if (__name__ == "__main__"):
            auto_update_lib = "false"
            addon.setSetting('auto_update_lib', auto_update_lib)
        if (auto_update_lib == "true"):
-           try:
-               xml_mtime = os.path.getmtime(xmlfile)
-               db_mtime = os.path.getmtime(db_file)
-           except Exception, e:
-               print to_str(e)
-               pass
+           tmpfile = xmlfile + ".new"
+           copyfile(origxml, tmpfile)
+           if (os.path.isfile(xmlfile) and md5sum(tmpfile) == md5sum(xmlfile)):
+               os.remove(tmpfile)
            else:
-               if (xml_mtime > db_mtime):
-                   import_library(xmlpath, xmlfile, enable_places)
+               os.rename(tmpfile, xmlfile)
+               import_library(xmlpath, xmlfile, enable_places)
     else:
        items = None
        if (action == "events"):
@@ -584,6 +593,7 @@ if (__name__ == "__main__"):
        elif (action == "ratings"):
            items = list_ratings(params)
        elif (action == "rescan"):
+           copyfile(origxml, xmlfile)
            import_library(xmlpath, xmlfile, enable_places)
        elif (action == "hidekeyword"):
            items = hide_keyword(params)
@@ -600,3 +610,5 @@ if (__name__ == "__main__"):
                    xbmc.executebuiltin("Container.SetViewMode(510)")
                elif (view_mode == 2):
                    xbmc.executebuiltin("Container.SetViewMode(514)")
+
+# vim: tabstop=8 softtabstop=4 shiftwidth=4 noexpandtab:
diff --git a/plugin.image.iphoto/addon.xml b/plugin.image.iphoto/addon.xml
index 9f80aa1..f6669b2 100644
--- a/plugin.image.iphoto/addon.xml
+++ b/plugin.image.iphoto/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.image.iphoto" name="iPhoto" version="1.5.0" 
provider-name="jingai">
+<addon id="plugin.image.iphoto" name="iPhoto" version="1.5.1" 
provider-name="jingai">
     <requires>
        <import addon="xbmc.python" version="2.0"/>
        <import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/plugin.image.iphoto/changelog.txt 
b/plugin.image.iphoto/changelog.txt
index 236306c..67542f4 100644
--- a/plugin.image.iphoto/changelog.txt
+++ b/plugin.image.iphoto/changelog.txt
@@ -1,3 +1,6 @@
+1.5.1 - 20110511
+- Use xbmcvfs to access iPhoto XML.
+
 1.5.0 - 20110504
 - Eden API changes.
 - Confluence view mode IDs changed.
diff --git a/plugin.image.iphoto/resources/lib/geo.py 
b/plugin.image.iphoto/resources/lib/geo.py
index ba41dfb..eb0ca93 100644
--- a/plugin.image.iphoto/resources/lib/geo.py
+++ b/plugin.image.iphoto/resources/lib/geo.py
@@ -257,3 +257,5 @@ if (__name__ == "__main__"):
        print map.fetch("map_", "")
     except:
        print_exc()
+
+# vim: tabstop=8 softtabstop=4 shiftwidth=4 noexpandtab:
diff --git a/plugin.image.iphoto/resources/lib/iphoto_parser.py 
b/plugin.image.iphoto/resources/lib/iphoto_parser.py
index d0196bd..22dd9c4 100644
--- a/plugin.image.iphoto/resources/lib/iphoto_parser.py
+++ b/plugin.image.iphoto/resources/lib/iphoto_parser.py
@@ -1158,3 +1158,5 @@ def main():
 if __name__=="__main__":
     #main()
     profile_main()
+
+# vim: tabstop=8 softtabstop=4 shiftwidth=4 noexpandtab:

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=a9ddb499af125bf60a108bcf43dfd605f55cbae5


-----------------------------------------------------------------------

Summary of changes:
 plugin.image.iphoto/addon.py                       |   52 ++++---
 plugin.image.iphoto/addon.xml                      |    2 +-
 plugin.image.iphoto/changelog.txt                  |    3 +
 plugin.image.iphoto/resources/lib/geo.py           |    2 +
 plugin.image.iphoto/resources/lib/iphoto_parser.py |    2 +
 .../LICENSE.txt                                    |    0
 plugin.video.diy/addon.xml                         |   20 +++
 plugin.video.diy/default.py                        |  177 ++++++++++++++++++++
 plugin.video.diy/icon.png                          |  Bin 0 -> 80621 bytes
 .../resources/language/English/strings.xml         |   61 +++++++
 10 files changed, 298 insertions(+), 21 deletions(-)
 copy {plugin.video.rbk.no => plugin.video.diy}/LICENSE.txt (100%)
 create mode 100644 plugin.video.diy/addon.xml
 create mode 100644 plugin.video.diy/default.py
 create mode 100644 plugin.video.diy/icon.png
 create mode 100644 plugin.video.diy/resources/language/English/strings.xml


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to