Hello community,

here is the log from the commit of package datovka for openSUSE:Factory checked 
in at 2014-10-01 07:40:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/datovka (Old)
 and      /work/SRC/openSUSE:Factory/.datovka.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "datovka"

Changes:
--------
--- /work/SRC/openSUSE:Factory/datovka/datovka.changes  2013-11-07 
12:51:32.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.datovka.new/datovka.changes     2014-10-01 
07:40:49.000000000 +0200
@@ -1,0 +2,8 @@
+Mon Sep 15 14:30:05 UTC 2014 - tchva...@suse.com
+
+- Version bump to 3.1:
+  * Detect better file suffixes
+  * work with sqlalchemy 0.9
+- Cleanup with spec-cleaner
+
+-------------------------------------------------------------------

Old:
----
  datovka-3.0.3.tar.gz

New:
----
  datovka-3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ datovka.spec ++++++
--- /var/tmp/diff_new_pack.Q3KvZ7/_old  2014-10-01 07:40:51.000000000 +0200
+++ /var/tmp/diff_new_pack.Q3KvZ7/_new  2014-10-01 07:40:51.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package datovka
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,18 +16,23 @@
 #
 
 
+%if 0%{?suse_version} && 0%{?suse_version} <= 1110
+%{!?python_sitelib: %global python_sitelib %(python -c "from 
distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%else
+BuildArch:      noarch
+%endif
 Name:           datovka
-Version:        3.0.3
+Version:        3.1
 Release:        0
 Summary:        Library to access Czech eGov system \"Datove schranky\"
 License:        LGPL-2.0+
 Group:          Development/Libraries/Python
 Url:            http://labs.nic.cz/page/969/datovka/
-Source0:        %{name}-%{version}.tar.gz
+Source0:        
http://www.nic.cz/public_media/datove_schranky/releases/src/%{name}-%{version}.tar.gz
 BuildRequires:  dejavu
 BuildRequires:  fdupes
 BuildRequires:  python
-BuildRequires:  python-dslib >= 3.0
+BuildRequires:  python-dslib >= 3.1
 BuildRequires:  python-gtk
 BuildRequires:  python-openssl
 BuildRequires:  python-reportlab
@@ -35,19 +40,14 @@
 BuildRequires:  python-sqlalchemy
 BuildRequires:  update-desktop-files
 Requires:       dejavu
-Requires:       python-dslib >= 3.0
+Requires:       python-dslib >= 3.1
 Requires:       python-gtk
 Requires:       python-openssl
 Requires:       python-reportlab
 Requires:       python-setuptools
 Requires:       python-sqlalchemy
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-%py_requires
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from 
distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
-BuildArch:      noarch
-%endif
+%{py_requires}
 
 %description
 A library for accessing ISDS (Informační system datovych schranek/
@@ -67,30 +67,31 @@
 python setup.py build
 
 %install
-python setup.py install --prefix=%{_prefix} --optimize=2 --root="%{buildroot}"
+python setup.py install --prefix=%{_prefix} --optimize=2 --root=%{buildroot}
 %fdupes %{buildroot}
 %find_lang %{name}
 
-for file in %{buildroot}%{python_sitelib}/%name/{_update_license,datovka}.py ; 
do
+for file in %{buildroot}%{python_sitelib}/%{name}/{_update_license,datovka}.py 
; do
        chmod a+x $file
 done
-chmod a-x %{buildroot}%_datadir/applications/%name.desktop
-%suse_update_desktop_file %{buildroot}%_datadir/applications/%name.desktop
+chmod a-x %{buildroot}%{_datadir}/applications/%{name}.desktop
+%suse_update_desktop_file %{buildroot}%{_datadir}/applications/%{name}.desktop
 
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
 %files lang -f %{name}.lang
+%defattr(-,root,root)
 
 %files
 %defattr(-,root,root)
 %doc LICENSE README.txt
-%dir %_datadir/%name
+%dir %{_datadir}/%{name}
 %{python_sitelib}/*
-%_bindir/%name
-%_datadir/%name/*
-%_datadir/applications/%name.desktop
-%_datadir/icons/hicolor/*
+%{_bindir}/%{name}
+%{_datadir}/%{name}/*
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/icons/hicolor/*
 
 %changelog

++++++ datovka-3.0.3.tar.gz -> datovka-3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/PKG-INFO new/datovka-3.1/PKG-INFO
--- old/datovka-3.0.3/PKG-INFO  2013-01-04 12:58:31.000000000 +0100
+++ new/datovka-3.1/PKG-INFO    2014-07-11 15:42:06.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
 Name: datovka
-Version: 3.0.3
+Version: 3.1
 Summary: Datovka (formerly dsgui) is a free graphical interface for 'Datove 
schranky'
 Home-page: http://labs.nic.cz/datove-schranky/
 Author: CZ.NIC Labs
@@ -10,8 +10,3 @@
 Platform: Unix
 Platform: Windows
 Platform: MacOS X
-Requires: gtk
-Requires: pygtk
-Requires: dslib (>=3.0)
-Requires: SQLAlchemy (>=0.5)
-Requires: dejavu_font
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/README.txt new/datovka-3.1/README.txt
--- old/datovka-3.0.3/README.txt        2013-01-04 12:55:59.000000000 +0100
+++ new/datovka-3.1/README.txt  2014-06-18 22:44:58.000000000 +0200
@@ -24,6 +24,14 @@
 Verze Datovky
 ===============
 
+* verze 3.1 -
+    Update dslib - podpora nejnovější SQLAlchemy (0.9), přidané indexy do
+    databáze.
+    Pokud systém samotný správně nerozezná media type, tak u souborů .docx,
+    .xlsx, .pptx, .odt, .ods, .odp, .fo a .zfo jsou správně určeny.
+    Opravena chyba v zobrazování chybové hlášky pokud systém zprávu předává v
+    jiném kódování než utf-8.
+
 * verze 3.0.3 -
     Bylo přidáno zapamatování pozice posuvníků mezi jednotlivými prvky
     grafického rozhraní. Opravena byla chyba zapamatování řadícího sloupce
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/_fill_fake_db.py 
new/datovka-3.1/_fill_fake_db.py
--- old/datovka-3.0.3/_fill_fake_db.py  2012-12-11 10:08:47.000000000 +0100
+++ new/datovka-3.1/_fill_fake_db.py    1970-01-01 01:00:00.000000000 +0100
@@ -1,109 +0,0 @@
-import sqlite3
-
-conn = sqlite3.connect("/home/beda/.dsgui/aaa___1.db")
-cursor = conn.cursor()
-cursor.execute("SELECT dmID FROM messages;")
-msg_ids = [x[0] for x in cursor.fetchall()]
-max_msg_id = max(msg_ids)
-
-print "Max message ID: %d" % max_msg_id
-
-table_cols = {
-"messages":
-    ("dmID",
-    "is_verified",
-    "_origin",
-    "dbIDSender",
-    "dmSender",
-    "dmSenderAddress",
-    "dmSenderType",
-    "dmRecipient",
-    "dmRecipientAddress",
-    "dmAmbiguousRecipient",
-    "dmSenderOrgUnit",
-    "dmSenderOrgUnitNum",
-    "dbIDRecipient",
-    "dmRecipientOrgUnit",
-    "dmRecipientOrgUnitNum",
-    "dmToHands",
-    "dmAnnotation",
-    "dmRecipientRefNumber",
-    "dmSenderRefNumber",
-    "dmRecipientIdent",
-    "dmSenderIdent",
-    "dmLegalTitleLaw",
-    "dmLegalTitleYear",
-    "dmLegalTitleSect",
-    "dmLegalTitlePar",
-    "dmLegalTitlePoint",
-    "dmPersonalDelivery",
-    "dmAllowSubstDelivery",
-    "dmQTimestamp",
-    "dmDeliveryTime",
-    "dmAcceptanceTime",
-    "dmMessageStatus",
-    "dmAttachmentSize",
-    "_dmType",),
-"hashes":
-    ("message_id",
-     "value",
-     "_algorithm",),
-"files":
-    ("message_id",
-     "_dmFileDescr",
-     "_dmUpFileGuid",
-     "_dmFileGuid",
-     "_dmMimeType",
-     "_dmFormat",
-     "_dmFileMetaType",
-     "dmEncodedContent"),
-"message_certificate_data":
-    ("message_id",
-     "certificate_id"),
-"raw_message_data":
-    ("message_id",
-     "message_type",
-     "data"),
-"raw_delivery_info_data":
-    ("message_id",
-     "data"),
-"supplementary_message_data":
-    ("message_id",
-     "message_type",
-     "read_locally",
-     "download_date",
-     "custom_data"),
-"events":
-    ("message_id",
-     "dmEventTime",
-     "dmEventDescr")
-}
-
-tables = list(table_cols.keys())
-tables.remove("messages")
-tables.insert(0, "messages")
-
-for msg_id in msg_ids:
-    max_msg_id += 1
-    new_id = max_msg_id
-    print "Copying", msg_id
-    for table in tables:
-        print "  -", table
-        if table == "messages":
-            id_col = "dmID"
-        else:
-            id_col = "message_id"
-        cols = table_cols[table]
-        all = ",".join(cols)
-        copied = ",".join(cols[1:])
-        insert_command = """INSERT INTO {0} ({1})
-                            SELECT ?,{2}
-                            FROM {0} WHERE {3}=?;""".format(table, all, copied,
-                                                            id_col)
-        #print insert_command
-        cursor.execute(insert_command, (new_id, msg_id,))
-conn.commit()
-
-
-cursor.close()
-conn.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/datovka.egg-info/PKG-INFO 
new/datovka-3.1/datovka.egg-info/PKG-INFO
--- old/datovka-3.0.3/datovka.egg-info/PKG-INFO 2013-01-04 12:58:31.000000000 
+0100
+++ new/datovka-3.1/datovka.egg-info/PKG-INFO   2014-07-11 15:42:06.000000000 
+0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
 Name: datovka
-Version: 3.0.3
+Version: 3.1
 Summary: Datovka (formerly dsgui) is a free graphical interface for 'Datove 
schranky'
 Home-page: http://labs.nic.cz/datove-schranky/
 Author: CZ.NIC Labs
@@ -10,8 +10,3 @@
 Platform: Unix
 Platform: Windows
 Platform: MacOS X
-Requires: gtk
-Requires: pygtk
-Requires: dslib (>=3.0)
-Requires: SQLAlchemy (>=0.5)
-Requires: dejavu_font
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/datovka.egg-info/SOURCES.txt 
new/datovka-3.1/datovka.egg-info/SOURCES.txt
--- old/datovka-3.0.3/datovka.egg-info/SOURCES.txt      2013-01-04 
12:58:31.000000000 +0100
+++ new/datovka-3.1/datovka.egg-info/SOURCES.txt        2014-07-11 
15:42:06.000000000 +0200
@@ -13,7 +13,6 @@
 setup.py
 stdeb.cfg
 ./__init__.py
-./_fill_fake_db.py
 ./_update_license.py
 ./account.py
 ./cert_display.py
@@ -29,7 +28,6 @@
 ./dumb_shelf.py
 ./error_handling.py
 ./export.py
-./hack_ped.py
 ./icon_manager.py
 ./local.py
 ./message_dialog.py
@@ -150,5 +148,4 @@
 ui/ds_send.ui
 ui/message_dialog.ui
 ui/otp_dialog.ui
-ui/proxy_dialog.ui
-ui/tmp.ui
\ No newline at end of file
+ui/proxy_dialog.ui
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/datovka.egg-info/requires.txt 
new/datovka-3.1/datovka.egg-info/requires.txt
--- old/datovka-3.0.3/datovka.egg-info/requires.txt     2013-01-04 
12:58:31.000000000 +0100
+++ new/datovka-3.1/datovka.egg-info/requires.txt       2014-07-11 
15:42:06.000000000 +0200
@@ -1,2 +1,2 @@
 dslib >= 3.0
-SQLAlchemy >= 0.5
\ No newline at end of file
+SQLAlchemy >= 0.8
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/datovka.py new/datovka-3.1/datovka.py
--- old/datovka-3.0.3/datovka.py        2013-01-04 12:45:45.000000000 +0100
+++ new/datovka-3.1/datovka.py  2014-07-11 10:51:13.000000000 +0200
@@ -203,7 +203,7 @@
 import ConfigParser
 import codecs
 try:
-    import gtk_osxapplication as QuartzApp
+    import gtkosx_application as QuartzApp
 except ImportError:
     QUARTZ_ENABLE = False
 else:
@@ -357,7 +357,7 @@
     self._last_otp_problem = None
     self.toplevel_message_store = None
     if QUARTZ_ENABLE:
-        self.macapp = QuartzApp.OSXApplication()
+        self.macapp = QuartzApp.Application()
     # here we save last directories for different functions
     self._last_dirs = {}
     # this is a event for synchronization of async stuff
@@ -1018,6 +1018,8 @@
     # available already
     if not self.account.account_info:
       self._sync_account_and_password_info()
+    if not self.account.account_info: # we weren't able to sync account, give 
it up
+      return
     # the send dialog itself
     dial = DsSendDialog(self, reply_to=reply_to)
     DsSendDialog._last_dir = self._get_topical_last_dir("ds_send")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/ds_send.py new/datovka-3.1/ds_send.py
--- old/datovka-3.0.3/ds_send.py        2012-12-20 14:25:16.000000000 +0100
+++ new/datovka-3.1/ds_send.py  2014-06-18 22:45:00.000000000 +0200
@@ -152,7 +152,8 @@
     d.destroy()
     if result == 1:
       for box in boxes:
-        self._add_recipient_row([box[0],box[1],box[2]+", "+box[3]])
+        addr_join = ", ".join(  filter(None, (box[2], box[3])))
+        self._add_recipient_row([box[0],box[1],addr_join])
     self._check_requisities()
     
   def on_add_recipient_from_contacts_activate(self, w):
@@ -201,11 +202,23 @@
         mimetype, encoding = mimetypes.guess_type(fullname)
         if mimetype == "application/xml":
           mimetype = "text/xml"
+        mime_list = {
+          '.fo': "application/vnd.software602.filler.form+xml",
+          '.zfo': "application/vnd.software602.filler.form-xml-zip",
+          '.odt': "application/vnd.oasis.opendocument.text",
+          '.ods': "application/vnd.oasis.opendocument.spreadsheet",
+          '.odp': "application/vnd.oasis.opendocument.presentation",
+          '.docx': 
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+          '.xlsx': 
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+          '.pptx': 
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
+        }
         if not mimetype:
-          if name.endswith(".zfo"):
-            mimetype = "application/zip"
+          _name, ext = os.path.splitext(fullname)
+          if ext and ext in mime_list:
+            mimetype = mime_list[ext]
           else:
-            mimetype = "text/plain"
+            mimetype = "text/plain" # or maybe consider 
"application/octet-stream"
+        
         normname = os.path.normcase(fullname)
         for row in self.attachment_store:
           if row[1] == normname:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/error_handling.py 
new/datovka-3.1/error_handling.py
--- old/datovka-3.0.3/error_handling.py 2012-12-18 14:49:32.000000000 +0100
+++ new/datovka-3.1/error_handling.py   2014-06-18 22:45:00.000000000 +0200
@@ -26,6 +26,7 @@
 import sys
 import webbrowser
 import logging
+import locale
 
 # external imports
 import gtk
@@ -76,16 +77,23 @@
     """
     Creates a formated text that is 
     """
-    cp = os_support.get_default_text_encoding()
+    cp = (os_support.get_default_text_encoding()
+            or locale.getlocale()[1]
+            or locale.getdefaultlocale()[1]
+            or "ascii")
     detail = ""
-    if hasattr(self.inner_exception, "strerror"):
-      try:
-        desc = self.inner_exception.strerror.decode(cp)
-      except Exception, e:
-        # this should work, even though it might not look pretty
-        desc = unicode(self.inner_exception)
-    else:
-      desc = unicode(self.inner_exception)
+    
+    try:
+        if hasattr(self.inner_exception, "strerror"):
+            if isinstance(self.inner_exception.strerror, unicode):
+                desc = self.inner_exception.strerror
+            else:
+                desc = self.inner_exception.strerror.decode(cp)
+        else:
+            desc = unicode(self.inner_exception)
+    except Exception, e:
+        desc = u"unknown error"
+    
     return desc[:300]
 
   def get_help(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/hack_ped.py new/datovka-3.1/hack_ped.py
--- old/datovka-3.0.3/hack_ped.py       2012-12-11 10:08:47.000000000 +0100
+++ new/datovka-3.1/hack_ped.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-import sys
-sys.path.append("/home/beda/projects/isds/dsgui/dslib/")
-import shelve
-from datetime import datetime
-
-sh = shelve.open("/home/beda/.dsgui/messages.shelf")
-
-ped = datetime(2012,3,10)
-print ped
-
-for key in ['wh5ef3___True','7io3jf___True']:
-    rec = sh[key]
-    print key, rec['password_expiration_date']
-    rec['password_expiration_date'] = ped
-    print key, rec['password_expiration_date']
-    sh[key] = rec
-
-sh.sync()
-sh.close()
Files old/datovka-3.0.3/locale/cs/LC_MESSAGES/datovka.mo and 
new/datovka-3.1/locale/cs/LC_MESSAGES/datovka.mo differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/release.py new/datovka-3.1/release.py
--- old/datovka-3.0.3/release.py        2013-01-04 12:47:31.000000000 +0100
+++ new/datovka-3.1/release.py  2014-06-18 22:44:58.000000000 +0200
@@ -16,4 +16,4 @@
 #*    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 #*    USA
 
-DSGUI_VERSION = "3.0.3"
+DSGUI_VERSION = "3.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/setup.py new/datovka-3.1/setup.py
--- old/datovka-3.0.3/setup.py  2012-12-18 14:49:32.000000000 +0100
+++ new/datovka-3.1/setup.py    2014-07-11 12:20:46.000000000 +0200
@@ -19,6 +19,11 @@
 #*    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
02110-1301  USA
 
 
+# py2app code partly taken from partly inspired by setup.py
+# from the Tryton project (www.tryton.org)
+# Copyright (C) 2004-2014 Tryton team 
(hg.tryton.org/tryton/file/971f862eb459/COPYRIGHT)
+
+
 import sys
 import glob
 import os
@@ -75,18 +80,204 @@
   package_dir = {'datovka': './'},
   data_files = data_files,
   scripts = ['datovka'],
-  requires=['gtk',"pygtk",'dslib (>=3.0)',"SQLAlchemy (>=0.5)", "dejavu_font"],
-  install_requires=['dslib >= 3.0',"SQLAlchemy >= 0.5"],
+  install_requires=['dslib >= 3.0',"SQLAlchemy >= 0.8"],
   zip_safe=False,
   )
 
 if sys.platform == "darwin":
-  data.update(
-    options={'py2app': {'argv_emulation': False}},
-    app=['datovka.py'],
-    setup_requires=['py2app'],
-    install_requires=["SQLAlchemy >= 0.5"],
-    )
+    data.update(
+        options ={ 'py2app': {
+            'argv_emulation': False,
+            'iconfile': "icons/datovka.icns",
+            'includes': "cairo, gio, atk, pango, pangocairo, "
+                        "sqlalchemy.dialects.sqlite, gtk.keysyms",
+            'packages': "reportlab, dslib",
+            'plist': {
+                'CFBundleIdentifier': "cz.nic.labs.datovka",
+                'CFBundleName': "Datovka"
+            }
+        }},
+        app=['datovka.py'],
+        setup_requires=['py2app'],
+        install_requires=["SQLAlchemy >= 0.8"],
+)
+
+dist = setup(**data)
+
+if sys.platform == 'darwin' and 'py2app' in dist.commands:
+    def find_gtk_dir():
+        for directory in os.environ['PATH'].split(':'):
+            if not os.path.isdir(directory):
+                continue
+            for file in ('gtk-demo',):
+                if os.path.isfile(os.path.join(directory, file)):
+                    return os.path.dirname(directory)
+        return None
+
+    import shutil
+    import re
+    from subprocess import Popen, PIPE
+    from itertools import chain
+    
+    gtk_dir = find_gtk_dir()
+    gtk_binary_version = Popen(['pkg-config',
+            '--variable=gtk_binary_version', 'gtk+-2.0'],
+        stdout=PIPE).stdout.read().strip()
+
+    dist_dir = dist.command_obj['py2app'].dist_dir
+    resources_dir = os.path.join(dist_dir, 'Datovka.app', 'Contents',
+        'Resources')
+    gtk_2_dist_dir = os.path.join(resources_dir, 'lib', 'gtk-2.0')
+    pango_dist_dir = os.path.join(resources_dir, 'lib', 'pango')
+    config_dir = os.path.join(resources_dir, 'etc')
+    os.mkdir(config_dir)
+    os.mkdir(os.path.join(config_dir, 'pango'))
+    os.mkdir(os.path.join(config_dir, 'gtk-2.0'))
+    gtkrc_file = os.path.join(config_dir, "gtk-2.0", "gtkrc")
+    
+    shutil.copytree(os.path.join(gtk_dir, 'lib', 'pango'), pango_dist_dir,
+                    ignore=shutil.ignore_patterns('*.la', '*.a'))
+
+    query_pango = Popen(os.path.join(gtk_dir, 'bin', 'pango-querymodules'),
+            stdout=PIPE).stdout.read()
+    query_pango = query_pango.replace(gtk_dir,
+        '@executable_path/../Resources')
+    pango_modules_path = os.path.join(config_dir, 'pango', 'pango.modules')
+    with open(pango_modules_path, 'w') as pango_modules:
+        pango_modules.write(query_pango)
+
+    with open(os.path.join(config_dir, 'pango', 'pangorc'), 'w') as pangorc:
+        pangorc.write('[Pango]\n')
+        pangorc.write('ModuleFiles=etc/pango/pango.modules\n')
+
+    query_loaders = Popen(os.path.join(gtk_dir, 'bin',
+            'gdk-pixbuf-query-loaders'), stdout=PIPE).stdout.read()
+    loader_dir, = re.findall('# LoaderDir = (.*)', query_loaders)
+    loader_pkg = (loader_dir.replace(os.path.join(gtk_dir, 'lib'),
+            '').split(os.path.sep)[-3])
+    loader_dist_dir = os.path.join(resources_dir, 'lib', loader_pkg,
+            gtk_binary_version, 'loaders')
+    if os.path.isdir(loader_dist_dir):
+        shutil.rmtree(loader_dist_dir)
+    if os.path.isdir(loader_dir):
+        shutil.copytree(loader_dir, loader_dist_dir,
+                        ignore=shutil.ignore_patterns('*.la', '*.a'))
+    query_loaders = query_loaders.replace(os.path.join(gtk_dir, ''),
+        '')
+
+    loaders_path = os.path.join(config_dir, 'gtk-2.0', 'gdk-pixbuf.loaders')
+    with open(loaders_path, 'w') as loaders:
+        loaders.write(query_loaders)
+
+    if os.path.isdir(os.path.join(gtk_2_dist_dir, gtk_binary_version,
+                'immodules')):
+        shutil.rmtree(os.path.join(gtk_2_dist_dir, gtk_binary_version,
+                'immodules'))
+    shutil.copytree(
+            os.path.join(gtk_dir, 'lib', 'gtk-2.0', gtk_binary_version, 
'immodules'),
+            os.path.join(gtk_2_dist_dir, gtk_binary_version, 'immodules'),
+            ignore=shutil.ignore_patterns('*.la', '*.a'))
+
+    query_immodules = Popen(os.path.join(gtk_dir, 'bin',
+            'gtk-query-immodules-2.0'), stdout=PIPE).stdout.read()
+    query_immodules = query_immodules.replace(gtk_dir,
+        '@executable_path/../Resources')
+
+    immodules_path = os.path.join(config_dir, 'gtk-2.0', 'gtk.immodules')
+    with open(immodules_path, 'w') as immodules:
+        immodules.write(query_immodules)
+
+    shutil.copytree(
+            os.path.join(gtk_dir, 'lib', 'gtk-2.0', 'modules'),
+            os.path.join(gtk_2_dist_dir, 'modules'),
+            ignore=shutil.ignore_patterns('*.la', '*.a'))
+    shutil.copytree(
+            os.path.join(gtk_dir, 'lib', 'gtk-2.0', gtk_binary_version, 
'engines'),
+            os.path.join(gtk_2_dist_dir, gtk_binary_version, 'engines'),
+            ignore=shutil.ignore_patterns('*.la', '*.a'))
+
+    for lang in langs:
+        for mo_file in glob.glob(os.path.join(gtk_dir, 'share', 'locale', lang,
+                                              'LC_MESSAGES', '*.mo')):
+            shutil.copy(mo_file, os.path.join(resources_dir, 'share', 'locale',
+                                              lang, 'LC_MESSAGES'))
+    
+    # share/mime/mime.cache is important, without it gdk-pixbuf is failing 
mysteriously
+    share_mime_dir = os.path.join(resources_dir, 'share', 'mime')
+    os.mkdir(share_mime_dir)
+    shutil.copy(os.path.join(gtk_dir, 'share', 'mime', 'mime.cache'),
+                share_mime_dir)
+
+    # fix paths within shared libraries
+    print "\nfixing paths within shared libraries"
+
+    for library in (os.path.join(root, fname)
+            for root, _dir, fnames in chain(
+                    os.walk(gtk_2_dist_dir),
+                    os.walk(pango_dist_dir),
+                    os.walk(loader_dist_dir))
+            for fname in fnames
+            if fname.endswith(".so")):
+        print library
+        libs = [lib.split('(')[0].strip()
+            for lib in Popen(['otool', '-L', library],
+                stdout=PIPE).communicate()[0].splitlines()
+            if 'compatibility' in lib]
+        libs = dict(((lib, None) for lib in libs if gtk_dir in lib))
+        for lib in libs.keys():
+            fixed = lib.replace(gtk_dir + '/lib',
+                '@executable_path/../Frameworks')
+            Popen(['install_name_tool', '-change', lib, fixed,
+                    library]).wait()
+
+    # create shell file which sets up all the necessary environmental variables
+    macos_dir = os.path.join(dist_dir, 'Datovka.app', 'Contents', 'MacOS')
+    launcher_file = os.path.join(macos_dir, 'Datovka')
+    os.rename(launcher_file, os.path.join(macos_dir, 'Datovka.bin'))
+    with open(launcher_file, 'w') as launcher_script:
+        launcher_script.write(
+"""#!/bin/bash
+
+# find out where the contents of the bundle is
+
+PWD=`pwd`
+DIRNAME=`dirname "$0"`
+if [[ "$DIRNAME" = /* ]]; then
+    # absolute path
+    CONTENTS_DIR=$DIRNAME
+else
+    if [[ "$DIRNAME" = "." ]]; then
+        CONTENTS_DIR=$PWD;
+    else
+        CONTENTS_DIR=$PWD/$DIRNAME
+    fi
+fi
+
+CONTENTS_DIR=`dirname "$CONTENTS_DIR"`
+
+# setup some environment variables
+export FONTCONFIG_FILE="$CONTENTS_DIR/Resources/etc/fonts/fonts.conf"
+export 
GDK_PIXBUF_MODULE_FILE="$CONTENTS_DIR/Resources/etc/gtk-2.0/gdk-pixbuf.loaders"
+export PANGO_RC_FILE="$CONTENTS_DIR/Resources/etc/pango/pangorc"
+export GTK2_RC_FILES="$CONTENTS_DIR/Resources/etc/gtk-2.0/gtkrc"
+export LOCALEDIR="$CONTENTS_DIR/Resources/share/locale"
+export XDG_DATA_DIRS="$CONTENTS_DIR/Resources/share"
+export DSGUI_DATA_DIR="$CONTENTS_DIR/Resources"
+
+# run the main executable
+exec $CONTENTS_DIR/MacOS/Datovka.bin
 
-set = setup(**data)
+"""
+)
+    os.chmod(launcher_file, 0755)
+    
+    with open(gtkrc_file, "w") as gtkrc_fh:
+        gtkrc_fh.write(
+"""gtk-toolbar-style   = GTK_TOOLBAR_ICONS
+gtk-icon-sizes = 
"gtk-menu=13,13:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-dnd=32,32"
+gtk-toolbar-icon-size = large-toolbar
+gtk-button-images = 0
+gtk-menu-images = 1
+"""
+)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/stdeb.cfg new/datovka-3.1/stdeb.cfg
--- old/datovka-3.0.3/stdeb.cfg 2012-12-18 14:49:32.000000000 +0100
+++ new/datovka-3.1/stdeb.cfg   2014-06-18 22:44:58.000000000 +0200
@@ -3,7 +3,7 @@
 Provides: dsgui, datovka
 Replaces: python-dsgui (<< 1.7-1~)
 Breaks: python-dsgui (<< 1.7-1~)
-Depends: python-dslib (>=3.0), python-sqlalchemy, python-gtk2
+Depends: python-dslib (>=3.1), python-sqlalchemy (>=0.8), python-gtk2
 Recommends: python-reportlab, ttf-dejavu
 XS-Python-Version: >= 2.6
 MIME-Desktop-Files: datovka.desktop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/datovka-3.0.3/ui/tmp.ui new/datovka-3.1/ui/tmp.ui
--- old/datovka-3.0.3/ui/tmp.ui 2010-11-16 15:21:50.000000000 +0100
+++ new/datovka-3.1/ui/tmp.ui   1970-01-01 01:00:00.000000000 +0100
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <requires lib="gtk+" version="2.20"/>
-  <!-- interface-naming-policy project-wide -->
-  <object class="GtkWindow" id="window1">
-    <child>
-      <object class="GtkVBox" id="vbox1">
-        <property name="visible">True</property>
-        <child>
-          <object class="GtkHBox" id="hbox1">
-            <property name="visible">True</property>
-            <child>
-              <object class="GtkLabel" id="aa">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Search:</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="padding">5</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="entry1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="invisible_char">●</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkViewport" id="viewport1">
-            <property name="visible">True</property>
-            <property name="resize_mode">queue</property>
-            <child>
-              <object class="GtkHBox" id="hbox2">
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="message_search_label">
-                    <property name="visible">True</property>
-                    <property name="label" 
translatable="yes">Search:</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="padding">5</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="entry2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">●</property>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="hscrollbar_policy">automatic</property>
-            <property name="vscrollbar_policy">automatic</property>
-            <child>
-              <object class="GtkViewport" id="viewport2">
-                <property name="visible">True</property>
-                <property name="resize_mode">queue</property>
-                <child>
-                  <object class="GtkVBox" id="vbox2">
-                    <property name="visible">True</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="position">2</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
-</interface>

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to