* GrampsMime.py: added mime types
* grampslib_wrap.c: removed * various: more undo functionality svn: r3074
This commit is contained in:
@@ -37,7 +37,7 @@ import BaseDoc
|
||||
import Errors
|
||||
import Plugins
|
||||
import ImgManip
|
||||
import grampslib
|
||||
import GrampsMime
|
||||
|
||||
from latin_utf8 import latin_to_utf8
|
||||
from gettext import gettext as _
|
||||
@@ -179,9 +179,12 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'application/x-abiword'
|
||||
app = grampslib.default_application_command(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
try:
|
||||
app = GrampsMime.get_application(apptype)[0]
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
except:
|
||||
pass
|
||||
|
||||
def add_media_object(self,name,pos,x_cm,y_cm):
|
||||
|
||||
@@ -311,14 +314,16 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
print_label = None
|
||||
try:
|
||||
import Utils
|
||||
import Utils
|
||||
|
||||
prog = grampslib.default_application_command("application/x-abiword")
|
||||
if Utils.search_for(prog):
|
||||
print_label=_("Open in AbiWord")
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
prog = GrampsMime.get_application("application/x-abiword")
|
||||
type = GrampsMime.get_description('application/x-abiword')
|
||||
|
||||
Plugins.register_text_doc(_("AbiWord"),AbiWordDoc,1,1,1,".abw", print_label)
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s" % prog[1])
|
||||
else:
|
||||
print_label=None
|
||||
Plugins.register_text_doc(type,AbiWordDoc,1,1,1,".abw", print_label)
|
||||
except:
|
||||
Plugins.register_text_doc('AbiWord document',AbiWordDoc,1,1,1,".abw", None)
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#------------------------------------------------------------------------
|
||||
import string
|
||||
import os
|
||||
import GrampsMime
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -128,12 +129,10 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
self.f.close()
|
||||
|
||||
if self.print_req:
|
||||
import grampslib
|
||||
|
||||
apptype = 'text/plain'
|
||||
prog = grampslib.default_application_command(apptype)
|
||||
prog = GrampsMime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % prog)
|
||||
os.system ('%s "$FILE" &' % prog[0])
|
||||
|
||||
def get_usable_width(self):
|
||||
return _WIDTH_IN_CHARS
|
||||
@@ -358,14 +357,17 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
#------------------------------------------------------------------------
|
||||
print_label = None
|
||||
try:
|
||||
import grampslib
|
||||
import Utils
|
||||
|
||||
prog = grampslib.default_application_command("text/plain")
|
||||
desc = grampslib.default_application_name("text/plain")
|
||||
if Utils.search_for(prog):
|
||||
print_label=_("Open in %s") % desc
|
||||
except:
|
||||
pass
|
||||
prog = GrampsMime.get_application("text/plain")
|
||||
type = GrampsMime.get_description('text/plain')
|
||||
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s" % prog[1])
|
||||
else:
|
||||
print_label=None
|
||||
|
||||
Plugins.register_text_doc(type,AsciiDoc,1,1,1,".txt", print_label)
|
||||
except:
|
||||
Plugins.register_text_doc("Plain Text",AsciiDoc,1,1,1,".txt", None)
|
||||
|
||||
Plugins.register_text_doc(_("Plain Text"),AsciiDoc,1,1,1,".txt", print_label)
|
||||
|
@@ -33,7 +33,7 @@ import const
|
||||
import Errors
|
||||
import BaseDoc
|
||||
import QuestionDialog
|
||||
import grampslib
|
||||
import GrampsMime
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
@@ -336,9 +336,9 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'text/html'
|
||||
app = grampslib.default_application_command(apptype)
|
||||
app = GrampsMime.get_application_(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
def write_support_files(self):
|
||||
if self.map:
|
||||
@@ -477,15 +477,16 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
prog = grampslib.default_application_command("text/html")
|
||||
desc = grampslib.default_application_name("text/html")
|
||||
if Utils.search_for(prog):
|
||||
print_label=_("Open in %s") % desc
|
||||
prog = GrampsMime.get_application("text/html")
|
||||
type = GrampsMime.get_description("text/html")
|
||||
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
else:
|
||||
print_label=None
|
||||
Plugins.register_text_doc(type,HtmlDoc,1,0,1,".html", print_label)
|
||||
except:
|
||||
pass
|
||||
|
||||
Plugins.register_text_doc(_("HTML"),HtmlDoc,1,0,1,".html", print_label)
|
||||
Plugins.register_text_doc('HTML',HtmlDoc,1,0,1,".html", None)
|
||||
|
@@ -33,7 +33,7 @@ import Errors
|
||||
from TarFile import TarFile
|
||||
import Plugins
|
||||
import ImgManip
|
||||
import grampslib
|
||||
import GrampsMime
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
@@ -264,9 +264,9 @@ class KwordDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'application/x-kword'
|
||||
app = grampslib.default_application_command(apptype)
|
||||
app = GrampsMime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
def start_paragraph(self,style_name,leader=None):
|
||||
self.format_list = []
|
||||
@@ -485,15 +485,17 @@ class KwordDoc(BaseDoc.BaseDoc):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
prog = grampslib.default_application_command("application/x-kword")
|
||||
desc = grampslib.default_application_name("application/x-kword")
|
||||
if Utils.search_for(prog):
|
||||
print_label=_("Open in %s") % desc
|
||||
|
||||
prog = GrampsMime.get_application("application/x-kword")
|
||||
type = GrampsMime.get_description("application/x-kword")
|
||||
|
||||
if prog and Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
else:
|
||||
print_label=None
|
||||
Plugins.register_text_doc(type, KwordDoc, 1, 0, 1, ".kwd", print_label)
|
||||
except:
|
||||
pass
|
||||
Plugins.register_text_doc('KWord', KwordDoc, 1, 0, 1, ".kwd", print_label)
|
||||
|
||||
Plugins.register_text_doc(_("KWord"),KwordDoc,1,1,1,".kwd")
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.6.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -17,95 +17,102 @@
|
||||
# This is the src/docgen level Makefile for Gramps
|
||||
# Use GNU make's ':=' syntax for nice wildcard use.
|
||||
# If not using GNU make, then list all .py files individually
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BINSH = @BINSH@
|
||||
CC = @CC@
|
||||
DEPDIR = @DEPDIR@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
GNOMEHELP = @GNOMEHELP@
|
||||
GNOMEINC = @GNOMEINC@
|
||||
GNOMELIB = @GNOMELIB@
|
||||
GPREFIX = @GPREFIX@
|
||||
HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@
|
||||
ICONV = @ICONV@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LANGUAGES = @LANGUAGES@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
MSGCONV = @MSGCONV@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POFILES = @POFILES@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RELEASE = @RELEASE@
|
||||
SCROLLKEEPER_BUILD_REQUIRED = @SCROLLKEEPER_BUILD_REQUIRED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SK_CONFIG = @SK_CONFIG@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
VERSIONSTRING = @VERSIONSTRING@
|
||||
ZIP = @ZIP@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/docgen
|
||||
pkgpythondir = @pkgpythondir@/docgen
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
||||
pkgpython_PYTHON = \
|
||||
AbiWord2Doc.py\
|
||||
@@ -124,11 +131,12 @@ pkgpython_PYTHON = \
|
||||
|
||||
GRAMPS_PY_MODPATH = "../"
|
||||
subdir = src/docgen
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
py_compile = $(top_srcdir)/py-compile
|
||||
DIST_COMMON = $(pkgpython_PYTHON) Makefile.am Makefile.in
|
||||
DIST_COMMON = $(pkgpython_PYTHON) $(srcdir)/Makefile.in Makefile.am
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -143,11 +151,12 @@ install-pkgpythonPYTHON: $(pkgpython_PYTHON)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgpythondir)
|
||||
@list='$(pkgpython_PYTHON)'; dlist=''; for p in $$list; do\
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
|
||||
if test -f $$b$$p; then \
|
||||
d=`echo "$$p" | sed -e 's,^.*/,,'`; \
|
||||
dlist="$$dlist $$d"; \
|
||||
echo " $(pkgpythonPYTHON_INSTALL) $(srcdir)/$$p $(DESTDIR)$(pkgpythondir)/$$d"; \
|
||||
$(pkgpythonPYTHON_INSTALL) $(srcdir)/$$p $(DESTDIR)$(pkgpythondir)/$$d; \
|
||||
echo " $(pkgpythonPYTHON_INSTALL) $$b$$p $(DESTDIR)$(pkgpythondir)/$$d"; \
|
||||
$(pkgpythonPYTHON_INSTALL) $$b$$p $(DESTDIR)$(pkgpythondir)/$$d; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(pkgpythondir) $$dlist
|
||||
@@ -163,13 +172,22 @@ uninstall-pkgpythonPYTHON:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ../..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@list='$(DISTFILES)'; for file in $$list; do \
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
@@ -195,7 +213,6 @@ all-am: Makefile
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgpythondir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
@@ -215,7 +232,7 @@ mostlyclean-generic:
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@@ -225,7 +242,7 @@ clean: clean-am
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
@@ -247,13 +264,21 @@ install-man:
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-pkgpythonPYTHON
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
@@ -262,8 +287,8 @@ uninstall-am: uninstall-info-am uninstall-pkgpythonPYTHON
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-pkgpythonPYTHON install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
uninstall uninstall-am uninstall-info-am \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-pkgpythonPYTHON
|
||||
|
||||
|
||||
|
@@ -43,7 +43,7 @@ import const
|
||||
import Plugins
|
||||
import ImgManip
|
||||
import FontScale
|
||||
import grampslib
|
||||
import GrampsMime
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -365,9 +365,9 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
self._write_meta_file()
|
||||
self._write_zip()
|
||||
if self.print_req:
|
||||
app = grampslib.default_application_command(_apptype)
|
||||
app = GrampsMime.get_application(_apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
def add_media_object(self,name,pos,x_cm,y_cm):
|
||||
|
||||
@@ -968,33 +968,23 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
# Register plugins
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
prog = grampslib.default_application_command(_apptype)
|
||||
prog = GrampsMime.get_application(_apptype)
|
||||
type = GrampsMime.get_description(_apptype)
|
||||
|
||||
if Utils.search_for(prog):
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label = _("Open in OpenOffice.org")
|
||||
except:
|
||||
pass
|
||||
|
||||
Plugins.register_text_doc(
|
||||
_("OpenOffice.org Writer"),
|
||||
OpenOfficeDoc,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
".sxw",
|
||||
print_label)
|
||||
else:
|
||||
print_label = None
|
||||
|
||||
Plugins.register_text_doc(type,OpenOfficeDoc,1,1,1,".sxw", print_label)
|
||||
Plugins.register_book_doc(type,OpenOfficeDoc,1,1,1,".sxw")
|
||||
except:
|
||||
Plugins.register_text_doc('OpenOffice.org Writer', OpenOfficeDoc,1,1,1,".sxw", None)
|
||||
Plugins.register_book_doc("OpenOffice.org Writer", OpenOfficeDoc,1,1,1,".sxw")
|
||||
|
||||
Plugins.register_book_doc(
|
||||
_("OpenOffice.org Writer"),
|
||||
OpenOfficeDoc,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
".sxw")
|
||||
|
||||
Plugins.register_draw_doc(
|
||||
_("OpenOffice.org Draw"),
|
||||
|
@@ -30,7 +30,7 @@ import Plugins
|
||||
import Errors
|
||||
import ImgManip
|
||||
import FontScale
|
||||
import grampslib
|
||||
import GrampsMime
|
||||
from gettext import gettext as _
|
||||
|
||||
_H = 'Helvetica'
|
||||
@@ -187,9 +187,9 @@ class PdfDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'application/pdf'
|
||||
app = grampslib.default_application_command(apptype)
|
||||
app = GrampsMime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
def page_break(self):
|
||||
self.story.append(PageBreak())
|
||||
@@ -584,31 +584,18 @@ print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
prog = grampslib.default_application_command("application/pdf")
|
||||
desc = grampslib.default_application_name("application/pdf")
|
||||
if Utils.search_for(prog):
|
||||
print_label=_("Open in %s") % desc
|
||||
prog = GrampsMime.get_application("application/pdf")
|
||||
type = GrampsMime.get_description("application/pdf")
|
||||
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
else:
|
||||
print_label=None
|
||||
Plugins.register_text_doc(type, PdfDoc, 1, 0, 1, ".html", print_label)
|
||||
Plugins.register_draw_doc(type, PdfDoc, 1, 1, ".pdf", print_label)
|
||||
except:
|
||||
pass
|
||||
|
||||
Plugins.register_draw_doc(
|
||||
_("PDF"),
|
||||
PdfDoc,
|
||||
1,
|
||||
1,
|
||||
".pdf",
|
||||
print_label
|
||||
)
|
||||
|
||||
Plugins.register_text_doc(
|
||||
name=_("PDF"),
|
||||
classref=PdfDoc,
|
||||
table=1,
|
||||
paper=1,
|
||||
style=1,
|
||||
ext=".pdf",
|
||||
print_report_label=print_label
|
||||
)
|
||||
Plugins.register_text_doc('PDF document', PdflDoc, 1, 0, 1,".pdf", None)
|
||||
Plugins.register_draw_doc('PDF document', PdfDoc, 1, 1, ".pdf", None)
|
||||
|
||||
Plugins.register_book_doc(
|
||||
name=_("PDF"),
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#------------------------------------------------------------------------
|
||||
import string
|
||||
import os
|
||||
import GrampsMime
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -126,12 +127,10 @@ class RTFDoc(BaseDoc.BaseDoc):
|
||||
self.f.close()
|
||||
|
||||
if self.print_req:
|
||||
import grampslib
|
||||
|
||||
apptype = 'application/rtf'
|
||||
prog = grampslib.default_application_command(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % prog)
|
||||
os.system ('%s "$FILE" &' % prog[0])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
#
|
||||
@@ -416,16 +415,17 @@ class RTFDoc(BaseDoc.BaseDoc):
|
||||
# Register the document generator with the GRAMPS plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
print_label = None
|
||||
|
||||
try:
|
||||
import grampslib
|
||||
import Utils
|
||||
|
||||
prog = GrampsMime.get_application("application/rtf")
|
||||
type = GrampsMime.description("application/rtf")
|
||||
|
||||
prog = grampslib.default_application_command("application/rtf")
|
||||
desc = grampslib.default_application_name("application/rtf")
|
||||
if Utils.search_for(prog):
|
||||
print_label=_("Open in %s") % desc
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
else:
|
||||
print_label=None
|
||||
Plugins.register_text_doc(type, RTFDoc, 1, 0, 1, ".rtf", print_label)
|
||||
except:
|
||||
pass
|
||||
|
||||
Plugins.register_text_doc(_("Rich Text Format (RTF)"),RTFDoc,1,1,1,".rtf", print_label)
|
||||
Plugins.register_text_doc('RTF document', RTFDoc, 1, 0, 1, ".rtf", print_label)
|
||||
|
Reference in New Issue
Block a user