Example #1
0
def fix_dist():
    # Generate man page
    makeman.make()

    # Add the changelog to the manual
    # print('copying CHANGELOG.txt -> data/manual/Changelog.txt')
    # shutil.copy('CHANGELOG.txt', 'data/manual/Changelog.txt')

    # Copy the zim icons a couple of times
    # Paths for mimeicons taken from xdg-icon-resource
    # xdg-icon-resource installs:
    # /usr/local/share/icons/hicolor/.../mimetypes/gnome-mime-application-x-zim-notebook.png
    # /usr/local/share/icons/hicolor/.../mimetypes/application-x-zim-notebook.png
    # /usr/local/share/icons/hicolor/.../apps/zim.png

    if os.path.exists('xdg/hicolor'):
        shutil.rmtree('xdg/hicolor')
    os.makedirs('xdg/hicolor/scalable/apps')
    os.makedirs('xdg/hicolor/scalable/mimetypes')
    for name in ('apps/zim.svg',
                 'mimetypes/gnome-mime-application-x-zim-notebook.svg',
                 'mimetypes/application-x-zim-notebook.svg'):
        shutil.copy('icons/zim48.svg', 'xdg/hicolor/scalable/' + name)
    for size in ('16', '22', '24', '32', '48'):
        dir = size + 'x' + size
        os.makedirs('xdg/hicolor/%s/apps' % dir)
        os.makedirs('xdg/hicolor/%s/mimetypes' % dir)
        for name in ('apps/zim.png',
                     'mimetypes/gnome-mime-application-x-zim-notebook.png',
                     'mimetypes/application-x-zim-notebook.png'):
            shutil.copy('icons/zim%s.png' % size,
                        'xdg/hicolor/' + dir + '/' + name)
Example #2
0
def fix_dist():
    # Try to update version info
    if os.path.exists(".bzr/"):
        print "updating bzr version-info..."
        os.system("bzr version-info --format python > zim/_version.py")

        # Generate man page
    makeman.make()
Example #3
0
def fix_dist():
	# Try to update version info
	if os.path.exists('.bzr/'):
		print 'updating bzr version-info...'
		os.system('bzr version-info --format python > zim/_version.py')

	# Generate man page
	makeman.make()

	# Add the changelog to the manual
	# print 'copying CHANGELOG.txt -> data/manual/Changelog.txt'
	# shutil.copy('CHANGELOG.txt', 'data/manual/Changelog.txt')

	# Copy the zim icons a couple of times
	# Paths for mimeicons taken from xdg-icon-resource
	# xdg-icon-resource installs:
	# /usr/local/share/icons/hicolor/.../mimetypes/gnome-mime-application-x-zim-notebook.png
	# /usr/local/share/icons/hicolor/.../mimetypes/application-x-zim-notebook.png
	# /usr/local/share/icons/hicolor/.../apps/zim.png

	if os.path.exists('xdg/hicolor'):
		shutil.rmtree('xdg/hicolor')
	os.makedirs('xdg/hicolor/scalable/apps')
	os.makedirs('xdg/hicolor/scalable/mimetypes')
	for name in (
		'apps/zim.svg',
		'mimetypes/gnome-mime-application-x-zim-notebook.svg',
		'mimetypes/application-x-zim-notebook.svg'
	):
		shutil.copy('icons/zim48.svg', 'xdg/hicolor/scalable/' + name)
	for size in ('16', '22', '24', '32', '48'):
		dir = size + 'x' + size
		os.makedirs('xdg/hicolor/%s/apps' % dir)
		os.makedirs('xdg/hicolor/%s/mimetypes' % dir)
		for name in (
			'apps/zim.png',
			'mimetypes/gnome-mime-application-x-zim-notebook.png',
			'mimetypes/application-x-zim-notebook.png'
		):
			shutil.copy('icons/zim%s.png' % size, 'xdg/hicolor/'  + dir + '/' + name)