openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2016
- 1 participants
- 1450 discussions
Hello community,
here is the log from the commit of package curl for openSUSE:13.2:Update checked in at 2016-09-02 15:01:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:13.2:Update/curl (Old)
and /work/SRC/openSUSE:13.2:Update/.curl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "curl"
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.rHdcaH/_old 2016-09-02 15:01:52.000000000 +0200
+++ /var/tmp/diff_new_pack.rHdcaH/_new 2016-09-02 15:01:52.000000000 +0200
@@ -1 +1 @@
-<link package='curl.5066' cicount='copy' />
+<link package='curl.5542' cicount='copy' />
1
0
Hello community,
here is the log from the commit of package gnome-shell-extensions for openSUSE:Factory checked in at 2016-09-01 14:03:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gnome-shell-extensions (Old)
and /work/SRC/openSUSE:Factory/.gnome-shell-extensions.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-shell-extensions"
Changes:
--------
--- /work/SRC/openSUSE:Factory/gnome-shell-extensions/gnome-shell-extensions.changes 2016-05-16 12:04:05.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gnome-shell-extensions.new/gnome-shell-extensions.changes 2016-09-01 14:03:55.000000000 +0200
@@ -1,0 +2,6 @@
+Mon May 23 16:18:24 CST 2016 - cxiong(a)suse.com
+
+- Update to GNOME 3.20.2 fate#318572
+ + gse-sle-classic-ext.patch updated.
+
+-------------------------------------------------------------------
@@ -8,0 +15,44 @@
+Mon May 9 15:51:02 CST 2016 - cxiong(a)suse.com
+
+- SLE Classic (REBASING DONE)
+ + DROPPED places-menu-use-nautilus-for-links.patch (Invalid)
+ + Add workspace-indicator to the build
+ + Fix the gap between bottom menu and its button.
+ + Fix windows auto-grouping.
+ + Hide window list in Overview
+ + Clean up spec file.
+
+-------------------------------------------------------------------
+Wed May 4 20:51:08 CST 2016 - cxiong(a)suse.com
+
+- Rebasing SLE Classic (basic) (Fate#318572)
+- Add source sle-classic.desktop: xsession file
+- Add patch gse-sle-classic-ext.patch: add sle classic support
+- DROPPED: Invalid
+ + gnome-classic-exts-arrow-fix.patch
+ + gnome-sle-classic-ext-build.patch
+ + sle-classic.tar.bz2
+
+-------------------------------------------------------------------
+Tue Apr 19 19:07:38 CST 2016 - cxiong(a)suse.com
+
+- Patches(none-SLE-classic) reviewing for SP2 GNOME 3.20
+- REBASED:
+ + gnome-shell-add-app-to-desktop.patch
+- DROPPED: Upstreamed
+ + gnome-shell-use-env-var-for-mode.patch
+ + place-menu-handle-special-user-dirs-update.patch
+ + 0001-window-list-import-gettext-for-the-right-domain.patch
+ + gnome-shell-extensions-bnc872820-wm-button-layout.patch
+ + bnc947381-Application-menu-selections-stop-working.patch
+- DROPPED: Invalid
+ + gnome-classic-move-notification-widget-above.patch
+
+-------------------------------------------------------------------
+Fri Apr 15 21:51:23 CEST 2016 - hpj(a)suse.com
+
+- Update to GNOME 3.20 -- Fate#318572.
+- Temporarily disable SLE patches and theming. It will be
+ re-enabled in a later update.
+
+-------------------------------------------------------------------
@@ -66,0 +117,7 @@
+Mon Nov 16 07:45:02 UTC 2015 - cxiong(a)suse.com
+
+- Add bnc947381-Application-menu-selections-stop-working.patch:
+ Fix application menu open issue. Upstream has this fixed but no
+ related bug report (bnc947381).
+
+-------------------------------------------------------------------
@@ -72,0 +130,9 @@
+Tue Nov 3 10:02:47 UTC 2015 - cxiong(a)suse.com
+
+- Fix skewed icons in SLE Classic (bnc#948793)
+ + There was a mismatch between the available space and declared
+ icon size.
+ + SPECFILE: a minor fix to avoid double unpacking the first
+ source tarball.
+
+-------------------------------------------------------------------
@@ -108,0 +175,10 @@
+Thu Aug 6 08:48:00 UTC 2015 - cxiong(a)suse.com
+
+- Fix multiple issues related to windows grouping (bnc#933183) in
+ SLE Classic
+ + The old code contains multiple bugs for windows grouping
+ display.
+ + Fix missing AppButton for applications without desktop file
+ in SLE Classic.
+
+-------------------------------------------------------------------
@@ -142,0 +219,9 @@
+Wed Apr 22 12:37:23 UTC 2015 - cxiong(a)suse.com
+
+- Fix click event "missing" for window buttons in SLE Classic (bnc#913204)
+ + No separate patch file, changes are in sle-classic.tar.bz2
+ + "clicked" event in St.Button is not compatible with Clutter's event model.
+ Though an upstream bug, but the exact cause is still unknown yet. Resort back
+ to Clutter's native "button-press-event" to fix this for SLE Classic.
+
+-------------------------------------------------------------------
@@ -250,0 +336,8 @@
+Wed Nov 26 10:14:29 UTC 2014 - cxiong(a)suse.com
+
+- Fix gnome-shell-add-app-to-desktop.patch
+ + (bnc#899923). A dangled open menu would grab the focus and
+ leave the system in a useless state. Close any open menus
+ before any other action.
+
+-------------------------------------------------------------------
@@ -265,0 +359,7 @@
+Thu Sep 25 21:04:27 CDT 2014 - federico(a)suse.com
+
+- Added gnome-shell-extensions-bnc872820-wm-button-layout.patch for
+ bnc872820. This lets us have the correct defaults for the window
+ manager's button layout, for the classic session mode.
+
+-------------------------------------------------------------------
@@ -271,0 +372,9 @@
+Thu Sep 18 09:26:30 UTC 2014 - cxiong(a)suse.com
+
+- Fine-tune window button style, particularly the hovering effect.
+ + (bnc#862615) Thanks Marcus Moeller (m.moeller(a)opensuse.org)
+ for offering highlighting patch.
+ + Highlight buttons when hovering (lighter color and darker text)
+ + Add extra box shadow to make buttons more visible.
+
+-------------------------------------------------------------------
@@ -279,0 +389,12 @@
+Wed Sep 10 08:03:22 UTC 2014 - cxiong(a)suse.com
+
+- Add places-menu-use-nautilus-for-links.patch
+ + (bnc#891919) Use Nautilus for all links in places menu and
+ such avoids all unnecessary issues.
+
+-------------------------------------------------------------------
+Tue Sep 9 10:56:20 UTC 2014 - cxiong(a)suse.com
+
+- Force a monitors update to avoid background failure (bnc#893979)
+
+-------------------------------------------------------------------
@@ -287,0 +409,33 @@
+Thu Sep 4 10:53:13 UTC 2014 - cxiong(a)suse.com
+
+- Add gnome-classic-move-notification-widget-above.patch
+ + (bnc#877898) move notifications above the panel such that it
+ doesn't cover part of the main panel.
+- SLE Classic multiple fixes
+ + Add callbacks for overview, fullscreen, monitor change event,
+ such that the positioning&visibility of on-screen keyboard,
+ message tray&widgets and panels are adapted accordingly
+ (bnc#891560).
+ + Offer a hack for restoring of xsettings.overrides. The
+ counterpart is installed in Main._sessionLoaded (bnc#894048).
+ + Hide the bottom panel so that the overview hiding animation
+ works smoothly now. At least before we figure out why it
+ doesn't work with the bottom panel. (improvement)
+ + Adjust the positioning of LookingGlass. (improvement)
+ + Other small changes.
+
+-------------------------------------------------------------------
+Wed Aug 27 10:03:32 UTC 2014 - fcrozat(a)suse.com
+
+- Add 0001-window-list-import-gettext-for-the-right-domain.patch:
+ properly define gettext domain for window-list extension
+ (bnc#893598).
+
+-------------------------------------------------------------------
+Fri Aug 22 07:19:11 UTC 2014 - cxiong(a)suse.com
+
+- Add place-menu-handle-special-user-dirs-update.patch:
+ Let place menu handles changes of special user directories
+ properly (bnc#885490).
+
+-------------------------------------------------------------------
@@ -293,0 +448,7 @@
+Tue Aug 12 09:09:33 UTC 2014 - cxiong(a)suse.com
+
+- Add sle-classic-favorites-menu-at-end.patch:
+ put the favorites at the end of the app catogories for
+ accessibility reason (bnc#890989).
+
+-------------------------------------------------------------------
@@ -300,0 +462,6 @@
+Mon Jul 21 01:55:06 UTC 2014 - dliang(a)suse.com
+
+- Update gnome-shell-add-app-to-desktop.patch to use system libs.
+ (bnc#882421)
+
+-------------------------------------------------------------------
@@ -314,0 +482,25 @@
+Fri Jul 11 05:30:17 UTC 2014 - cxiong(a)suse.com
+
+- Remove Avatar symbol from system indicators (bnc#886569)
+ + No separate patch file, changes are in sle-classic.tar.bz2
+ + It's not considered a good indication for log out
+
+-------------------------------------------------------------------
+Wed Jul 2 09:46:01 UTC 2014 - fcrozat(a)suse.com
+
+- Fix typo in gnome-shell-add-app-to-desktop.patch.
+
+-------------------------------------------------------------------
+Wed Jul 2 05:47:52 UTC 2014 - cxiong(a)suse.com
+
+- Add Logout symbol into system indicators, using 'sle-avatar' in SLE theme.
+ (bnc#862615)
+ + No separate patch file, changes are in sle-classic.tar.bz2
++++ 85 more lines (skipped)
++++ between /work/SRC/openSUSE:Factory/gnome-shell-extensions/gnome-shell-extensions.changes
++++ and /work/SRC/openSUSE:Factory/.gnome-shell-extensions.new/gnome-shell-extensions.changes
New:
----
gnome-shell-add-app-to-desktop.patch
gse-sle-classic-ext.patch
sle-classic-favorites-menu-at-end.patch
sle-classic.desktop
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gnome-shell-extensions.spec ++++++
--- /var/tmp/diff_new_pack.KaipEu/_old 2016-09-01 14:03:56.000000000 +0200
+++ /var/tmp/diff_new_pack.KaipEu/_new 2016-09-01 14:03:56.000000000 +0200
@@ -26,13 +26,23 @@
Url: http://live.gnome.org/GnomeShell/Extensions
Source: http://download.gnome.org/sources/gnome-shell-extensions/3.20/%{name}-%{ver…
Source1: README.SUSE
+Source2: sle-classic.desktop
+# PATCH-FEATURE-SLE gnome-shell-add-app-to-desktop.patch bnc#870580 dliang(a)suse.com -- allow adding app shortcut to desktop easily.
+Patch1: gnome-shell-add-app-to-desktop.patch
+# PATCH-FEATURE-SLE sle-classic-favorites-menu-at-end.patch bnc#890989 cxiong(a)suse.com -- put the favorites at the end of the app catogories for accessibility reason -- cxiong(a)suse.com bnc#890989
+Patch2: sle-classic-favorites-menu-at-end.patch
+## NOTE keep SLE Classic patch at the bottom
+# PATCH-FIX-SLE gse-sle-classic-ext.patch Fate#318572 cxiong(a)suse.com -- add sle classic support
+Patch1000: gse-sle-classic-ext.patch
# Needed because we build a tarball generated with "git archive"
BuildRequires: gnome-common
# Needed for directory ownership
BuildRequires: gnome-shell
# gobject-introspection is needed for the typelib() rpm magic.
+BuildRequires: gnome-patch-translation
BuildRequires: gobject-introspection
BuildRequires: intltool
+BuildRequires: translation-update-upstream
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@@ -80,12 +90,26 @@
%lang_package -n %{name}-common
%prep
%setup -q
+%if !0%{?is_opensuse}
+translation-update-upstream
+gnome-patch-translation-prepare
+%patch1 -p1
+%patch2 -p1
+%patch1000 -p1
+%endif
+##gnome-patch-translation-update
# In openSUSE GNOME, we don't launch gnome-session directly, but wrap this through a shell script, /usr/bin/gnome
sed -i "s:Exec=gnome-session:Exec=gnome:g" data/gnome-classic.desktop.in
cp %{S:1} .
+%if !0%{?is_opensuse}
+sed -i -e 's/openSUSE/SUSE Linux Enterprise/g' README.SUSE
+%endif
%build
-CLASSIC_EXTENSIONS=$(grep -e 'CLASSIC_EXTENSIONS=".*"' configure.ac | sed -e "s:CLASSIC_EXTENSIONS=::" -e 's:"::g')
+CLASSIC_EXTENSIONS=$(awk -F\" '/^CLASSIC_EXTENSIONS=/{ print $2 }' configure.ac)
+%if !0%{?is_opensuse}
+CLASSIC_EXTENSIONS="${CLASSIC_EXTENSIONS} workspace-indicator"
+%endif
%configure \
--enable-classic-mode \
--enable-extensions="$CLASSIC_EXTENSIONS"
@@ -94,6 +118,9 @@
%install
%make_install
%find_lang %{name} %{?no_lang_C}
+%if !0%{?is_opensuse}
+install -m0644 %{S:2} %{buildroot}/%{_datadir}/xsessions/sle-classic.desktop
+%endif
%post -n gnome-shell-classic
%glib2_gsettings_schema_post
@@ -115,6 +142,9 @@
%{_datadir}/gnome-shell/extensions/apps-menu(a)gnome-shell-extensions.gcampax.github.com/
%{_datadir}/gnome-shell/extensions/launch-new-instance(a)gnome-shell-extensions.gcampax.github.com/
%{_datadir}/gnome-shell/extensions/places-menu(a)gnome-shell-extensions.gcampax.github.com/
+%if !0%{?is_opensuse}
+%{_datadir}/gnome-shell/extensions/workspace-indicator(a)gnome-shell-extensions.gcampax.github.com/
+%endif
%{_datadir}/gnome-shell/extensions/window-list(a)gnome-shell-extensions.gcampax.github.com/
%dir %{_datadir}/gnome-shell/modes
%{_datadir}/gnome-shell/modes/classic.json
@@ -128,6 +158,9 @@
%{_datadir}/gnome-shell/theme/gnome-classic.css
%{_datadir}/gnome-shell/theme/gnome-classic-high-contrast.css
%{_datadir}/xsessions/gnome-classic.desktop
+%if !0%{?is_opensuse}
+%{_datadir}/xsessions/sle-classic.desktop
+%endif
%files common-lang -f %{name}.lang
++++++ gnome-shell-add-app-to-desktop.patch ++++++
Index: gnome-shell-extensions-3.20.0/extensions/apps-menu/extension.js
===================================================================
--- gnome-shell-extensions-3.20.0.orig/extensions/apps-menu/extension.js
+++ gnome-shell-extensions-3.20.0/extensions/apps-menu/extension.js
@@ -6,10 +6,13 @@ const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Clutter = imports.gi.Clutter;
+const BoxPointer = imports.ui.boxpointer;
+const AppFavorites = imports.ui.appFavorites;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Gtk = imports.gi.Gtk;
+const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Signals = imports.signals;
const Pango = imports.gi.Pango;
@@ -65,13 +68,118 @@ const ApplicationMenuItem = new Lang.Cla
let textureCache = St.TextureCache.get_default();
let iconThemeChangedId = textureCache.connect('icon-theme-changed',
Lang.bind(this, this._updateIcon));
+
+ this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
+ this.actor.connect('popup-menu', Lang.bind(this, this._onKeyboardPopupMenu));
+ this._menu = null;
+ this._menuManager = new PopupMenu.PopupMenuManager(this);
+
this.actor.connect('destroy', Lang.bind(this,
function() {
textureCache.disconnect(iconThemeChangedId);
+ if (this._menu) {
+ this._menu.destroy();
+ this._menu = null;
+ this._menuManager = null;
+ }
}));
this._updateIcon();
},
+ _onKeyboardPopupMenu: function() {
+ this.popupMenu();
+ this._menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+ },
+
+ _onButtonPress: function(actor, event) {
+ // close any opened menu to avoid input focus grab
+ if (this._menu && this._menu.isOpen) {
+ this._menu.close();
+ return;
+ }
+
+ let button = event.get_button();
+ if (button == 3) {
+ this.popupMenu();
+ return true;
+ }
+ return false;
+ },
+
+ popupMenu: function() {
+ if (!this._menu) {
+ this._menu = new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.TOP, 0);
+ let openItem = new PopupMenu.PopupMenuItem(_("Open"));
+ this._menu.addMenuItem(openItem);
+ openItem.connect('activate', Lang.bind(this, function() {
+ this._app.open_new_window(-1);
+ this._button.selectCategory(null, null);
+ this._button.menu.toggle();
+ }));
+
+ let sepItem = new PopupMenu.PopupSeparatorMenuItem();
+ this._menu.addMenuItem(sepItem);
+
+ let isFavorite = AppFavorites.getAppFavorites().isFavorite(this._app.get_id());
+ let favText = null;
+ if (isFavorite)
+ favText = _("Remove from Favorites");
+ else
+ favText = _("Add to Favorites");
+
+ let favItem = new PopupMenu.PopupMenuItem(favText);
+ this._menu.addMenuItem(favItem);
+ favItem.connect('activate', Lang.bind(this, function() {
+ let favs = AppFavorites.getAppFavorites();
+ let isFavorite = favs.isFavorite(this._app.get_id());
+ if (isFavorite)
+ favs.removeFavorite(this._app.get_id());
+ else
+ favs.addFavorite(this._app.get_id());
+
+ /*As the item text changes, we need to re-generate the menu */
+ this._menu.destroy();
+ this._menu = null;
+
+ this._button.selectCategory(null, null);
+ this._button.menu.toggle();
+ }));
+
+ let desktopItem = new PopupMenu.PopupMenuItem(_("Add to Desktop"));
+ this._menu.addMenuItem(desktopItem);
+ desktopItem.connect('activate', Lang.bind(this, function() {
+ let desktopApp = this._app.get_app_info();
+ let sourcePath = desktopApp.get_filename();
+ let sourceFile = Gio.File.new_for_path(sourcePath);
+ let destDirPath = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP);
+ let destDir = Gio.File.new_for_path(destDirPath);
+
+ if (!destDir.query_exists(null)) {
+ destDirPath = Glib.build_filenamev([GLib.get_home_dir(), "Desktop"]);
+ }
+ let destFile = Gio.File.new_for_path(destDirPath + '/' + sourceFile.get_basename());
+ if (sourceFile.copy(destFile, Gio.FileCopyFlags.OVERWRITE,
+ null, null, null)) {
+ destFile.set_attribute_uint32(
+ Gio.FILE_ATTRIBUTE_UNIX_MODE, 0755,
+ Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,
+ null);
+ }
+ this._button.selectCategory(null, null);
+ this._button.menu.toggle();
+ }));
+
+ Main.uiGroup.add_actor(this._menu.actor);
+
+ this._menuManager.addMenu(this._menu);
+ }
+
+ this._menu.open(BoxPointer.PopupAnimation.NONE);
+ this._menuManager.ignoreRelease();
+
+ return false;
+ },
+
activate: function(event) {
this._app.open_new_window(-1);
this._button.selectCategory(null, null);
++++++ gse-sle-classic-ext.patch ++++++
++++ 833 lines (skipped)
++++++ sle-classic-favorites-menu-at-end.patch ++++++
Index: gnome-shell-extensions-3.20.1/extensions/apps-menu/extension.js
===================================================================
--- gnome-shell-extensions-3.20.1.orig/extensions/apps-menu/extension.js
+++ gnome-shell-extensions-3.20.1/extensions/apps-menu/extension.js
@@ -20,6 +20,8 @@ const Pango = imports.gi.Pango;
const Gettext = imports.gettext.domain('gnome-shell-extensions');
const _ = Gettext.gettext;
+const SLEClassicExt = imports.ui.SLEClassicExt;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
@@ -609,8 +611,6 @@ const ApplicationsButton = new Lang.Clas
let tree = new GMenu.Tree({ menu_basename: 'applications.menu' });
tree.load_sync();
let root = tree.get_root_directory();
- let categoryMenuItem = new CategoryMenuItem(this, null);
- this.categoriesBox.add_actor(categoryMenuItem.actor);
let iter = root.iter();
let nextType;
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
@@ -628,6 +628,10 @@ const ApplicationsButton = new Lang.Clas
}
}
+ let categoryMenuItem = new CategoryMenuItem(this, null);
+ this.categoriesBox.insert_child_at_index(categoryMenuItem.actor,
+ SLEClassicExt.isSLEClassicMode() ? -1 : 0);
+
//Load applications
this._displayButtons(this._listApplications(null));
++++++ sle-classic.desktop ++++++
[Desktop Entry]
Name=SLE Classic
Name[af]=SLE Klassiek
Name[an]=SLE clasico
Name[ar]=جنوم تقليدية
Name[as]=SLE ক্লাচিক
Name[bg]=Класически SLE
Name[bn_IN]=SLE ক্লাসিক
Name[bs]=Klasični SLE
Name[ca]=SLE clàssic
Name[ca@valencia]=SLE clàssic
Name[cs]=SLE klasik
Name[da]=SLE Classic
Name[de]=SLE Classic
Name[el]=SLE Classic
Name[en_GB]=SLE Classic
Name[eo]=SLE-klasika
Name[es]=SLE clásico
Name[et]=Klassikaline SLE
Name[eu]=SLE Klasikoa
Name[fa]=گنوم کلاسیک
Name[fi]=Perinteinen Gnome
Name[fr]=SLE Classique
Name[fur]=SLE Classic
Name[gd]=SLE clasaigeach
Name[gl]=SLE clasico
Name[gu]=SLE ક્લાસિક
Name[he]=SLE קלסי
Name[hi]=SLE क्लासिक
Name[hu]=Klasszikus SLE
Name[id]=SLE Klasik
Name[is]=SLE Klassík
Name[it]=SLE classico
Name[ja]=SLE クラシック
Name[kk]=Классикалық SLE
Name[km]=SLE Classic
Name[kn]=SLE ಕ್ಲಾಸಿಕ್
Name[ko]=그놈 클래식
Name[lt]=Klasikinis SLE
Name[lv]=Klasiskais SLE
Name[ml]=ഗ്നോം ക്ലാസ്സിക്
Name[mr]=SLE क्लासिक
Name[ms]=SLE Klasik
Name[nb]=Klassisk SLE
Name[ne]=जिनोम क्लासिक
Name[nl]=Gnome klassiek
Name[oc]=SLE Classic
Name[or]=SLE କ୍ଲାସିକ
Name[pa]=ਗਨੋਮ ਕਲਾਸਿਕ
Name[pl]=Klasyczne SLE
Name[pt]=SLE clássico
Name[pt_BR]=SLE Clássico
Name[ro]=SLE Clasic
Name[ru]=Классический SLE
Name[sk]=Klasické prostredie SLE
Name[sl]=Običajno namizje SLE
Name[sr]=Класичан Гном
Name[sr@latin]=Klasičan Gnom
Name[sv]=SLE Klassisk
Name[ta]=SLE கிளாஸிக்
Name[te]=గ్నోమ్ క్లాసిక్
Name[tg]=SLE-и классикӣ
Name[th]=SLE คลาสสิก
Name[tr]=SLE Klasik
Name[uk]=Класичний SLE
Name[vi]=SLE cổ điển
Name[zh_CN]=SLE 经典模式
Name[zh_HK]=SLE Classic
Name[zh_TW]=SLE Classic
Comment=This session logs you into SLE Classic
Comment[af]=Hierdie sessie laat mens aanmeld by SLE Klassiek
Comment[an]=Ista sesión encieta lo SLE clasico
Comment[ar]=تولجك هذه الجلسة في جنوم التقليدية
Comment[as]=এই অধিবেশনে আপোনাক SLE ক্লাচিকলৈ লগ কৰে
Comment[bg]=Работната среда изглежда като класическия SLE (2.x)
Comment[bn_IN]=এই সেশন অাপনাকে SLE ক্লাসিকে লগ করায়
Comment[bs]=Ova sesija vas prijavljuje na klasični SLE
Comment[ca]=Aquesta sessió us permet utilitzar el SLE clàssic
Comment[ca@valencia]=Esta sessió vos permet utilitzar el SLE clàssic
Comment[cs]=Toto sezení vás přihlásí do SLE klasik
Comment[da]=Denne session logger dig ind i SLE Classic
Comment[de]=Diese Sitzung meldet Sie in SLE Classic an
Comment[el]=Αυτή η συνεδρία σας συνδέει στο SLE Classic
Comment[en_GB]=This session logs you into SLE Classic
Comment[eo]=Ĉi seanco ensalutas vin SLE-klasiken
Comment[es]=Esta sesión inicia SLE clásico
Comment[et]=See on klassikalise SLE seanss
Comment[eu]=Saio honek SLE Klasikoa hasten du
Comment[fa]=این نشست شما را به گنوم کلاسیک وارد میکند
Comment[fi]=Tämä istunto kirjaa sinut perinteiseen Gnomeen
Comment[fr]=Cette session vous connnecte à SLE Classique
Comment[fur]=Cheste session a si invie cun SLE classic
Comment[gd]=Clàraidh an seisean seo a-steach gu SLE clasaigeach thu
Comment[gl]=Esta sesión iniciarao en SLE clásico
Comment[gu]=આ સત્ર તમને SLE ક્લાસિકમાં પ્રવેશ આપે છે
Comment[he]=הפעלה זו מכניסה אותך למצב הקלסי של SLE
Comment[hi]=यह सत्र गनोम क्लासिक में आपको लॉगइन करेगा
Comment[hu]=Bejelentkezés a klasszikus SLE környezetbe
Comment[id]=Sesi ini memasukkan Anda ke SLE Klasik
Comment[is]=Þessi seta skráir þig inn í klassískt SLE
Comment[it]=Questa sessione si avvia con SLE classico
Comment[ja]=SLE クラシックモードでログインします
Comment[kk]=Бұл сессия арқылы классикалық SLE ішіне кіресіз
Comment[km]=សម័យនេះនឹងឲ្យអ្នកចូល SLE Classic
Comment[kn]=ಈ ಅಧಿವೇಶನವು ನಿಮ್ಮನ್ನು SLE ಕ್ಲಾಸಿಕ್ಗೆ ಪ್ರವೇಶಿಸುವಂತೆ ಮಾಡುತ್ತದೆ
Comment[ko]=이 세션을 사용하면 그놈 클래식에 로그인합니다
Comment[lt]=Šis seansas prijungs jus prie klasikinio SLE
Comment[lv]=Šī sesija ieraksta jūs klasiskajā SLE vidē
Comment[ml]=ഈ പ്രവര്ത്തനവേള നിങ്ങളെ ഗ്നോം ക്ലാസ്സിക്കിലേക്കു് കയറ്റുന്നു
Comment[mr]=हे सत्र तुम्हाला SLE क्लासिक सत्रामध्ये प्रवेश करून देतो
Comment[ms]=Sesi ini log masukkan anda ke SLE Klasik
Comment[nb]=Denne økten logger inn i klassisk SLE
Comment[ne]=यो सेसन जिनोम क्लासिकमा लगईन हुन्छ
Comment[nl]=Deze sessie meldt u aan bij Gnome klassiek
Comment[oc]=Aquesta session vos connècta a SLE Classic
Comment[or]=ଏହି ଅଧିବେଶନ ଆପଣଙ୍କୁ SLE କ୍ଲାସିକରେ ଲଗ କରାଇଥାଏ
Comment[pa]=ਇਹ ਸ਼ੈਸ਼ਨ ਤੁਹਾਨੂੰ ਗਨੋਮ ਕਲਾਸਿਕ ਵਿੱਚ ਲਾਗ ਕਰਦਾ ਹੈ
Comment[pl]=Ta sesja loguje do klasycznego środowiska SLE
Comment[pt]=Esta sessão liga-o ao SLE clássico
Comment[pt_BR]=Essa sessão se inicia como SLE Clássico
Comment[ro]=Această sesiune vă autentifică în SLE Clasic
Comment[ru]=Данный сеанс использует классический рабочий стол SLE
Comment[sk]=Táto relácia vás prihlási do klasického prostredia SLE
Comment[sl]=Seja omogoča prijavo v običajno namizje SLE.
Comment[sr]=Ова сесија вас пријављује у класичан Гном
Comment[sr@latin]=Ova sesija vas prijavljuje u klasičan Gnom
Comment[sv]=Denna session loggar in dig till SLE Klassisk
Comment[ta]=இந்த அமர்வு உங்களை SLE கிளாஸிக்கில் புகுபதிவு செய்யும்
Comment[te]=ఈ సెషన్ గ్నోమ్ క్లాసిక్ లోనికి లాగ్ చేస్తుంది
Comment[tg]=Ин ҷаласа шуморо ба SLE-и классикӣ ворид мекунад
Comment[th]=วาระนี้จะนำคุณเข้าสู่ระบบ SLE คลาสสิก
Comment[tr]=Bu oturum, SLE Klasik sürümüne giriş yapmanızı sağlar.
Comment[uk]=Це — сеанс входу в класичний SLE
Comment[vi]=Phiên làm việc này đăng nhập bạn vào SLE Cổ điển
Comment[zh_CN]=该会话将登录到“SLE 经典模式”
Comment[zh_HK]=這個作業階段讓你登入 SLE Classic
Comment[zh_TW]=這個作業階段讓您登入 SLE Classic
Exec=env GNOME_SHELL_SESSION_MODE=classic SLE_CLASSIC_MODE=1 gnome-session --session gnome-classic
TryExec=gnome-session
Icon=
Type=Application
DesktopNames=GNOME-Classic;GNOME
1
0
Hello community,
here is the log from the commit of package gnome-calendar for openSUSE:Factory checked in at 2016-09-01 14:03:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gnome-calendar (Old)
and /work/SRC/openSUSE:Factory/.gnome-calendar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-calendar"
Changes:
--------
--- /work/SRC/openSUSE:Factory/gnome-calendar/gnome-calendar.changes 2016-05-12 09:33:42.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gnome-calendar.new/gnome-calendar.changes 2016-09-01 14:03:52.000000000 +0200
@@ -1,0 +2,8 @@
+Wed Aug 31 21:08:25 UTC 2016 - zaitor(a)opensuse.org
+
+- Update to version 3.20.3:
+ + Fix crashes.
+ + Fix AM/PM selector not showing.
+ + Updated translations.
+
+-------------------------------------------------------------------
Old:
----
gnome-calendar-3.20.2.tar.xz
New:
----
gnome-calendar-3.20.3.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gnome-calendar.spec ++++++
--- /var/tmp/diff_new_pack.vzp0EY/_old 2016-09-01 14:03:53.000000000 +0200
+++ /var/tmp/diff_new_pack.vzp0EY/_new 2016-09-01 14:03:53.000000000 +0200
@@ -17,7 +17,7 @@
Name: gnome-calendar
-Version: 3.20.2
+Version: 3.20.3
Release: 0
Summary: A calendar application for GNOME
License: GPL-3.0+
++++++ gnome-calendar-3.20.2.tar.xz -> gnome-calendar-3.20.3.tar.xz ++++++
++++ 4192 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package libgepub for openSUSE:Factory checked in at 2016-09-01 14:03:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libgepub (Old)
and /work/SRC/openSUSE:Factory/.libgepub.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgepub"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libgepub/libgepub.changes 2016-08-25 09:56:51.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libgepub.new/libgepub.changes 2016-09-01 14:03:51.000000000 +0200
@@ -1,0 +2,41 @@
+Wed Aug 31 10:13:52 UTC 2016 - dimstar(a)opensuse.org
+
+- Update to version 0.4:
+ + go_next and go_prev returns TRUE if success.
+ + Added functions to get the current doc mime and path.
+ + Fixed resource path for relative and doc paths.
+ + Remove libarchive from the public API.
+ + Simplify pkg-config file.
+ + Don't link the library against GTK+.
+ + Function to replace relative resources by epub://.
+ + utils: replace epub:// URIs for crosslinks too.
+ + utils: correctly terminate base URI.
+ + doc: fix wrong path when looking for resources.
+ + doc: make API to get resources consistent.
+ + Added GepubWidget class to show the content with webkit.
+ + Don't NULL-terminate document content.
+ + utils: remove unused variable.
+ + build: highlight introspection warnings.
+ + build: fix introspection warnings.
+ + Fixes in gepub-widget to work with the last merge.
+ + widget: make it a WebKitWebView.
+ + widget: simplify code.
+ + Fix gtk-doc annotations.
+ + widget: make the GepubDoc a property.
+ + doc: remove unneeded API.
+ + doc: use htmlReadMemory().
+ + widget: plug a memory leak.
+ + Rework API to be based on GBytes.
+ + doc: trivial indentation fix.
+ + Const-ify API methods that take strings.
+ + doc: don't call g_list_append().
+ + doc: rework page API.
+ + widget: automatically reload chapter when current page changes.
+ + Ignore HTML entities parse error when loading xml.
+ + New release 0.4.
+- Add pkgconfig(libsoup-2.4) and pkgconfig(webkit2gtk-4.0)
+ BuildRequires: new dependencies.
+- Rename typelib-1_0-Gepub-0_3 subpackage to typelib-1_0-Gepub-0_4,
+ following upstreams rename of the typelib file.
+
+-------------------------------------------------------------------
Old:
----
libgepub-0.3.tar.xz
New:
----
libgepub-0.4.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libgepub.spec ++++++
--- /var/tmp/diff_new_pack.RCYg3g/_old 2016-09-01 14:03:52.000000000 +0200
+++ /var/tmp/diff_new_pack.RCYg3g/_new 2016-09-01 14:03:52.000000000 +0200
@@ -18,7 +18,7 @@
%global sover 0
Name: libgepub
-Version: 0.3
+Version: 0.4
Release: 0
Summary: Epub Documents library
License: LGPL-2.1+
@@ -33,7 +33,9 @@
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.30.0
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(libarchive)
+BuildRequires: pkgconfig(libsoup-2.4)
BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(webkit2gtk-4.0)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -46,18 +48,18 @@
%description -n %{name}%{sover}
A GObject based library for handling and rendering epub documents.
-%package -n typelib-1_0-Gepub-0_3
+%package -n typelib-1_0-Gepub-0_4
Summary: Epub Documents library -- Introspection bindings
Group: System/Libraries
-%description -n typelib-1_0-Gepub-0_3
+%description -n typelib-1_0-Gepub-0_4
A GObject based library for handling and rendering epub documents.
%package devel
Summary: Epub Documents library -- Development files
Group: Development/Languages/C and C++
Requires: %{name}%{sover} = %{version}
-Requires: typelib-1_0-Gepub-0_3 = %{version}
+Requires: typelib-1_0-Gepub-0_4 = %{version}
%description devel
A GObject based library for handling and rendering epub documents.
@@ -83,15 +85,15 @@
%doc README COPYING
%{_libdir}/%{name}.so.*
-%files -n typelib-1_0-Gepub-0_3
+%files -n typelib-1_0-Gepub-0_4
%defattr(-,root,root)
-%{_libdir}/girepository-1.0/Gepub-0.3.typelib
+%{_libdir}/girepository-1.0/Gepub-0.4.typelib
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
-%{_datadir}/gir-1.0/Gepub-0.3.gir
+%{_datadir}/gir-1.0/Gepub-0.4.gir
%changelog
++++++ _service ++++++
--- /var/tmp/diff_new_pack.RCYg3g/_old 2016-09-01 14:03:52.000000000 +0200
+++ /var/tmp/diff_new_pack.RCYg3g/_new 2016-09-01 14:03:52.000000000 +0200
@@ -4,7 +4,7 @@
<param name="scm">git</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="changesgenerate">enable</param>
- <param name="revision">refs/tags/0.3</param>
+ <param name="revision">refs/tags/0.4</param>
</service>
<service mode="disabled" name="recompress">
<param name="file">*.tar</param>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.RCYg3g/_old 2016-09-01 14:03:52.000000000 +0200
+++ /var/tmp/diff_new_pack.RCYg3g/_new 2016-09-01 14:03:52.000000000 +0200
@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://git.gnome.org/libgepub</param>
- <param name="changesrevision">f1c9898c40762d89e0fa7e9094c00265e183adbb</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">37b240c7877eafaa8ca2df76a779444f0235e5a3</param></service></servicedata>
\ No newline at end of file
++++++ libgepub-0.3.tar.xz -> libgepub-0.4.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/TODO new/libgepub-0.4/TODO
--- old/libgepub-0.3/TODO 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/TODO 2016-08-31 09:39:20.000000000 +0200
@@ -0,0 +1,2 @@
+ - support for multi-page display: get_current_next() or get_current_nth()
+ to the the page nth
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/configure.ac new/libgepub-0.4/configure.ac
--- old/libgepub-0.3/configure.ac 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/configure.ac 2016-08-31 09:39:20.000000000 +0200
@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
-AC_INIT([libgepub],[0.3],[danigm(a)wadobo.com])
+AC_INIT([libgepub],[0.4],[danigm(a)wadobo.com])
AC_CONFIG_AUX_DIR([build])
AM_INIT_AUTOMAKE([1.10 -Wall -Werror dist-bzip2])
AM_SILENT_RULES([yes])
@@ -17,9 +17,10 @@
AC_PROG_LIBTOOL
PKG_CHECK_MODULES(GEPUB,
+ webkit2gtk-4.0
+ libsoup-2.4
glib-2.0
gobject-2.0
- gtk+-3.0
gio-2.0
libxml-2.0
libarchive)
@@ -27,6 +28,19 @@
AC_SUBST(GEPUB_CFLAGS)
AC_SUBST(GEPUB_LIBS)
+PKG_CHECK_MODULES(GEPUB_TESTS,
+ webkit2gtk-4.0
+ libsoup-2.4
+ glib-2.0
+ gobject-2.0
+ gtk+-3.0
+ gio-2.0
+ libxml-2.0
+ libarchive)
+
+AC_SUBST(GEPUB_TESTS_CFLAGS)
+AC_SUBST(GEPUB_TESTS_LIBS)
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/Makefile.am new/libgepub-0.4/libgepub/Makefile.am
--- old/libgepub-0.3/libgepub/Makefile.am 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/Makefile.am 2016-08-31 09:39:20.000000000 +0200
@@ -4,6 +4,7 @@
gepub-utils.h
INST_H_FILES = \
+ gepub-widget.h \
gepub-archive.h \
gepub-text-chunk.h \
gepub-doc.h \
@@ -13,6 +14,7 @@
libgepubinclude_HEADERS = $(INST_H_FILES)
libgepub_la_SOURCES = \
+ gepub-widget.c \
gepub-archive.c \
gepub-text-chunk.c \
gepub-doc.c \
@@ -47,12 +49,13 @@
if HAVE_INTROSPECTION
introspection_sources = $(libgepub_la_SOURCES)
-Gepub-0.3.gir: libgepub.la
-Gepub_0_3_gir_INCLUDES = GObject-2.0 libxml2-2.0
-Gepub_0_3_gir_CFLAGS = $(INCLUDES)
-Gepub_0_3_gir_LIBS = libgepub.la
-Gepub_0_3_gir_FILES = $(introspection_sources)
-INTROSPECTION_GIRS += Gepub-0.3.gir
+Gepub-0.4.gir: libgepub.la
+Gepub_0_4_gir_INCLUDES = GObject-2.0 libxml2-2.0 WebKit2-4.0
+Gepub_0_4_gir_CFLAGS = $(INCLUDES)
+Gepub_0_4_gir_LIBS = libgepub.la
+Gepub_0_4_gir_FILES = $(introspection_sources)
+Gepub_0_4_gir_SCANNERFLAGS = --warn-all
+INTROSPECTION_GIRS += Gepub-0.4.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-archive.c new/libgepub-0.4/libgepub/gepub-archive.c
--- old/libgepub-0.3/libgepub/gepub-archive.c 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-archive.c 2016-08-31 09:39:20.000000000 +0200
@@ -20,6 +20,8 @@
#include <config.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <archive.h>
+#include <archive_entry.h>
#include "gepub-archive.h"
#include "gepub-utils.h"
@@ -103,6 +105,12 @@
return archive;
}
+/**
+ * gepub_archive_list_files:
+ * @archive: a #GepubArchive
+ *
+ * Returns: (element-type utf8) (transfer full): list of files in the archive
+ */
GList *
gepub_archive_list_files (GepubArchive *archive)
{
@@ -120,17 +128,16 @@
return file_list;
}
-gboolean
+GBytes *
gepub_archive_read_entry (GepubArchive *archive,
- const gchar *path,
- guchar **buffer,
- gsize *bufsize)
+ const gchar *path)
{
struct archive_entry *entry;
+ guchar *buffer;
gint size;
if (!gepub_archive_open (archive))
- return FALSE;
+ return NULL;
while (archive_read_next_header (archive->archive, &entry) == ARCHIVE_OK) {
if (g_ascii_strcasecmp (path, archive_entry_pathname (entry)) == 0)
@@ -138,14 +145,12 @@
archive_read_data_skip (archive->archive);
}
- *bufsize = archive_entry_size (entry) + 1;
- size = (*bufsize) - 1;
- *buffer = g_malloc (*bufsize);
- archive_read_data (archive->archive, *buffer, size);
- (*buffer)[size] = '\0';
+ size = archive_entry_size (entry);
+ buffer = g_malloc0 (size);
+ archive_read_data (archive->archive, buffer, size);
gepub_archive_close (archive);
- return TRUE;
+ return g_bytes_new_take (buffer, size);
}
gchar *
@@ -154,21 +159,24 @@
xmlDoc *doc = NULL;
xmlNode *root_element = NULL;
xmlNode *root_node = NULL;
- guchar *buffer;
+ GBytes *bytes;
+ const guchar *buffer;
gsize bufsize;
gchar *root_file = NULL;
// root file is in META-INF/container.xml
- if (!gepub_archive_read_entry (archive, "META-INF/container.xml", &buffer, &bufsize))
+ bytes = gepub_archive_read_entry (archive, "META-INF/container.xml");
+ if (!bytes)
return NULL;
- doc = xmlRecoverDoc (buffer);
+ buffer = g_bytes_get_data (bytes, &bufsize);
+ doc = xmlRecoverMemory (buffer, bufsize);
root_element = xmlDocGetRootElement (doc);
root_node = gepub_utils_get_element_by_tag (root_element, "rootfile");
root_file = xmlGetProp (root_node, "full-path");
xmlFreeDoc (doc);
- g_free (buffer);
+ g_bytes_unref (bytes);
return root_file;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-archive.h new/libgepub-0.4/libgepub/gepub-archive.h
--- old/libgepub-0.3/libgepub/gepub-archive.h 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-archive.h 2016-08-31 09:39:20.000000000 +0200
@@ -23,8 +23,6 @@
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
-#include <archive.h>
-#include <archive_entry.h>
G_BEGIN_DECLS
@@ -42,10 +40,8 @@
GepubArchive *gepub_archive_new (const gchar *path);
GList *gepub_archive_list_files (GepubArchive *archive);
-gboolean gepub_archive_read_entry (GepubArchive *archive,
- const gchar *path,
- guchar **buffer,
- gsize *bufsize);
+GBytes *gepub_archive_read_entry (GepubArchive *archive,
+ const gchar *path);
gchar *gepub_archive_get_root_file (GepubArchive *archive);
G_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-doc.c new/libgepub-0.4/libgepub/gepub-doc.c
--- old/libgepub-0.3/libgepub/gepub-doc.c 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-doc.c 2016-08-31 09:39:20.000000000 +0200
@@ -35,11 +35,13 @@
GObject parent;
GepubArchive *archive;
- guchar *content;
+ GBytes *content;
gchar *content_base;
gchar *path;
GHashTable *resources;
+
GList *spine;
+ GList *page;
};
struct _GepubDocClass {
@@ -49,6 +51,7 @@
enum {
PROP_0,
PROP_PATH,
+ PROP_PAGE,
NUM_PROPS
};
@@ -71,8 +74,7 @@
GepubDoc *doc = GEPUB_DOC (object);
g_clear_object (&doc->archive);
- g_clear_pointer (&doc->content, g_free);
- g_clear_pointer (&doc->content_base, g_free);
+ g_clear_pointer (&doc->content, g_bytes_unref);
g_clear_pointer (&doc->path, g_free);
g_clear_pointer (&doc->resources, g_hash_table_destroy);
@@ -96,6 +98,9 @@
case PROP_PATH:
doc->path = g_value_dup_string (value);
break;
+ case PROP_PAGE:
+ gepub_doc_set_page (doc, g_value_get_int (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -114,6 +119,9 @@
case PROP_PATH:
g_value_set_string (value, doc->path);
break;
+ case PROP_PAGE:
+ g_value_set_int (value, gepub_doc_get_page (doc));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -149,6 +157,13 @@
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
+ properties[PROP_PAGE] =
+ g_param_spec_int ("page",
+ "Current page",
+ "The current page index",
+ -1, G_MAXINT, 0,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, NUM_PROPS, properties);
}
@@ -169,12 +184,19 @@
file = gepub_archive_get_root_file (doc->archive);
if (!file)
return FALSE;
- if (!gepub_archive_read_entry (doc->archive, file, &(doc->content), &bufsize))
+ doc->content = gepub_archive_read_entry (doc->archive, file);
+ if (!doc->content)
return FALSE;
len = strlen (file);
- while (file[i++] != '/' && i < len);
- doc->content_base = g_strndup (file, i);
+ doc->content_base = g_strdup ("");
+ for (i=0; i<len; i++) {
+ if (file[i] == '/') {
+ g_free (doc->content_base);
+ doc->content_base = g_strndup (file, i+1);
+ break;
+ }
+ }
gepub_doc_fill_resources (doc);
gepub_doc_fill_spine (doc);
@@ -193,7 +215,6 @@
/**
* gepub_doc_new:
* @path: the epub doc path
- * @error: location to store a #GError, or %NULL
*
* Returns: (transfer full): the new GepubDoc created
*/
@@ -215,8 +236,11 @@
xmlNode *item = NULL;
gchar *id, *tmpuri, *uri;
GepubResource *res;
+ const char *data;
+ gsize size;
- xdoc = xmlRecoverDoc (doc->content);
+ data = g_bytes_get_data (doc->content, &size);
+ xdoc = xmlRecoverMemory (data, size);
root_element = xmlDocGetRootElement (xdoc);
mnode = gepub_utils_get_element_by_tag (root_element, "manifest");
@@ -250,8 +274,12 @@
xmlNode *snode = NULL;
xmlNode *item = NULL;
gchar *id;
+ const char *data;
+ gsize size;
+ GList *spine = NULL;
- xdoc = xmlRecoverDoc (doc->content);
+ data = g_bytes_get_data (doc->content, &size);
+ xdoc = xmlRecoverMemory (data, size);
root_element = xmlDocGetRootElement (xdoc);
snode = gepub_utils_get_element_by_tag (root_element, "spine");
@@ -264,10 +292,13 @@
id = xmlGetProp (item, "idref");
- doc->spine = g_list_append (doc->spine, id);
+ spine = g_list_prepend (spine, id);
item = item->next;
}
+ doc->spine = g_list_reverse (spine);
+ doc->page = doc->spine;
+
xmlFreeDoc (xdoc);
}
@@ -277,7 +308,7 @@
*
* Returns: (transfer none): the document content
*/
-gchar *
+GBytes *
gepub_doc_get_content (GepubDoc *doc)
{
return doc->content;
@@ -291,7 +322,7 @@
* Returns: (transfer full): metadata string
*/
gchar *
-gepub_doc_get_metadata (GepubDoc *doc, gchar *mdata)
+gepub_doc_get_metadata (GepubDoc *doc, const gchar *mdata)
{
xmlDoc *xdoc = NULL;
xmlNode *root_element = NULL;
@@ -299,8 +330,11 @@
xmlNode *mdata_node = NULL;
gchar *ret;
xmlChar *text;
+ const char *data;
+ gsize size;
- xdoc = xmlRecoverDoc (doc->content);
+ data = g_bytes_get_data (doc->content, &size);
+ xdoc = xmlRecoverMemory (data, size);
root_element = xmlDocGetRootElement (xdoc);
mnode = gepub_utils_get_element_by_tag (root_element, "metadata");
mdata_node = gepub_utils_get_element_by_tag (mnode, mdata);
@@ -327,50 +361,35 @@
}
/**
- * gepub_doc_get_resource:
+ * gepub_doc_get_resource_by_id:
* @doc: a #GepubDoc
* @id: the resource id
- * @bufsize: (out): location to store the length in bytes of the contents
*
- * Returns: (array length=bufsize) (transfer full): the resource content
+ * Returns: (transfer full): the resource content
*/
-guchar *
-gepub_doc_get_resource (GepubDoc *doc, gchar *id, gsize *bufsize)
+GBytes *
+gepub_doc_get_resource_by_id (GepubDoc *doc, const gchar *id)
{
- guchar *res = NULL;
GepubResource *gres = g_hash_table_lookup (doc->resources, id);
if (!gres) {
// not found
return NULL;
}
- if (!gepub_archive_read_entry (doc->archive, gres->uri, &res, bufsize))
- return NULL;
- return res;
+ return gepub_archive_read_entry (doc->archive, gres->uri);
}
/**
- * gepub_doc_get_resource_v:
+ * gepub_doc_get_resource:
* @doc: a #GepubDoc
- * @v: the resource path
- * @bufsize: (out): location to store length in bytes of the contents
+ * @path: the resource path
*
- * Returns: (array length=bufsize) (transfer full): the resource content
+ * Returns: (transfer full): the resource content
*/
-guchar *
-gepub_doc_get_resource_v (GepubDoc *doc, gchar *v, gsize *bufsize)
+GBytes *
+gepub_doc_get_resource (GepubDoc *doc, const gchar *path)
{
- guchar *res = NULL;
- gchar *path = NULL;
-
- path = g_strdup_printf ("%s%s", doc->content_base, v);
- if (!gepub_archive_read_entry (doc->archive, path, &res, bufsize)) {
- g_free (path);
- return NULL;
- }
- g_free (path);
-
- return res;
+ return gepub_archive_read_entry (doc->archive, path);
}
/**
@@ -381,7 +400,7 @@
* Returns: (transfer full): the resource content
*/
gchar *
-gepub_doc_get_resource_mime_by_id (GepubDoc *doc, gchar *id)
+gepub_doc_get_resource_mime_by_id (GepubDoc *doc, const gchar *id)
{
GepubResource *gres;
@@ -399,19 +418,16 @@
/**
* gepub_doc_get_resource_mime:
* @doc: a #GepubDoc
- * @v: the resource path
+ * @path: the resource path
*
* Returns: (transfer full): the resource mime
*/
gchar *
-gepub_doc_get_resource_mime (GepubDoc *doc, gchar *v)
+gepub_doc_get_resource_mime (GepubDoc *doc, const gchar *path)
{
- gchar *path = NULL;
GepubResource *gres;
GList *keys = g_hash_table_get_keys (doc->resources);
- path = g_strdup_printf ("%s%s", doc->content_base, v);
-
while (keys) {
gres = ((GepubResource*)g_hash_table_lookup (doc->resources, keys->data));
if (!strcmp (gres->uri, path))
@@ -419,8 +435,6 @@
keys = keys->next;
}
- g_free(path);
-
if (keys)
return g_strdup (gres->mime);
else
@@ -428,55 +442,80 @@
}
/**
- * gepub_doc_get_spine:
+ * gepub_doc_get_current_mime:
* @doc: a #GepubDoc
*
- * Returns: (element-type utf8) (transfer none): the document spine
+ * Returns: (transfer full): the current resource mime
*/
-GList *
-gepub_doc_get_spine (GepubDoc *doc)
+gchar *
+gepub_doc_get_current_mime (GepubDoc *doc)
{
- return doc->spine;
+ return gepub_doc_get_resource_mime_by_id (doc, doc->page->data);
}
/**
* gepub_doc_get_current:
* @doc: a #GepubDoc
- * @bufsize: (out): location to store the length in bytes of the contents
*
- * Returns: (array length=bufsize) (transfer full): the current chapter data
+ * Returns: (transfer full): the current chapter data
*/
-guchar *
-gepub_doc_get_current (GepubDoc *doc, gsize *bufsize)
+GBytes *
+gepub_doc_get_current (GepubDoc *doc)
{
- return gepub_doc_get_resource (doc, doc->spine->data, bufsize);
+ return gepub_doc_get_resource_by_id (doc, doc->page->data);
+}
+
+/**
+ * gepub_doc_get_current_with_epub_uris:
+ * @doc: a #GepubDoc
+ *
+ * Returns: (transfer full): the current chapter
+ * data, with resource uris renamed so they have the epub:// prefix and all
+ * are relative to the root file
+ */
+GBytes *
+gepub_doc_get_current_with_epub_uris (GepubDoc *doc)
+{
+ GBytes *content = gepub_doc_get_current (doc);
+ gchar *path = gepub_doc_get_current_path (doc);
+ // getting the basepath of the current xhtml loaded
+ gchar *base = g_path_get_dirname (path);
+
+ GBytes *replaced = gepub_utils_replace_resources (content, base);
+
+ g_free (path);
+ g_bytes_unref (content);
+
+ return replaced;
}
/**
* gepub_doc_get_text:
* @doc: a #GepubDoc
*
- * Returns: (element-type Gepub.TextChunk) (transfer full): the list of text in the current chapter, Free with gepub_doc_free_text().
+ * Returns: (element-type Gepub.TextChunk) (transfer full): the list of text in the current chapter.
*/
GList *
gepub_doc_get_text (GepubDoc *doc)
{
xmlDoc *xdoc = NULL;
xmlNode *root_element = NULL;
- guchar *res = NULL;
- gsize size = 0;
+ GBytes *current;
+ const guchar *data;
+ gsize size;
GList *texts = NULL;
- res = gepub_doc_get_current (doc, &size);
- if (!res) {
+ current = gepub_doc_get_current (doc);
+ if (!current) {
return NULL;
}
- xdoc = htmlReadDoc (res, "", NULL, HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR);
+ data = g_bytes_get_data (current, &size);
+ xdoc = htmlReadMemory (data, size, "", NULL, HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR);
root_element = xmlDocGetRootElement (xdoc);
texts = gepub_utils_get_text_elements (root_element);
- g_free (res);
+ g_bytes_unref (current);
xmlFreeDoc (xdoc);
return texts;
@@ -487,63 +526,114 @@
* @doc: a #GepubDoc
* @id: the resource id
*
- * Returns: (element-type Gepub.TextChunk) (transfer full): the list of text in the current chapter, Free with gepub_doc_free_text().
+ * Returns: (element-type Gepub.TextChunk) (transfer full): the list of text in the current chapter.
*/
GList *
-gepub_doc_get_text_by_id (GepubDoc *doc, gchar *id)
+gepub_doc_get_text_by_id (GepubDoc *doc, const gchar *id)
{
xmlDoc *xdoc = NULL;
xmlNode *root_element = NULL;
- gsize size = 0;
- guchar *res = NULL;
+ gsize size;
+ const guchar *res;
+ GBytes *contents;
GList *texts = NULL;
- res = gepub_doc_get_resource (doc, id, &size);
+ contents = gepub_doc_get_resource_by_id (doc, id);
if (!res) {
return NULL;
}
- xdoc = htmlReadDoc (res, "", NULL, HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR);
+ res = g_bytes_get_data (contents, &size);
+ xdoc = htmlReadMemory (res, size, "", NULL, HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR);
root_element = xmlDocGetRootElement (xdoc);
texts = gepub_utils_get_text_elements (root_element);
- g_free (res);
+ g_bytes_unref (contents);
xmlFreeDoc (xdoc);
return texts;
}
+static gboolean
+gepub_doc_set_page_internal (GepubDoc *doc,
+ GList *page)
+{
+ if (!page || doc->page == page)
+ return FALSE;
+
+ doc->page = page;
+ g_object_notify_by_pspec (G_OBJECT (doc), properties[PROP_PAGE]);
+
+ return TRUE;
+}
+
/**
- * gepub_doc_free_text:
- * @doc: a #GList
+ * gepub_doc_go_next:
+ * @doc: a #GepubDoc
+ *
+ * Returns: TRUE on success, FALSE if there's no next pages
*/
-void
-gepub_doc_free_text (GList *tlist)
+gboolean
+gepub_doc_go_next (GepubDoc *doc)
{
- g_list_free_full (tlist, (GDestroyNotify)g_object_unref);
+ return gepub_doc_set_page_internal (doc, doc->page->next);
}
/**
- * gepub_doc_go_next:
+ * gepub_doc_go_prev:
* @doc: a #GepubDoc
+ *
+ * Returns: TRUE on success, FALSE if there's no prev pages
*/
-void gepub_doc_go_next (GepubDoc *doc)
+gboolean
+gepub_doc_go_prev (GepubDoc *doc)
{
- if (doc->spine->next)
- doc->spine = doc->spine->next;
+ return gepub_doc_set_page_internal (doc, doc->page->prev);
}
/**
- * gepub_doc_go_next:
+ * gepub_doc_get_n_pages:
* @doc: a #GepubDoc
+ *
+ * Returns: the number of pages in the document
*/
-void gepub_doc_go_prev (GepubDoc *doc)
+int
+gepub_doc_get_n_pages (GepubDoc *doc)
{
- if (doc->spine->prev)
- doc->spine = doc->spine->prev;
+ return g_list_length (doc->spine);
}
+/**
+ * gepub_doc_get_page:
+ * @doc: a #GepubDoc
+ *
+ * Returns: the current page index, starting from 0
+ */
+int
+gepub_doc_get_page (GepubDoc *doc)
+{
+ return g_list_position (doc->spine, doc->page);
+}
+
+/**
+ * gepub_doc_set_page:
+ * @doc: a #GepubDoc
+ * @index: the index of the new page
+ *
+ * Sets the document current page to @index.
+ */
+void
+gepub_doc_set_page (GepubDoc *doc,
+ gint index)
+{
+ GList *page;
+
+ g_return_if_fail (index >= 0 && index <= gepub_doc_get_n_pages (doc));
+
+ page = g_list_nth (doc->spine, index);
+ gepub_doc_set_page_internal (doc, page);
+}
/**
* gepub_doc_get_cover:
@@ -560,8 +650,11 @@
xmlNode *mnode = NULL;
gchar *ret;
xmlChar *text;
+ const char *data;
+ gsize size;
- xdoc = xmlRecoverDoc (doc->content);
+ data = g_bytes_get_data (doc->content, &size);
+ xdoc = xmlRecoverMemory (data, size);
root_element = xmlDocGetRootElement (xdoc);
mnode = gepub_utils_get_element_by_attr (root_element, "name", "cover");
text = xmlGetProp(mnode, "content");
@@ -581,7 +674,8 @@
*
* Returns: (transfer full): the resource path
*/
-gchar *gepub_doc_get_resource_path (GepubDoc *doc, gchar *id)
+gchar *
+gepub_doc_get_resource_path (GepubDoc *doc, const gchar *id)
{
GepubResource *gres = g_hash_table_lookup (doc->resources, id);
if (!gres) {
@@ -589,5 +683,30 @@
return NULL;
}
- return gres->uri;
+ return g_strdup (gres->uri);
+}
+
+/**
+ * gepub_doc_get_current_path:
+ * @doc: a #GepubDoc
+ *
+ * Returns: (transfer full): the current resource path
+ */
+gchar *
+gepub_doc_get_current_path (GepubDoc *doc)
+{
+ return gepub_doc_get_resource_path (doc, doc->page->data);
+}
+
+/**
+ * gepub_doc_get_current_id:
+ * @doc: a #GepubDoc
+ *
+
+ * Returns: (transfer none): the current resource id
+ */
+const gchar *
+gepub_doc_get_current_id (GepubDoc *doc)
+{
+ return doc->page->data;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-doc.h new/libgepub-0.4/libgepub/gepub-doc.h
--- old/libgepub-0.3/libgepub/gepub-doc.h 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-doc.h 2016-08-31 09:39:20.000000000 +0200
@@ -42,65 +42,62 @@
typedef struct _GepubResource GepubResource;
-GType gepub_doc_get_type (void) G_GNUC_CONST;
+GType gepub_doc_get_type (void) G_GNUC_CONST;
-GepubDoc *gepub_doc_new (const gchar *path);
-gchar *gepub_doc_get_content (GepubDoc *doc);
-gchar *gepub_doc_get_metadata (GepubDoc *doc, gchar *mdata);
-guchar *gepub_doc_get_resource (GepubDoc *doc, gchar *id, gsize *bufsize);
-guchar *gepub_doc_get_resource_v (GepubDoc *doc, gchar *v, gsize *bufsize);
-GHashTable *gepub_doc_get_resources (GepubDoc *doc);
-gchar *gepub_doc_get_resource_mime (GepubDoc *doc, gchar *v);
-gchar *gepub_doc_get_resource_mime_by_id (GepubDoc *doc, gchar *id);
-GList *gepub_doc_get_spine (GepubDoc *doc);
-GList *gepub_doc_get_text (GepubDoc *doc);
-GList *gepub_doc_get_text_by_id (GepubDoc *doc, gchar *id);
-void gepub_doc_free_text (GList *tlist);
-guchar *gepub_doc_get_current (GepubDoc *doc, gsize *bufsize);
-void gepub_doc_go_next (GepubDoc *doc);
-void gepub_doc_go_prev (GepubDoc *doc);
-gchar *gepub_doc_get_cover (GepubDoc *doc);
-gchar *gepub_doc_get_resource_path (GepubDoc *doc, gchar *id);
+GepubDoc *gepub_doc_new (const gchar *path);
+GBytes *gepub_doc_get_content (GepubDoc *doc);
+gchar *gepub_doc_get_metadata (GepubDoc *doc, const gchar *mdata);
+GBytes *gepub_doc_get_resource (GepubDoc *doc, const gchar *path);
+GBytes *gepub_doc_get_resource_by_id (GepubDoc *doc, const gchar *id);
+GHashTable *gepub_doc_get_resources (GepubDoc *doc);
+gchar *gepub_doc_get_resource_mime (GepubDoc *doc, const gchar *path);
+gchar *gepub_doc_get_resource_mime_by_id (GepubDoc *doc, const gchar *id);
+gchar *gepub_doc_get_current_mime (GepubDoc *doc);
+GList *gepub_doc_get_text (GepubDoc *doc);
+GList *gepub_doc_get_text_by_id (GepubDoc *doc, const gchar *id);
+GBytes *gepub_doc_get_current (GepubDoc *doc);
+GBytes *gepub_doc_get_current_with_epub_uris (GepubDoc *doc);
+gchar *gepub_doc_get_cover (GepubDoc *doc);
+gchar *gepub_doc_get_resource_path (GepubDoc *doc, const gchar *id);
+gchar *gepub_doc_get_current_path (GepubDoc *doc);
+const gchar *gepub_doc_get_current_id (GepubDoc *doc);
+
+gboolean gepub_doc_go_next (GepubDoc *doc);
+gboolean gepub_doc_go_prev (GepubDoc *doc);
+gint gepub_doc_get_n_pages (GepubDoc *doc);
+gint gepub_doc_get_page (GepubDoc *doc);
+void gepub_doc_set_page (GepubDoc *doc,
+ gint index);
G_END_DECLS
/**
* GEPUB_META_TITLE:
* The book title.
- *
- * Value: title
*/
#define GEPUB_META_TITLE "title"
/**
* GEPUB_META_LANG:
* The book lang.
- *
- * Value: language
*/
#define GEPUB_META_LANG "language"
/**
* GEPUB_META_ID:
* The book id.
- *
- * Value: identifier
*/
#define GEPUB_META_ID "identifier"
/**
* GEPUB_META_AUTHOR:
* The book author.
- *
- * Value: creator
*/
#define GEPUB_META_AUTHOR "creator"
/**
* GEPUB_META_DESC:
* The book description.
- *
- * Value: description
*/
#define GEPUB_META_DESC "description"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-text-chunk.h new/libgepub-0.4/libgepub/gepub-text-chunk.h
--- old/libgepub-0.3/libgepub/gepub-text-chunk.h 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-text-chunk.h 2016-08-31 09:39:20.000000000 +0200
@@ -54,7 +54,7 @@
typedef struct _GepubTextChunkClass GepubTextChunkClass;
GType gepub_text_chunk_get_type (void) G_GNUC_CONST;
-GepubTextChunk *gepub_text_chunk_new (GepubTextChunkType type, const guchar *path);
+GepubTextChunk *gepub_text_chunk_new (GepubTextChunkType type, const guchar *text);
gchar *gepub_text_chunk_type_str (GepubTextChunk *chunk);
gchar *gepub_text_chunk_text (GepubTextChunk *chunk);
GepubTextChunkType gepub_text_chunk_type (GepubTextChunk *chunk);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-utils.c new/libgepub-0.4/libgepub/gepub-utils.c
--- old/libgepub-0.3/libgepub/gepub-utils.c 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-utils.c 2016-08-31 09:39:20.000000000 +0200
@@ -16,13 +16,57 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <libsoup/soup.h>
+
#include <libxml/tree.h>
+#include <libxml/parser.h>
#include <stdarg.h>
#include <string.h>
#include "gepub-utils.h"
#include "gepub-text-chunk.h"
+
+/* Replaces the attr value with epub:// prefix for the tagname. This
+ * function also makes the resource absolute based on the epub root
+ */
+static void
+set_epub_uri (xmlNode *node, const gchar *path, const gchar *tagname, const gchar *attr)
+{
+ xmlNode *cur_node = NULL;
+ xmlChar *text = NULL;
+
+ SoupURI *baseURI;
+ gchar *basepath = g_strdup_printf ("epub://%s/", path);
+
+ baseURI = soup_uri_new (basepath);
+ g_free (basepath);
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next) {
+ if (cur_node->type == XML_ELEMENT_NODE ) {
+ text = xmlGetProp (cur_node, attr);
+ if (!strcmp (cur_node->name, tagname) && text) {
+ SoupURI *uri = soup_uri_new_with_base (baseURI, text);
+ gchar *value = soup_uri_to_string (uri, FALSE);
+
+ xmlSetProp (cur_node, attr, value);
+
+ soup_uri_free (uri);
+ g_free (value);
+ }
+ if (text) {
+ xmlFree (text);
+ text = NULL;
+ }
+ }
+
+ if (cur_node->children)
+ set_epub_uri (cur_node->children, path, tagname, attr);
+ }
+
+ soup_uri_free (baseURI);
+}
+
gboolean
gepub_utils_has_parent_tag (xmlNode *node, gchar *name, ...)
{
@@ -56,8 +100,15 @@
return FALSE;
}
+/**
+ * gepub_utils_get_element_by_tag: (skip):
+ * @node: an #xmlNode
+ * @name: the tag name
+ *
+ * Returns: the tag matching @name.
+ */
xmlNode *
-gepub_utils_get_element_by_tag (xmlNode *node, gchar *name)
+gepub_utils_get_element_by_tag (xmlNode *node, const gchar *name)
{
xmlNode *cur_node = NULL;
xmlNode *ret = NULL;
@@ -75,8 +126,16 @@
return ret;
}
+/**
+ * gepub_utils_get_element_by_attr: (skip):
+ * @node: an #xmlNode
+ * @attr: the attribute
+ * @value: the value
+ *
+ * Returns: the element matching @attr and @value.
+ */
xmlNode *
-gepub_utils_get_element_by_attr (xmlNode *node, gchar *attr, gchar *value)
+gepub_utils_get_element_by_attr (xmlNode *node, const gchar *attr, const gchar *value)
{
xmlNode *cur_node = NULL;
xmlNode *ret = NULL;
@@ -103,6 +162,13 @@
return ret;
}
+/**
+ * gepub_utils_get_text_elements:
+ * @node: an #xmlNode
+ *
+ * Returns: (element-type Gepub.TextChunk) (transfer full): the text elements
+ * of @node.
+ */
GList *
gepub_utils_get_text_elements (xmlNode *node)
{
@@ -150,3 +216,34 @@
return text_list;
}
+
+/* Replacing epub media paths, for css, image and svg files, to be
+ * able to provide these files to webkit from the epub file
+ */
+GBytes *
+gepub_utils_replace_resources (GBytes *content, const gchar *path)
+{
+ xmlDoc *doc = NULL;
+ xmlNode *root_element = NULL;
+ guchar *buffer;
+ const guchar *data;
+ gsize bufsize;
+
+ data = g_bytes_get_data (content, &bufsize);
+ doc = xmlReadMemory (data, bufsize, "", NULL, XML_PARSE_NOWARNING | XML_PARSE_NOERROR);
+ root_element = xmlDocGetRootElement (doc);
+
+ // replacing css resources
+ set_epub_uri (root_element, path, "link", "href");
+ // replacing images resources
+ set_epub_uri (root_element, path, "img", "src");
+ // replacing svg images resources
+ set_epub_uri (root_element, path, "image", "xlink:href");
+ // replacing crosslinks
+ set_epub_uri (root_element, path, "a", "href");
+
+ xmlDocDumpFormatMemory (doc, (xmlChar**)&buffer, (int*)&bufsize, 1);
+ xmlFreeDoc (doc);
+
+ return g_bytes_new_take (buffer, bufsize);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-utils.h new/libgepub-0.4/libgepub/gepub-utils.h
--- old/libgepub-0.3/libgepub/gepub-utils.h 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub-utils.h 2016-08-31 09:39:20.000000000 +0200
@@ -22,8 +22,9 @@
#include <glib.h>
#include <libxml/tree.h>
-xmlNode * gepub_utils_get_element_by_tag (xmlNode *node, gchar *name);
-xmlNode * gepub_utils_get_element_by_attr (xmlNode *node, gchar *attr, gchar *value);
-GList * gepub_utils_get_text_elements (xmlNode *node);
+xmlNode * gepub_utils_get_element_by_tag (xmlNode *node, const gchar *name);
+xmlNode * gepub_utils_get_element_by_attr (xmlNode *node, const gchar *attr, const gchar *value);
+GList * gepub_utils_get_text_elements (xmlNode *node);
+GBytes * gepub_utils_replace_resources (GBytes *content, const gchar *path);
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-widget.c new/libgepub-0.4/libgepub/gepub-widget.c
--- old/libgepub-0.3/libgepub/gepub-widget.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libgepub-0.4/libgepub/gepub-widget.c 2016-08-31 09:39:20.000000000 +0200
@@ -0,0 +1,230 @@
+/* GepubWidget
+ *
+ * Copyright (C) 2016 Daniel Garcia <danigm(a)wadobo.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <gtk/gtk.h>
+
+#include "gepub-widget.h"
+
+struct _GepubWidget {
+ WebKitWebView parent;
+
+ GepubDoc *doc;
+};
+
+struct _GepubWidgetClass {
+ WebKitWebViewClass parent_class;
+};
+
+enum {
+ PROP_0,
+ PROP_DOC,
+ NUM_PROPS
+};
+
+static GParamSpec *properties[NUM_PROPS] = { NULL, };
+
+G_DEFINE_TYPE (GepubWidget, gepub_widget, WEBKIT_TYPE_WEB_VIEW)
+
+static void
+resource_callback (WebKitURISchemeRequest *request, gpointer user_data)
+{
+ GInputStream *stream;
+ gchar *path;
+ gchar *uri;
+ gchar *mime;
+ GepubWidget *widget = user_data;
+ GBytes *contents;
+
+ if (!widget->doc)
+ return;
+
+ uri = g_strdup (webkit_uri_scheme_request_get_uri (request));
+ // removing "epub://"
+ path = uri + 7;
+ contents = gepub_doc_get_resource (widget->doc, path);
+ mime = gepub_doc_get_resource_mime (widget->doc, path);
+
+ if (!mime) {
+ g_free (uri);
+ return;
+ }
+
+ stream = g_memory_input_stream_new_from_bytes (contents);
+ webkit_uri_scheme_request_finish (request, stream, g_bytes_get_size (contents), mime);
+
+ g_object_unref (stream);
+ g_bytes_unref (contents);
+ g_free (mime);
+ g_free (uri);
+}
+
+static void
+gepub_widget_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GepubWidget *widget = GEPUB_WIDGET (object);
+
+ switch (prop_id) {
+ case PROP_DOC:
+ gepub_widget_set_doc (widget, g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gepub_widget_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GepubWidget *widget = GEPUB_WIDGET (object);
+
+ switch (prop_id) {
+ case PROP_DOC:
+ g_value_set_object (value, gepub_widget_get_doc (widget));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gepub_widget_finalize (GObject *object)
+{
+ GepubWidget *widget = GEPUB_WIDGET (object);
+
+ g_clear_object (&widget->doc);
+
+ G_OBJECT_CLASS (gepub_widget_parent_class)->finalize (object);
+}
+
+static void
+gepub_widget_init (GepubWidget *widget)
+{
+}
+
+static void
+gepub_widget_constructed (GObject *object)
+{
+ WebKitWebContext *ctx;
+ GepubWidget *widget = GEPUB_WIDGET (object);
+
+ G_OBJECT_CLASS (gepub_widget_parent_class)->constructed (object);
+
+ ctx = webkit_web_view_get_context (WEBKIT_WEB_VIEW (widget));
+ webkit_web_context_register_uri_scheme (ctx, "epub", resource_callback, widget, NULL);
+}
+
+static void
+gepub_widget_class_init (GepubWidgetClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->constructed = gepub_widget_constructed;
+ object_class->finalize = gepub_widget_finalize;
+ object_class->set_property = gepub_widget_set_property;
+ object_class->get_property = gepub_widget_get_property;
+
+ properties[PROP_DOC] =
+ g_param_spec_object ("doc",
+ "The GepubDoc",
+ "The GepubDoc for this widget",
+ GEPUB_TYPE_DOC,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, NUM_PROPS, properties);
+}
+
+/**
+ * gepub_widget_new:
+ *
+ * Returns: (transfer full): the new GepubWidget created
+ */
+GtkWidget *
+gepub_widget_new (void)
+{
+ return g_object_new (GEPUB_TYPE_WIDGET,
+ NULL);
+}
+
+/**
+ * gepub_widget_get_doc:
+ * @widget: a #GepubWidget
+ *
+ * Returns: (transfer none): the #GepubDoc
+ */
+GepubDoc *
+gepub_widget_get_doc (GepubWidget *widget)
+{
+ return widget->doc;
+}
+
+static void
+reload_current_chapter (GepubWidget *widget)
+{
+ GBytes *current;
+
+ current = gepub_doc_get_current_with_epub_uris (widget->doc);
+ webkit_web_view_load_bytes (WEBKIT_WEB_VIEW (widget),
+ current,
+ gepub_doc_get_current_mime (widget->doc),
+ "UTF-8", NULL);
+
+ g_bytes_unref (current);
+}
+
+/**
+ * gepub_widget_set_doc:
+ * @widget: a #GepubWidget
+ * @doc: (nullable): a #GepubDoc
+ *
+ * Sets @doc as the document displayed by the widget.
+ */
+void
+gepub_widget_set_doc (GepubWidget *widget,
+ GepubDoc *doc)
+{
+ if (widget->doc == doc)
+ return;
+
+ if (widget->doc != NULL) {
+ g_signal_handlers_disconnect_by_func (widget->doc,
+ reload_current_chapter, widget);
+ g_object_unref (widget->doc);
+ }
+
+ widget->doc = doc;
+
+ if (widget->doc != NULL) {
+ g_object_ref (widget->doc);
+ reload_current_chapter (widget);
+ g_signal_connect_swapped (widget->doc, "notify::page",
+ G_CALLBACK (reload_current_chapter), widget);
+ }
+
+ g_object_notify_by_pspec (G_OBJECT (widget), properties[PROP_DOC]);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub-widget.h new/libgepub-0.4/libgepub/gepub-widget.h
--- old/libgepub-0.3/libgepub/gepub-widget.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libgepub-0.4/libgepub/gepub-widget.h 2016-08-31 09:39:20.000000000 +0200
@@ -0,0 +1,52 @@
+/* GepubWidget
+ *
+ * Copyright (C) 2016 Daniel Garcia <danigm(a)wadobo.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __GEPUB_WIDGET_H__
+#define __GEPUB_WIDGET_H__
+
+#include <webkit2/webkit2.h>
+#include <glib-object.h>
+#include <glib.h>
+
+#include "gepub-doc.h"
+
+G_BEGIN_DECLS
+
+#define GEPUB_TYPE_WIDGET (gepub_widget_get_type ())
+#define GEPUB_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GEPUB_TYPE_WIDGET, GepubWidget))
+#define GEPUB_WIDGET_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GEPUB_TYPE_WIDGET, GepubWidgetClass))
+#define GEPUB_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GEPUB_TYPE_WIDGET))
+#define GEPUB_IS_WIDGET_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GEPUB_TYPE_WIDGET))
+#define GEPUB_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEPUB_TYPE_WIDGET, GepubWidgetClass))
+
+typedef struct _GepubWidget GepubWidget;
+typedef struct _GepubWidgetClass GepubWidgetClass;
+
+GType gepub_widget_get_type (void) G_GNUC_CONST;
+
+GtkWidget *gepub_widget_new (void);
+
+GepubDoc *gepub_widget_get_doc (GepubWidget *widget);
+void gepub_widget_set_doc (GepubWidget *widget,
+ GepubDoc *doc);
+
+G_END_DECLS
+
+#endif /* __GEPUB_WIDGET_H__ */
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub/gepub.h new/libgepub-0.4/libgepub/gepub.h
--- old/libgepub-0.3/libgepub/gepub.h 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub/gepub.h 2016-08-31 09:39:20.000000000 +0200
@@ -4,5 +4,6 @@
#include "gepub-archive.h"
#include "gepub-text-chunk.h"
#include "gepub-doc.h"
+#include "gepub-widget.h"
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub.doap new/libgepub-0.4/libgepub.doap
--- old/libgepub-0.3/libgepub.doap 1970-01-01 01:00:00.000000000 +0100
+++ new/libgepub-0.4/libgepub.doap 2016-08-31 09:39:20.000000000 +0200
@@ -0,0 +1,19 @@
+<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+ xmlns:gnome="http://api.gnome.org/doap-extensions#"
+ xmlns="http://usefulinc.com/ns/doap#">
+
+ <name xml:lang="en">libgepub</name>
+ <shortdesc xml:lang="en">Simple library to read epub files using glib</shortdesc>
+ <description>libgepub is a GObject based library for handling and rendering epub
+documents.</description>
+ <programming-language>C</programming-language>
+
+ <maintainer>
+ <foaf:Person>
+ <foaf:name>Daniel García Moreno</foaf:name>
+ <gnome:userid>danigm</gnome:userid>
+ </foaf:Person>
+ </maintainer>
+</Project>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/libgepub.pc.in new/libgepub-0.4/libgepub.pc.in
--- old/libgepub-0.3/libgepub.pc.in 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/libgepub.pc.in 2016-08-31 09:39:20.000000000 +0200
@@ -6,6 +6,7 @@
Name: libgepub
Description: epub Documents library
Version: @VERSION@
-Requires: glib-2.0 gobject-2.0 gio-2.0 libxml-2.0 libarchive
+Requires: gio-2.0
+Requires.private: libxml-2.0 libarchive
Libs: -L${libdir} -lgepub
Cflags: -I${includedir}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/tests/Makefile.am new/libgepub-0.4/tests/Makefile.am
--- old/libgepub-0.3/tests/Makefile.am 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/tests/Makefile.am 2016-08-31 09:39:20.000000000 +0200
@@ -7,11 +7,11 @@
$(AM_CPPFLAGS)
test_gepub_CFLAGS = \
- $(GEPUB_CFLAGS) \
+ $(GEPUB_TESTS_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS)
test_gepub_LDADD = \
$(top_builddir)/libgepub/libgepub.la \
- $(GEPUB_LIBS) \
+ $(GEPUB_TESTS_LIBS) \
$(GTK_LIBS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libgepub-0.3/tests/test-gepub.c new/libgepub-0.4/tests/test-gepub.c
--- old/libgepub-0.3/tests/test-gepub.c 2016-05-23 09:29:03.000000000 +0200
+++ new/libgepub-0.4/tests/test-gepub.c 2016-08-31 09:39:20.000000000 +0200
@@ -53,14 +53,30 @@
}
void
-button_pressed (GtkButton *button, GepubDoc *doc)
+print_replaced_text (GepubDoc *doc)
{
+ GBytes *content;
+ gsize s;
+ const guchar *data;
+ content = gepub_doc_get_current_with_epub_uris (doc);
+
+ data = g_bytes_get_data (content, &s);
+ printf ("\n\nREPLACED:\n%s\n", data);
+ g_bytes_unref (content);
+}
+
+void
+button_pressed (GtkButton *button, GepubWidget *widget)
+{
+ GepubDoc *doc = gepub_widget_get_doc (widget);
+
if (!strcmp (gtk_button_get_label (button), "prev")) {
gepub_doc_go_prev (doc);
} else {
gepub_doc_go_next (doc);
}
update_text (doc);
+ print_replaced_text (doc);
}
void
@@ -105,9 +121,10 @@
{
GepubArchive *a;
GList *list_files = NULL;
- guchar *buffer;
+ const guchar *buffer;
guchar *file = NULL;
gsize bufsize;
+ GBytes *bytes;
a = gepub_archive_new (path);
@@ -115,11 +132,15 @@
GHashTable *ht = (GHashTable*)gepub_doc_get_resources (doc);
g_hash_table_foreach (ht, (GHFunc)find_xhtml, &file);
- gepub_archive_read_entry (a, file, &buffer, &bufsize);
- if (bufsize)
- PTEST ("doc:%s\n----\n%s\n-----\n", file, buffer);
+ bytes = gepub_archive_read_entry (a, file);
+ if (bytes) {
+ const char *data;
+ gsize size;
- g_free (buffer);
+ buffer = g_bytes_get_data (bytes, &bufsize);
+ PTEST ("doc:%s\n----\n%s\n-----\n", file, buffer);
+ g_bytes_unref (bytes);
+ }
g_list_foreach (list_files, (GFunc)g_free, NULL);
g_list_free (list_files);
@@ -184,30 +205,27 @@
GepubDoc *doc = gepub_doc_new (path);
GHashTable *ht = (GHashTable*)gepub_doc_get_resources (doc);
g_hash_table_foreach (ht, (GHFunc)pk, NULL);
- guchar *ncx;
+ GBytes *ncx;
+ const guchar *data;
gsize size;
- ncx = gepub_doc_get_resource (doc, "ncx", &size);
- PTEST ("ncx:\n%s\n", ncx);
- g_free (ncx);
+ ncx = gepub_doc_get_resource_by_id (doc, "ncx");
+ data = g_bytes_get_data (ncx, &size);
+ PTEST ("ncx:\n%s\n", data);
+ g_bytes_unref (ncx);
g_object_unref (G_OBJECT (doc));
}
void
-p (gchar *value, gpointer data)
-{
- static int id = 0;
- PTEST ("%d: %s\n", id++, value);
-}
-
-void
test_doc_spine (const char *path)
{
GepubDoc *doc = gepub_doc_new (path);
+ int id = 0;
- GList *spine = gepub_doc_get_spine (doc);
- g_list_foreach (spine, (GFunc)p, NULL);
+ do {
+ PTEST ("%d: %s\n", id++, gepub_doc_get_current_id (doc));
+ } while (gepub_doc_go_next (doc));
g_object_unref (G_OBJECT (doc));
}
@@ -231,6 +249,7 @@
GepubDoc *doc;
GtkWidget *textview2;
+ GtkWidget *widget = gepub_widget_new ();
if (argc < 2) {
printf ("you should provide an .epub file\n");
@@ -243,12 +262,15 @@
vpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_container_add (GTK_CONTAINER (window), vpaned);
+ // gepub widget
doc = gepub_doc_new (argv[1]);
if (!doc) {
perror ("BAD epub FILE");
return -1;
}
+ gepub_widget_set_doc (GEPUB_WIDGET (widget), doc);
+
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
textview2 = gtk_text_view_new ();
@@ -264,22 +286,23 @@
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
b_prev = gtk_button_new_with_label ("prev");
- g_signal_connect (b_prev, "clicked", (GCallback)button_pressed, doc);
+ g_signal_connect (b_prev, "clicked", (GCallback)button_pressed, GEPUB_WIDGET (widget));
b_next = gtk_button_new_with_label ("next");
- g_signal_connect (b_next, "clicked", (GCallback)button_pressed, doc);
+ g_signal_connect (b_next, "clicked", (GCallback)button_pressed, GEPUB_WIDGET (widget));
gtk_container_add (GTK_CONTAINER (hbox), b_prev);
gtk_container_add (GTK_CONTAINER (hbox), b_next);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5);
gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 5);
- gtk_widget_set_size_request (GTK_WIDGET (vbox), 400, 500);
- gtk_paned_add1 (GTK_PANED (vpaned), vbox);
-
textview = gtk_text_view_new ();
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled), textview);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_paned_add2 (GTK_PANED (vpaned), scrolled);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 5);
+
+ gtk_widget_set_size_request (GTK_WIDGET (vbox), 400, 500);
+ gtk_paned_add1 (GTK_PANED (vpaned), vbox);
+ gtk_paned_add2 (GTK_PANED (vpaned), widget);
gtk_widget_show_all (window);
@@ -301,5 +324,7 @@
gtk_main ();
+ g_object_unref (doc);
+
return 0;
}
1
0
Hello community,
here is the log from the commit of package mailman for openSUSE:Factory checked in at 2016-09-01 14:03:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mailman (Old)
and /work/SRC/openSUSE:Factory/.mailman.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mailman"
Changes:
--------
--- /work/SRC/openSUSE:Factory/mailman/mailman.changes 2016-04-28 16:58:22.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.mailman.new/mailman.changes 2016-09-01 14:03:49.000000000 +0200
@@ -1,0 +2,12 @@
+Mon Aug 29 10:57:00 UTC 2016 - hsk17(a)mail.de
+
+- update to 2.1.23
+ * CSRF protection in user options page (CVE-2016-6893)
+ * header_filter_rules matching: headers and patterns are all
+ decoded to unicode
+ * another possible REMOVE_DKIM_HEADERS setting
+ * SMTPDirect.py can now do SASL authentication and STARTTLS
+ * bug fixes, i18n updates
+ * for further details see NEWS
+
+-------------------------------------------------------------------
Old:
----
mailman-2.1.22.tgz
mailman-2.1.22.tgz.sig
New:
----
mailman-2.1.23.tgz
mailman-2.1.23.tgz.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mailman.spec ++++++
--- /var/tmp/diff_new_pack.vmW0Vv/_old 2016-09-01 14:03:51.000000000 +0200
+++ /var/tmp/diff_new_pack.vmW0Vv/_new 2016-09-01 14:03:51.000000000 +0200
@@ -37,7 +37,7 @@
Summary: The GNU Mailing List Manager
License: GPL-2.0+
Group: Productivity/Networking/Email/Mailinglists
-Version: 2.1.22
+Version: 2.1.23
Release: 0
Source0: https://ftp.gnu.org/gnu/mailman/%{name}-%{version}.tgz
Source13: https://ftp.gnu.org/gnu/mailman/%{name}-%{version}.tgz.sig
++++++ mailman-2.1.22.tgz -> mailman-2.1.23.tgz ++++++
/work/SRC/openSUSE:Factory/mailman/mailman-2.1.22.tgz /work/SRC/openSUSE:Factory/.mailman.new/mailman-2.1.23.tgz differ: char 5, line 1
1
0
Hello community,
here is the log from the commit of package python-wrapt for openSUSE:Factory checked in at 2016-09-01 14:03:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wrapt (Old)
and /work/SRC/openSUSE:Factory/.python-wrapt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wrapt"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wrapt/python-wrapt.changes 2016-02-17 12:23:20.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-wrapt.new/python-wrapt.changes 2016-09-01 14:03:47.000000000 +0200
@@ -1,0 +2,13 @@
+Thu Sep 1 05:30:31 UTC 2016 - tbechtold(a)suse.com
+
+update to version 1.10.8
+ * Increment version to 1.10.8.
+ * Fix modulo operator on ObjectProxy
+ * Increment version to 1.10.7.
+ * Document mod operator bug in Python variant of object proxy.
+ * Update copyright year.
+ * Fix tests for floordiv and mod.
+ * Remove reference to inspect.getargspec() as removed in Python 3.6. #64
+- Use pypi.io as Source url
+
+-------------------------------------------------------------------
Old:
----
wrapt-1.10.6.tar.gz
New:
----
wrapt-1.10.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-wrapt.spec ++++++
--- /var/tmp/diff_new_pack.BMfz1K/_old 2016-09-01 14:03:47.000000000 +0200
+++ /var/tmp/diff_new_pack.BMfz1K/_new 2016-09-01 14:03:47.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-wrapt
#
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
@@ -14,16 +14,17 @@
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
Name: python-wrapt
-Version: 1.10.6
+Version: 1.10.8
Release: 0
-License: BSD-2-Clause
Summary: A Python module for decorators, wrappers and monkey patching
-Url: https://github.com/GrahamDumpleton/wrapt
+License: BSD-2-Clause
Group: Development/Languages/Python
-Source: https://pypi.python.org/packages/source/w/wrapt/wrapt-%{version}.tar.gz
+Url: https://github.com/GrahamDumpleton/wrapt
+Source: https://pypi.io/packages/source/w/wrapt/wrapt-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ wrapt-1.10.6.tar.gz -> wrapt-1.10.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.6/LICENSE new/wrapt-1.10.8/LICENSE
--- old/wrapt-1.10.6/LICENSE 2015-07-03 02:29:14.000000000 +0200
+++ new/wrapt-1.10.8/LICENSE 2016-03-31 07:49:07.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (c) 2013-2015, Graham Dumpleton
+Copyright (c) 2013-2016, Graham Dumpleton
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.6/PKG-INFO new/wrapt-1.10.8/PKG-INFO
--- old/wrapt-1.10.6/PKG-INFO 2015-12-09 00:01:57.000000000 +0100
+++ new/wrapt-1.10.8/PKG-INFO 2016-04-11 01:34:05.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: wrapt
-Version: 1.10.6
+Version: 1.10.8
Summary: Module for decorators, wrappers and monkey patching.
Home-page: https://github.com/GrahamDumpleton/wrapt
Author: Graham Dumpleton
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.6/setup.py new/wrapt-1.10.8/setup.py
--- old/wrapt-1.10.6/setup.py 2015-12-05 21:37:09.000000000 +0100
+++ new/wrapt-1.10.8/setup.py 2016-04-11 01:32:33.000000000 +0200
@@ -34,7 +34,7 @@
setup_kwargs = dict(
name = 'wrapt',
- version = '1.10.6',
+ version = '1.10.8',
description = 'Module for decorators, wrappers and monkey patching.',
long_description = open('README.rst').read(),
author = 'Graham Dumpleton',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.6/src/wrapt/__init__.py new/wrapt-1.10.8/src/wrapt/__init__.py
--- old/wrapt-1.10.6/src/wrapt/__init__.py 2015-12-05 21:34:05.000000000 +0100
+++ new/wrapt-1.10.8/src/wrapt/__init__.py 2016-04-11 01:32:33.000000000 +0200
@@ -1,4 +1,4 @@
-__version_info__ = ('1', '10', '6')
+__version_info__ = ('1', '10', '8')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.6/src/wrapt/decorators.py new/wrapt-1.10.8/src/wrapt/decorators.py
--- old/wrapt-1.10.6/src/wrapt/decorators.py 2015-12-05 21:34:05.000000000 +0100
+++ new/wrapt-1.10.8/src/wrapt/decorators.py 2016-04-11 01:32:33.000000000 +0200
@@ -31,7 +31,7 @@
exec("""exec _code_ in _globs_, _locs_""")
from functools import partial
-from inspect import getargspec, ismethod, isclass, formatargspec
+from inspect import ismethod, isclass, formatargspec
from collections import namedtuple
from threading import Lock, RLock
@@ -181,17 +181,17 @@
# decorator. In that case parts of the function '__code__' and
# '__defaults__' attributes are used from the adapter function
# rather than those of the wrapped function. This allows for the
- # argument specification from inspect.getargspec() to be overridden
- # with a prototype for a different function than what was wrapped.
- # The 'enabled' argument provides a way to enable/disable the use
- # of the decorator. If the type of 'enabled' is a boolean, then it
- # is evaluated immediately and the wrapper not even applied if
- # it is False. If not a boolean, it will be evaluated when the
- # wrapper is called for an unbound wrapper, and when binding occurs
- # for a bound wrapper. When being evaluated, if 'enabled' is callable
- # it will be called to obtain the value to be checked. If False,
- # the wrapper will not be called and instead the original wrapped
- # function will be called directly instead.
+ # argument specification from inspect.getargspec() and similar
+ # functions to be overridden with a prototype for a different
+ # function than what was wrapped. The 'enabled' argument provides a
+ # way to enable/disable the use of the decorator. If the type of
+ # 'enabled' is a boolean, then it is evaluated immediately and the
+ # wrapper not even applied if it is False. If not a boolean, it will
+ # be evaluated when the wrapper is called for an unbound wrapper,
+ # and when binding occurs for a bound wrapper. When being evaluated,
+ # if 'enabled' is callable it will be called to obtain the value to
+ # be checked. If False, the wrapper will not be called and instead
+ # the original wrapped function will be called directly instead.
if wrapper is not None:
# Helper function for creating wrapper of the appropriate
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.6/src/wrapt/wrappers.py new/wrapt-1.10.8/src/wrapt/wrappers.py
--- old/wrapt-1.10.6/src/wrapt/wrappers.py 2015-12-05 21:34:05.000000000 +0100
+++ new/wrapt-1.10.8/src/wrapt/wrappers.py 2016-03-31 07:49:07.000000000 +0200
@@ -230,7 +230,7 @@
return self.__wrapped__ // other
def __mod__(self, other):
- return self.__wrapped__ ^ other
+ return self.__wrapped__ % other
def __divmod__(self, other):
return divmod(self.__wrapped__, other)
1
0
Hello community,
here is the log from the commit of package python-ddt for openSUSE:Factory checked in at 2016-09-01 14:03:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ddt (Old)
and /work/SRC/openSUSE:Factory/.python-ddt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ddt"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ddt/python-ddt.changes 2015-12-23 09:57:30.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-ddt.new/python-ddt.changes 2016-09-01 14:03:45.000000000 +0200
@@ -1,0 +2,29 @@
+Thu Sep 1 05:23:40 UTC 2016 - tbechtold(a)suse.com
+
+update to version 1.1.0
+ * Note explicit support for Python 3.5
+ * Catch ImportErrors and improve coverage metrics
+ * Document the YAML support
+ * Refactor error functions in process_file_data
+ * Bump version to 1.1.0
+ * Add basic support for YAML data files
+ * Bump version to 1.0.2
+ * Bump version number
+ * Properly handle file object
+ * Fix the no-YAML installed test
+ * Fix Flake8 warnings
+ * Add more tests for YAML data files
+ * Split process_file_data into 2 functions
+ * Remove broken badge 'caniusepython3'
+ * Variable naming changes
+ * Flake8: make lambda into 'def' function
+ * Unconditionally use PyPI mock
+ * Fix copy-paste error
+ * Fix unittest with object instance as data
+ * Add mock to test requirements
+ * Add PyYAML as a test dependency
+ * RTD build trigger to use project name
+ * Load the YAML data safely
+- Use pypi.io as Source url
+
+-------------------------------------------------------------------
Old:
----
ddt-1.0.1.tar.gz
New:
----
ddt-1.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ddt.spec ++++++
--- /var/tmp/diff_new_pack.8QycSv/_old 2016-09-01 14:03:46.000000000 +0200
+++ /var/tmp/diff_new_pack.8QycSv/_new 2016-09-01 14:03:46.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-ddt
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,13 @@
Name: python-ddt
-Version: 1.0.1
+Version: 1.1.0
Release: 0
Summary: Data-Driven/Decorated Tests
License: MIT
Group: Development/Languages/Python
Url: https://github.com/txels/ddt
-Source: https://pypi.python.org/packages/source/d/ddt/ddt-%{version}.tar.gz
+Source: https://pypi.io/packages/source/d/ddt/ddt-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ ddt-1.0.1.tar.gz -> ddt-1.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddt-1.0.1/PKG-INFO new/ddt-1.1.0/PKG-INFO
--- old/ddt-1.0.1/PKG-INFO 2015-11-18 23:09:54.000000000 +0100
+++ new/ddt-1.1.0/PKG-INFO 2016-05-31 09:27:22.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: ddt
-Version: 1.0.1
+Version: 1.1.0
Summary: Data-Driven/Decorated Tests
Home-page: https://github.com/txels/ddt
Author: Carles Barrobés
@@ -18,4 +18,5 @@
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddt-1.0.1/ddt.egg-info/PKG-INFO new/ddt-1.1.0/ddt.egg-info/PKG-INFO
--- old/ddt-1.0.1/ddt.egg-info/PKG-INFO 2015-11-18 23:09:54.000000000 +0100
+++ new/ddt-1.1.0/ddt.egg-info/PKG-INFO 2016-05-31 09:27:21.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: ddt
-Version: 1.0.1
+Version: 1.1.0
Summary: Data-Driven/Decorated Tests
Home-page: https://github.com/txels/ddt
Author: Carles Barrobés
@@ -18,4 +18,5 @@
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddt-1.0.1/ddt.py new/ddt-1.1.0/ddt.py
--- old/ddt-1.0.1/ddt.py 2015-11-18 23:09:00.000000000 +0100
+++ new/ddt-1.1.0/ddt.py 2016-05-31 09:26:35.000000000 +0200
@@ -11,7 +11,14 @@
import re
from functools import wraps
-__version__ = '1.0.1'
+try:
+ import yaml
+except ImportError: # pragma: no cover
+ _have_yaml = False
+else:
+ _have_yaml = True
+
+__version__ = '1.1.0'
# These attributes will not conflict with any real python attribute
# They are added to the decorated test method and processed later
@@ -152,25 +159,56 @@
cls_path = os.path.abspath(inspect.getsourcefile(cls))
data_file_path = os.path.join(os.path.dirname(cls_path), file_attr)
- def _raise_ve(*args): # pylint: disable-msg=W0613
- raise ValueError("%s does not exist" % file_attr)
+ def create_error_func(message): # pylint: disable-msg=W0613
+ def func(*args):
+ raise ValueError(message % file_attr)
+ return func
+
+ # If file does not exist, provide an error function instead
+ if not os.path.exists(data_file_path):
+ test_name = mk_test_name(name, "error")
+ add_test(cls, test_name, create_error_func("%s does not exist"), None)
+ return
+
+ _is_yaml_file = data_file_path.endswith((".yml", ".yaml"))
- if os.path.exists(data_file_path) is False:
+ # Don't have YAML but want to use YAML file.
+ if _is_yaml_file and not _have_yaml:
test_name = mk_test_name(name, "error")
- add_test(cls, test_name, _raise_ve, None)
- else:
- data = json.loads(open(data_file_path).read())
- for i, elem in enumerate(data):
- if isinstance(data, dict):
- key, value = elem, data[elem]
- test_name = mk_test_name(name, key, i)
- elif isinstance(data, list):
- value = elem
- test_name = mk_test_name(name, value, i)
- if isinstance(value, dict):
- add_test(cls, test_name, func, **value)
- else:
- add_test(cls, test_name, func, value)
+ add_test(
+ cls,
+ test_name,
+ create_error_func("%s is a YAML file, please install PyYAML"),
+ None
+ )
+ return
+
+ with open(data_file_path) as f:
+ # Load the data from YAML or JSON
+ if _is_yaml_file:
+ data = yaml.safe_load(f)
+ else:
+ data = json.load(f)
+
+ _add_tests_from_data(cls, name, func, data)
+
+
+def _add_tests_from_data(cls, name, func, data):
+ """
+ Add tests from data loaded from the data file into the class
+
+ """
+ for i, elem in enumerate(data):
+ if isinstance(data, dict):
+ key, value = elem, data[elem]
+ test_name = mk_test_name(name, key, i)
+ elif isinstance(data, list):
+ value = elem
+ test_name = mk_test_name(name, value, i)
+ if isinstance(value, dict):
+ add_test(cls, test_name, func, **value)
+ else:
+ add_test(cls, test_name, func, value)
def ddt(cls):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddt-1.0.1/setup.py new/ddt-1.1.0/setup.py
--- old/ddt-1.0.1/setup.py 2015-01-27 19:35:38.000000000 +0100
+++ new/ddt-1.1.0/setup.py 2016-05-25 17:37:37.000000000 +0200
@@ -24,6 +24,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
'Topic :: Software Development :: Testing',
],
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddt-1.0.1/test/test_example.py new/ddt-1.1.0/test/test_example.py
--- old/ddt-1.0.1/test/test_example.py 2015-10-26 18:01:56.000000000 +0100
+++ new/ddt-1.1.0/test/test_example.py 2016-05-31 09:26:09.000000000 +0200
@@ -2,6 +2,19 @@
from ddt import ddt, data, file_data, unpack
from test.mycode import larger_than_two, has_three_elements, is_a_greeting
+try:
+ import yaml
+except ImportError: # pragma: no cover
+ have_yaml_support = False
+else:
+ have_yaml_support = True
+ del yaml
+
+# A good-looking decorator
+needs_yaml = unittest.skipUnless(
+ have_yaml_support, "Need YAML to run this test"
+)
+
class Mylist(list):
pass
@@ -32,17 +45,34 @@
self.assertGreater(a, b)
@file_data("test_data_dict_dict.json")
- def test_file_data_dict_dict(self, start, end, value):
+ def test_file_data_json_dict_dict(self, start, end, value):
self.assertLess(start, end)
self.assertLess(value, end)
self.assertGreater(value, start)
@file_data('test_data_dict.json')
- def test_file_data_dict(self, value):
+ def test_file_data_json_dict(self, value):
self.assertTrue(has_three_elements(value))
@file_data('test_data_list.json')
- def test_file_data_list(self, value):
+ def test_file_data_json_list(self, value):
+ self.assertTrue(is_a_greeting(value))
+
+ @needs_yaml
+ @file_data("test_data_dict_dict.yaml")
+ def test_file_data_yaml_dict_dict(self, start, end, value):
+ self.assertLess(start, end)
+ self.assertLess(value, end)
+ self.assertGreater(value, start)
+
+ @needs_yaml
+ @file_data('test_data_dict.yaml')
+ def test_file_data_yaml_dict(self, value):
+ self.assertTrue(has_three_elements(value))
+
+ @needs_yaml
+ @file_data('test_data_list.yaml')
+ def test_file_data_yaml_list(self, value):
self.assertTrue(is_a_greeting(value))
@data((3, 2), (4, 3), (5, 3))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ddt-1.0.1/test/test_functional.py new/ddt-1.1.0/test/test_functional.py
--- old/ddt-1.0.1/test/test_functional.py 2015-11-18 23:03:46.000000000 +0100
+++ new/ddt-1.1.0/test/test_functional.py 2016-05-31 09:26:09.000000000 +0200
@@ -2,9 +2,14 @@
import json
import six
+import mock
from ddt import ddt, data, file_data
-from nose.tools import assert_equal, assert_is_not_none, assert_raises
+from nose.tools import (
+ assert_true, assert_equal, assert_is_not_none, assert_raises
+)
+
+from test.mycode import has_three_elements
@ddt
@@ -42,7 +47,7 @@
@ddt
-class FileDataMissingDummy(object):
+class JSONFileDataMissingDummy(object):
"""
Dummy class to test the file_data decorator on when
JSON file is missing
@@ -53,6 +58,18 @@
return value
+@ddt
+class YAMLFileDataMissingDummy(object):
+ """
+ Dummy class to test the file_data decorator on when
+ YAML file is missing
+ """
+
+ @file_data("test_data_dict_missing.yaml")
+ def test_something_again(self, value):
+ return value
+
+
def test_data_decorator():
"""
Test the ``data`` method decorator
@@ -96,14 +113,15 @@
assert_equal(getattr(data_hello, extra_attr), ("test_data_dict.json",))
-is_test = lambda x: x.startswith('test_')
+def _is_test(x):
+ return x.startswith('test_')
def test_ddt():
"""
Test the ``ddt`` class decorator
"""
- tests = len(list(filter(is_test, Dummy.__dict__)))
+ tests = len(list(filter(_is_test, Dummy.__dict__)))
assert_equal(tests, 4)
@@ -112,7 +130,7 @@
Test that the ``file_data`` decorator creates two tests
"""
- tests = len(list(filter(is_test, FileDataDummy.__dict__)))
+ tests = len(list(filter(_is_test, FileDataDummy.__dict__)))
assert_equal(tests, 2)
@@ -124,7 +142,7 @@
when it is parsed as a dictionary.
"""
- tests = set(filter(is_test, FileDataDummy.__dict__))
+ tests = set(filter(_is_test, FileDataDummy.__dict__))
tests_dir = os.path.dirname(__file__)
test_data_path = os.path.join(tests_dir, 'test_data_dict.json')
@@ -141,7 +159,7 @@
"""
Test that data is fed to the decorated tests
"""
- tests = filter(is_test, Dummy.__dict__)
+ tests = filter(_is_test, Dummy.__dict__)
values = []
obj = Dummy()
@@ -156,7 +174,7 @@
"""
Test that data is fed to the decorated tests from a file
"""
- tests = filter(is_test, FileDataDummy.__dict__)
+ tests = filter(_is_test, FileDataDummy.__dict__)
values = []
obj = FileDataDummy()
@@ -169,11 +187,23 @@
def test_feed_data_file_data_missing_json():
"""
- Test that a ValueError is raised
+ Test that a ValueError is raised when JSON file is missing
+ """
+ tests = filter(_is_test, JSONFileDataMissingDummy.__dict__)
+
+ obj = JSONFileDataMissingDummy()
+ for test in tests:
+ method = getattr(obj, test)
+ assert_raises(ValueError, method)
+
+
+def test_feed_data_file_data_missing_yaml():
+ """
+ Test that a ValueError is raised when YAML file is missing
"""
- tests = filter(is_test, FileDataMissingDummy.__dict__)
+ tests = filter(_is_test, YAMLFileDataMissingDummy.__dict__)
- obj = FileDataMissingDummy()
+ obj = YAMLFileDataMissingDummy()
for test in tests:
method = getattr(obj, test)
assert_raises(ValueError, method)
@@ -248,18 +278,18 @@
@ddt
class Mytest(object):
- @data(object)
+ @data(object())
def test_object(self, val):
pass
- assert_is_not_none(getattr(Mytest, 'test_object_1_object'))
+ assert_is_not_none(getattr(Mytest, 'test_object_1'))
def test_feed_data_with_invalid_identifier():
"""
Test that data is fed to the decorated tests
"""
- tests = list(filter(is_test, DummyInvalidIdentifier.__dict__))
+ tests = list(filter(_is_test, DummyInvalidIdentifier.__dict__))
assert_equal(len(tests), 1)
obj = DummyInvalidIdentifier()
@@ -269,3 +299,24 @@
'test_data_with_invalid_identifier_1_32v2_g__Gmw845h_W_b53wi_'
)
assert_equal(method(), '32v2 g #Gmw845h$W b53wi.')
+
+
+(a)mock.patch('ddt._have_yaml', False)
+def test_load_yaml_without_yaml_support():
+ """
+ Test that YAML files are not loaded if YAML is not installed.
+ """
+
+ @ddt
+ class NoYAMLInstalledTest(object):
+
+ @file_data('test_data_dict.yaml')
+ def test_file_data_yaml_dict(self, value):
+ assert_true(has_three_elements(value))
+
+ tests = filter(_is_test, NoYAMLInstalledTest.__dict__)
+
+ obj = NoYAMLInstalledTest()
+ for test in tests:
+ method = getattr(obj, test)
+ assert_raises(ValueError, method)
1
0
Hello community,
here is the log from the commit of package python-rfc3986 for openSUSE:Factory checked in at 2016-09-01 14:03:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-rfc3986 (Old)
and /work/SRC/openSUSE:Factory/.python-rfc3986.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-rfc3986"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-rfc3986/python-rfc3986.changes 2016-08-18 09:17:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-rfc3986.new/python-rfc3986.changes 2016-09-01 14:03:42.000000000 +0200
@@ -1,0 +2,19 @@
+Wed Aug 31 10:44:29 UTC 2016 - tbechtold(a)suse.com
+
+- update to 0.4.1:
+ - Normalize URIs constructed using ``ParseResult.from_parts`` and
+ ``ParseResultBytes.from_parts``
+ - Add ``ParseResult.from_parts`` and ``ParseResultBytes.from_parts`` class
+ methods to easily create a ParseResult
+ - When using regular expressions, use ``[0-9]`` instead of ``\d`` to avoid
+ finding ports with "numerals" that are not valid in a port
+ - Preserve empty query strings during normalization
+ - Read README and HISTORY files using the appropriate codec so rfc3986 can be
+ installed on systems with locale's other than utf-8 (specifically C)
+ - Replace the standard library's urlparse behaviour
+ - Update the regular name regular expression to accept all of the characters
+ allowed in the RFC. Closes bug #11 (Thanks Viktor Haag). Previously URIs
+ similar to "http://http-bin.org" would be considered invalid.
+- Use pypi.io for Source url
+
+-------------------------------------------------------------------
Old:
----
rfc3986-0.2.0.tar.gz
New:
----
rfc3986-0.4.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-rfc3986.spec ++++++
--- /var/tmp/diff_new_pack.gVSUE7/_old 2016-09-01 14:03:43.000000000 +0200
+++ /var/tmp/diff_new_pack.gVSUE7/_new 2016-09-01 14:03:43.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-rfc3986
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,13 @@
Name: python-rfc3986
-Version: 0.2.0
+Version: 0.4.1
Release: 0
Summary: Validating URI References per RFC 3986
License: Apache-2.0
Group: Development/Languages/Python
Url: https://rfc3986.rtfd.org
-Source: https://pypi.python.org/packages/source/r/rfc3986/rfc3986-%{version}.tar.gz
+Source: https://pypi.io/packages/source/r/rfc3986/rfc3986-%{version}.tar.gz
BuildRequires: python-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
++++++ rfc3986-0.2.0.tar.gz -> rfc3986-0.4.1.tar.gz ++++++
++++ 2359 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package git-cola for openSUSE:Factory checked in at 2016-09-01 14:03:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/git-cola (Old)
and /work/SRC/openSUSE:Factory/.git-cola.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "git-cola"
Changes:
--------
--- /work/SRC/openSUSE:Factory/git-cola/git-cola.changes 2016-08-05 18:17:59.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.git-cola.new/git-cola.changes 2016-09-01 14:03:41.000000000 +0200
@@ -1,0 +2,13 @@
+Wed Aug 31 22:12:28 UTC 2016 - marcin.bajor(a)gmail.com
+
+- Update to 2.8
+- Usability, bells and whistles
+* git cola push learned to configure upstream branches.
+https://github.com/git-cola/git-cola/issues/563
+- Fixes
+* The diffstat view is now properly updated when notifications are received via inotify filesystem monitoring.
+https://github.com/git-cola/git-cola/issues/577
+* Python3 with PyQt5 had a bug that prevented git cola from starting.
+https://github.com/git-cola/git-cola/pull/589
+
+-------------------------------------------------------------------
Old:
----
v2.7.tar.gz
New:
----
v2.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ git-cola.spec ++++++
--- /var/tmp/diff_new_pack.jiP9dW/_old 2016-09-01 14:03:42.000000000 +0200
+++ /var/tmp/diff_new_pack.jiP9dW/_new 2016-09-01 14:03:42.000000000 +0200
@@ -18,8 +18,8 @@
Name: git-cola
-Version: 2.7
-Release: 2
+Version: 2.8
+Release: 0
Summary: Sleek and powerful git GUI
License: GPL-2.0+
Group: Development/Tools/Version Control
++++++ v2.7.tar.gz -> v2.8.tar.gz ++++++
++++ 61364 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package converseen for openSUSE:Factory checked in at 2016-09-01 14:03:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/converseen (Old)
and /work/SRC/openSUSE:Factory/.converseen.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "converseen"
Changes:
--------
--- /work/SRC/openSUSE:Factory/converseen/converseen.changes 2016-03-16 10:33:50.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.converseen.new/converseen.changes 2016-09-01 14:03:39.000000000 +0200
@@ -1,0 +2,8 @@
+Wed Aug 31 19:46:36 UTC 2016 - lazy.kent(a)opensuse.org
+
+- Update to 0.9.5.
+ * Porting to Qt5.
+- Use cmake() build dependencies instead of pkgconfig() for Qt5
+ devel packages.
+
+-------------------------------------------------------------------
Old:
----
converseen-0.9.2.tar.bz2
New:
----
converseen-0.9.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ converseen.spec ++++++
--- /var/tmp/diff_new_pack.C0bTYP/_old 2016-09-01 14:03:41.000000000 +0200
+++ /var/tmp/diff_new_pack.C0bTYP/_new 2016-09-01 14:03:41.000000000 +0200
@@ -17,7 +17,7 @@
Name: converseen
-Version: 0.9.2
+Version: 0.9.5
Release: 0
Summary: Batch Image Conversion Tool
License: GPL-3.0+
@@ -27,13 +27,16 @@
BuildRequires: ImageMagick
BuildRequires: cmake
BuildRequires: hicolor-icon-theme
+BuildRequires: pkgconfig
BuildRequires: update-desktop-files
+BuildRequires: cmake(Qt5Core)
+BuildRequires: cmake(Qt5Gui)
+BuildRequires: cmake(Qt5LinguistTools)
+BuildRequires: cmake(Qt5Network)
+BuildRequires: cmake(Qt5Widgets)
BuildRequires: pkgconfig(Magick++)
BuildRequires: pkgconfig(MagickCore)
BuildRequires: pkgconfig(MagickWand)
-BuildRequires: pkgconfig(QtCore)
-BuildRequires: pkgconfig(QtGui)
-BuildRequires: pkgconfig(QtNetwork)
Recommends: %{name}-lang
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -52,7 +55,7 @@
%lang_package
%prep
-%setup -q
+%setup -q -n %{name}
cp -p README.md README
chmod -x README COPYING
++++++ converseen-0.9.2.tar.bz2 -> converseen-0.9.5.tar.bz2 ++++++
++++ 2585 lines of diff (skipped)
1
0