New Upstream Snapshot - zim

Ready changes

Summary

Merged new upstream version: 0.75.1+git20221222.1.1dfdc48 (was: 0.75.1).

Resulting package

Built on 2023-01-04T21:11 (took 8m31s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots zim

Lintian Result

Diff

diff --git a/PKG-INFO b/PKG-INFO
index 1ede895..887ba50 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,4 +1,4 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: zim
 Version: 0.75.1
 Summary: Zim desktop wiki
@@ -6,7 +6,6 @@ Home-page: https://www.zim-wiki.org
 Author: Jaap Karssenberg
 Author-email: jaap.karssenberg@gmail.com
 License: GPL v2+
-Description: UNKNOWN
-Platform: UNKNOWN
 Requires: gi
 Requires: xdg
+License-File: LICENSE
diff --git a/data/manual/Help/Config_Files.txt b/data/manual/Help/Config_Files.txt
index a9a172f..4520c3d 100644
--- a/data/manual/Help/Config_Files.txt
+++ b/data/manual/Help/Config_Files.txt
@@ -52,8 +52,8 @@ If you want to change the paths for the portable install, there is a special con
 On macOS the default paths are:
 
 '''
- $XDG_CONFIG_HOME = ~/Application Support/org.zim-wiki.Zim/
- $XDG_DATA_HOME = ~/Application Support/org.zim-wiki.Zim/share/
+ $XDG_CONFIG_HOME = ~/Library/Application Support/org.zim-wiki.Zim/
+ $XDG_DATA_HOME = ~/Library/Application Support/org.zim-wiki.Zim/share/
 '''
 
 ===== Global Config Files =====
diff --git a/debian/changelog b/debian/changelog
index fa1b05f..aef2600 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+zim (0.75.1+git20221222.1.1dfdc48-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 04 Jan 2023 21:07:09 -0000
+
 zim (0.75.1-1) unstable; urgency=medium
 
   [ Raphaël Hertzog ]
diff --git a/man/zim.1 b/man/zim.1
index 1a1bb45..fe1e6d5 100644
--- a/man/zim.1
+++ b/man/zim.1
@@ -1,4 +1,4 @@
-.TH ZIM "1" "October 2022" "zim 0.75.1" "User Commands"
+.TH ZIM "1" "January 2023" "zim 0.75.1" "User Commands"
 .SH NAME
 zim \- A Desktop Wiki Editor
 
diff --git a/tests/export.py b/tests/export.py
index fbe83aa..5baa86d 100644
--- a/tests/export.py
+++ b/tests/export.py
@@ -350,6 +350,29 @@ Some content here
 		self.assertTrue(proxy.content.startswith('<h1>'))
 
 
+class TestPageProxyWithEmptyPage(tests.TestCase):
+
+	# Note: specifically test there are no exceptions here ...
+
+	CONTENT = {
+		'test': ''
+	}
+
+	def runTest(self):
+		from zim.formats import StubLinker
+		notebook = self.setUpNotebook(content=self.CONTENT)
+		page = notebook.get_page(Path('test'))
+		dumper = get_format('html').Dumper()
+		linker = StubLinker()
+		proxy = PageProxy(notebook, page, dumper, linker)
+
+		self.assertEqual(proxy.title, 'test')
+		self.assertEqual(proxy.heading, '')
+		self.assertIsInstance(proxy.body, str)
+		self.assertIsInstance(proxy.content, str)
+
+
+
 class TestPageSelections(tests.TestCase):
 
 	def _test_iface(self, selection):
diff --git a/zim/config/basedirs.py b/zim/config/basedirs.py
index 90a12f0..b7e44f8 100644
--- a/zim/config/basedirs.py
+++ b/zim/config/basedirs.py
@@ -20,7 +20,7 @@ def _split_environ_dir_list(value, default=()):
 		paths = value.split(os.pathsep)
 	else:
 		paths = default
-	return [LocalFolder(p) for p in paths]
+	return [LocalFolder(p) for p in paths if p]
 
 
 ## Initialize config paths
diff --git a/zim/formats/__init__.py b/zim/formats/__init__.py
index 5853a2a..9ab715d 100644
--- a/zim/formats/__init__.py
+++ b/zim/formats/__init__.py
@@ -653,8 +653,8 @@ class ParseTree(object):
 def split_heading_from_parsetree(parsetree, keep_head_token=True):
 	'''Helper function to split the header from a L{ParseTree}
 	Looks for a header at the start of a page and strips empty lines after it.
-	Returns two L{ParseTree} objects: one for the header (can be C{None}) and
-	one for the main body of the content.
+	Returns two L{ParseTree} objects: one for the header and one for the main
+	body of the content - both can be C{None} if they are empty.
 	'''
 	from zim.tokenparser import collect_until_end_token
 
@@ -687,17 +687,17 @@ def split_heading_from_parsetree(parsetree, keep_head_token=True):
 	if body[-1] == (END, FORMATTEDTEXT):
 		body.pop()
 
-	if heading:
-		if not keep_head_token:
-			heading = heading[1:-1]
-			if heading[-1][0] == TEXT:
-				if heading[-1][1] == '\n':
-					heading.pop()
-				elif heading[-1][1].endswith('\n'):
-					heading[-1] = (TEXT, heading[-1][1][:-1])
-		return (ParseTree.new_from_tokens(heading), ParseTree.new_from_tokens(body))
-	else:
-		return (None, ParseTree.new_from_tokens(body))
+	if heading and not keep_head_token:
+		heading = heading[1:-1]
+		if heading[-1][0] == TEXT:
+			if heading[-1][1] == '\n':
+				heading.pop()
+			elif heading[-1][1].endswith('\n'):
+				heading[-1] = (TEXT, heading[-1][1][:-1])
+
+	heading_tree = ParseTree.new_from_tokens(heading) if heading else None
+	body_tree = ParseTree.new_from_tokens(body) if body else None
+	return heading_tree, body_tree
 
 
 class ParseTreeBuilder(Builder):
diff --git a/zim/gui/pageview/__init__.py b/zim/gui/pageview/__init__.py
index 169386f..440404e 100644
--- a/zim/gui/pageview/__init__.py
+++ b/zim/gui/pageview/__init__.py
@@ -23,6 +23,7 @@ from gi.repository import Gdk
 from gi.repository import GdkPixbuf
 from gi.repository import Pango
 
+import os
 import re
 import string
 import weakref
@@ -6567,6 +6568,8 @@ class PageView(GSignalEmitterMixin, Gtk.VBox):
 			self.actiongroup.get_action('edit_object').set_sensitive(False)
 			self.actiongroup.get_action('remove_link').set_sensitive(False)
 
+		self.actiongroup.get_action('move_text').set_sensitive(buffer.get_has_selection())
+
 		# Emit signal if passing through a link
 		link = buffer.get_link_data(iter)
 		if link:
diff --git a/zim/main/ipc.py b/zim/main/ipc.py
index d3cba70..3bc7651 100644
--- a/zim/main/ipc.py
+++ b/zim/main/ipc.py
@@ -8,7 +8,7 @@ between zim instances.
 It provides low level functions to:
 
   1. Dispatching a list of commandline arguments to a socket
-  2. Listening to a socket for commandline arguments. If recieved,
+  2. Listening to a socket for commandline arguments. If received,
 	 a callback is invoked to handle those arguments.
 
 '''
@@ -142,7 +142,7 @@ def dispatch(*args):
 def start_listening(handler):
 	'''Start listening to socket or named pipe for new commandline
 	calls. Also sets current process to be the main process.
-	@param handler: the method to call when new commands are recieveds
+	@param handler: the method to call when new commands are received
 	'''
 	set_in_main_process(True)
 
@@ -182,7 +182,7 @@ def _do_accept(listener, handler, *a):
 	try:
 		conn = listener.accept()
 		args = conn.recv()
-		logger.debug('Recieved remote call: %r', args)
+		logger.debug('Received remote call: %r', args)
 
 		if args == 'CLOSE':
 			conn.send('OK')
diff --git a/zim/plugins/osx_menubar.py b/zim/plugins/osx_menubar.py
index ec8456b..a13d7b2 100644
--- a/zim/plugins/osx_menubar.py
+++ b/zim/plugins/osx_menubar.py
@@ -90,7 +90,7 @@ class OSXMenuBarMainWindowExtension(MainWindowExtension):
 	# This object is created once for each "main window", this means once for
 	# each notebook opened in zim. If this is the first window, also do
 	# global intialization, else just capture the menubar and keep it ourselves.
-	# We hook to the signal that a window has recieved focus and on that signal
+	# We hook to the signal that a window has received focus and on that signal
 	# insert the menubar for that window. So may change often when switching
 	# windows.
 
diff --git a/zim/plugins/pageindex/__init__.py b/zim/plugins/pageindex/__init__.py
index fd31871..63db8ae 100644
--- a/zim/plugins/pageindex/__init__.py
+++ b/zim/plugins/pageindex/__init__.py
@@ -559,7 +559,7 @@ class PageTreeView(BrowserTreeView):
 	def do_drag_data_received(self, dragcontext, x, y, selectiondata, info, time):
 		assert selectiondata.get_target().name() == PAGELIST_TARGET_NAME
 		data = selectiondata.get_data()
-		logger.debug('Drag data recieved: %r', data)
+		logger.debug('Drag data received: %r', data)
 		if data is None or len(data) == 0:
 			data = zim.gui.clipboard._internal_selection_data # HACK issue #390
 			zim.gui.clipboard._internal_selection_data = None
diff --git a/zim/plugins/quicknote.py b/zim/plugins/quicknote.py
index 9dd5e1c..2f3b6ec 100644
--- a/zim/plugins/quicknote.py
+++ b/zim/plugins/quicknote.py
@@ -458,8 +458,8 @@ class QuickNoteDialog(Dialog):
 		page.parse('wiki', text, append=True) # FIXME format hard coded
 		notebook.store_page(page)
 
-	def import_attachments(self, notebook, path, dir):
-		dir = adapt_from_oldfs(fir)
+	def import_attachments(self, notebook, path, from_dir):
+		from_dir = adapt_from_oldfs(from_dir)
 		attachments = notebook.get_attachments_dir(path)
-		for name in dir.list_files():
+		for file in from_dir.list_files():
 			file.copyto(attachments)

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

More details

Full run details