Add Mime package
svn: r6047
This commit is contained in:
@@ -36,7 +36,7 @@ import BaseDoc
|
||||
import Errors
|
||||
import PluginMgr
|
||||
import ImgManip
|
||||
import GrampsMime
|
||||
import Mime
|
||||
import Utils
|
||||
|
||||
from gettext import gettext as _
|
||||
@@ -179,7 +179,7 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
if self.print_req:
|
||||
apptype = 'application/x-abiword'
|
||||
try:
|
||||
app = GrampsMime.get_application(apptype)[0]
|
||||
app = Mime.get_application(apptype)[0]
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
except:
|
||||
@@ -326,8 +326,8 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
try:
|
||||
prog = GrampsMime.get_application("application/x-abiword")
|
||||
mtype = GrampsMime.get_description('application/x-abiword')
|
||||
prog = Mime.get_application("application/x-abiword")
|
||||
mtype = Mime.get_description('application/x-abiword')
|
||||
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
|
@@ -36,7 +36,7 @@ from gettext import gettext as _
|
||||
import BaseDoc
|
||||
import PluginMgr
|
||||
import Errors
|
||||
import GrampsMime
|
||||
import Mime
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -153,7 +153,7 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'text/plain'
|
||||
prog = GrampsMime.get_application(apptype)
|
||||
prog = Mime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % prog[0])
|
||||
|
||||
@@ -383,8 +383,8 @@ print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
mprog = GrampsMime.get_application("text/plain")
|
||||
mtype = GrampsMime.get_description('text/plain')
|
||||
mprog = Mime.get_application("text/plain")
|
||||
mtype = Mime.get_description('text/plain')
|
||||
|
||||
if Utils.search_for(mprog[0]):
|
||||
print_label=_("Open in %s") % mprog[1]
|
||||
|
@@ -42,7 +42,7 @@ import const
|
||||
import Errors
|
||||
import BaseDoc
|
||||
import QuestionDialog
|
||||
import GrampsMime
|
||||
import Mime
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -356,7 +356,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'text/html'
|
||||
app = GrampsMime.get_application(apptype)
|
||||
app = Mime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
@@ -499,8 +499,8 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
try:
|
||||
import Utils
|
||||
|
||||
prog = GrampsMime.get_application("text/html")
|
||||
mtype = GrampsMime.get_description("text/html")
|
||||
prog = Mime.get_application("text/html")
|
||||
mtype = Mime.get_description("text/html")
|
||||
|
||||
if Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
|
@@ -31,7 +31,7 @@ import Errors
|
||||
from TarFile import TarFile
|
||||
import PluginMgr
|
||||
import ImgManip
|
||||
import GrampsMime
|
||||
import Mime
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
@@ -263,7 +263,7 @@ class KwordDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'application/x-kword'
|
||||
app = GrampsMime.get_application(apptype)
|
||||
app = Mime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
@@ -488,8 +488,8 @@ class KwordDoc(BaseDoc.BaseDoc):
|
||||
try:
|
||||
import Utils
|
||||
|
||||
prog = GrampsMime.get_application("application/x-kword")
|
||||
mtype = GrampsMime.get_description("application/x-kword")
|
||||
prog = Mime.get_application("application/x-kword")
|
||||
mtype = Mime.get_description("application/x-kword")
|
||||
|
||||
if prog and Utils.search_for(prog[0]):
|
||||
print_label=_("Open in %s") % prog[1]
|
||||
|
@@ -44,7 +44,7 @@ import const
|
||||
import PluginMgr
|
||||
import ImgManip
|
||||
import FontScale
|
||||
import GrampsMime
|
||||
import Mime
|
||||
from ReportUtils import pt2cm
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -417,7 +417,7 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
self._write_mimetype_file()
|
||||
self._write_zip()
|
||||
if self.print_req:
|
||||
app = GrampsMime.get_application(_apptype)
|
||||
app = Mime.get_application(_apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
@@ -1132,8 +1132,8 @@ print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
mprog = GrampsMime.get_application(_apptype)
|
||||
mtype = GrampsMime.get_description(_apptype)
|
||||
mprog = Mime.get_application(_apptype)
|
||||
mtype = Mime.get_description(_apptype)
|
||||
|
||||
if Utils.search_for(mprog[0]):
|
||||
print_label = _("Open in %(program_name)s") % { 'program_name':
|
||||
|
@@ -43,7 +43,7 @@ import const
|
||||
import PluginMgr
|
||||
import ImgManip
|
||||
import FontScale
|
||||
import GrampsMime
|
||||
import Mime
|
||||
import Utils
|
||||
from ReportUtils import pt2cm
|
||||
|
||||
@@ -381,7 +381,7 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
self._write_meta_file()
|
||||
self._write_zip()
|
||||
if self.print_req:
|
||||
app = GrampsMime.get_application(_apptype)
|
||||
app = Mime.get_application(_apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
@@ -995,8 +995,8 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
print_label = None
|
||||
try:
|
||||
|
||||
mprog = GrampsMime.get_application(_apptype)
|
||||
mtype = GrampsMime.get_description(_apptype)
|
||||
mprog = Mime.get_application(_apptype)
|
||||
mtype = Mime.get_description(_apptype)
|
||||
|
||||
if Utils.search_for(mprog[0]):
|
||||
print_label = _("Open in OpenOffice.org")
|
||||
|
@@ -36,7 +36,7 @@ import BaseDoc
|
||||
import PluginMgr
|
||||
import Errors
|
||||
import ImgManip
|
||||
import GrampsMime
|
||||
import Mime
|
||||
|
||||
_H = 'Helvetica'
|
||||
_HB = 'Helvetica-Bold'
|
||||
@@ -189,7 +189,7 @@ class PdfDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if self.print_req:
|
||||
apptype = 'application/pdf'
|
||||
app = GrampsMime.get_application(apptype)
|
||||
app = Mime.get_application(apptype)
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app[0])
|
||||
|
||||
@@ -631,8 +631,8 @@ print_label = None
|
||||
try:
|
||||
import Utils
|
||||
|
||||
mprog = GrampsMime.get_application("application/pdf")
|
||||
mtype = GrampsMime.get_description("application/pdf")
|
||||
mprog = Mime.get_application("application/pdf")
|
||||
mtype = Mime.get_description("application/pdf")
|
||||
|
||||
if Utils.search_for(mprog[0]):
|
||||
print_label=_("Open in %s") % mprog[1]
|
||||
|
@@ -37,7 +37,7 @@ import BaseDoc
|
||||
import PluginMgr
|
||||
import ImgManip
|
||||
import Errors
|
||||
import GrampsMime
|
||||
import Mime
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -127,7 +127,7 @@ class RTFDoc(BaseDoc.BaseDoc):
|
||||
if self.print_req:
|
||||
apptype = 'application/rtf'
|
||||
try:
|
||||
app = GrampsMime.get_application(apptype)[0]
|
||||
app = Mime.get_application(apptype)[0]
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('%s "$FILE" &' % app)
|
||||
except:
|
||||
@@ -420,8 +420,8 @@ class RTFDoc(BaseDoc.BaseDoc):
|
||||
try:
|
||||
import Utils
|
||||
|
||||
mprog = GrampsMime.get_application("application/rtf")
|
||||
mtype = GrampsMime.get_description("application/rtf")
|
||||
mprog = Mime.get_application("application/rtf")
|
||||
mtype = Mime.get_description("application/rtf")
|
||||
|
||||
if Utils.search_for(mprog[0]):
|
||||
print_label=_("Open in %s") % mprog[1]
|
||||
|
Reference in New Issue
Block a user