* src/plugins/GraphViz.py: launch image viewer in Windows.
* src/Mime/_WinMime.py: handle rundll32.exe applications. * src/Utils.py: search path in Windows when looking for applications. svn: r7055
This commit is contained in:
parent
bf1d752f01
commit
75fe94b45a
@ -1,3 +1,8 @@
|
|||||||
|
2006-07-21 Brian Matherly <brian@gramps-project.org>
|
||||||
|
* src/plugins/GraphViz.py: launch image viewer in Windows.
|
||||||
|
* src/Mime/_WinMime.py: handle rundll32.exe applications.
|
||||||
|
* src/Utils.py: search path in Windows when looking for applications.
|
||||||
|
|
||||||
2006-07-21 Don Allingham <don@gramps-project.org>
|
2006-07-21 Don Allingham <don@gramps-project.org>
|
||||||
* src/DataViews/_RelationView.py: provide number for children/siblings
|
* src/DataViews/_RelationView.py: provide number for children/siblings
|
||||||
* src/GrampsWidgets.py: fix spacing on link box
|
* src/GrampsWidgets.py: fix spacing on link box
|
||||||
|
@ -70,6 +70,9 @@ def get_application(type):
|
|||||||
# Find a friendly name for the application
|
# Find a friendly name for the application
|
||||||
if command.startswith('"'):
|
if command.startswith('"'):
|
||||||
app = command.split('"')[1]
|
app = command.split('"')[1]
|
||||||
|
elif command.startswith('rundll32.exe'):
|
||||||
|
# Get the description of the DLL instead of the application
|
||||||
|
app = command.split()[1].split(',')[0]
|
||||||
else:
|
else:
|
||||||
app = command.split()[0]
|
app = command.split()[0]
|
||||||
|
|
||||||
|
@ -461,6 +461,12 @@ def search_for(name):
|
|||||||
name = name.split('"')[1]
|
name = name.split('"')[1]
|
||||||
else:
|
else:
|
||||||
name = name.split()[0]
|
name = name.split()[0]
|
||||||
|
if os.sys.platform == "win32":
|
||||||
|
for i in os.environ['PATH'].split(';'):
|
||||||
|
fname = os.path.join(i,name)
|
||||||
|
if os.access(fname,os.X_OK) and not os.path.isdir(fname):
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
for i in os.environ['PATH'].split(':'):
|
for i in os.environ['PATH'].split(':'):
|
||||||
fname = os.path.join(i,name)
|
fname = os.path.join(i,name)
|
||||||
if os.access(fname,os.X_OK) and not os.path.isdir(fname):
|
if os.access(fname,os.X_OK) and not os.path.isdir(fname):
|
||||||
|
@ -64,6 +64,8 @@ import const
|
|||||||
from BaseDoc import PAPER_LANDSCAPE
|
from BaseDoc import PAPER_LANDSCAPE
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
import Errors
|
import Errors
|
||||||
|
import Utils
|
||||||
|
import Mime
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -124,11 +126,11 @@ class _options:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if os.sys.platform == "win32":
|
if os.sys.platform == "win32":
|
||||||
_dot_found = os.system("dot -V 2>nul") == 0
|
_dot_found = Utils.search_for("dot.exe")
|
||||||
else:
|
else:
|
||||||
_dot_found = os.system("dot -V 2>/dev/null") == 0
|
_dot_found = Utils.search_for("dot")
|
||||||
|
|
||||||
if os.system("which epstopdf >/dev/null 2>&1") == 0:
|
if Utils.search_for("epstopdf") == 1:
|
||||||
_options.formats += (("pdf", "PDF", _("PDF"), "application/pdf"),)
|
_options.formats += (("pdf", "PDF", _("PDF"), "application/pdf"),)
|
||||||
_pdf_pipe = 'epstopdf -f -o=%s'
|
_pdf_pipe = 'epstopdf -f -o=%s'
|
||||||
|
|
||||||
@ -1025,11 +1027,7 @@ class FormatComboBox(gtk.ComboBox):
|
|||||||
def get_printable(self):
|
def get_printable(self):
|
||||||
_apptype = _options.formats[self.get_active()][3]
|
_apptype = _options.formats[self.get_active()][3]
|
||||||
print_label = None
|
print_label = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import Utils
|
|
||||||
import Mime
|
|
||||||
|
|
||||||
mprog = Mime.get_application(_apptype)
|
mprog = Mime.get_application(_apptype)
|
||||||
|
|
||||||
if Utils.search_for(mprog[0]):
|
if Utils.search_for(mprog[0]):
|
||||||
@ -1087,8 +1085,6 @@ class GraphicsFormatComboBox(gtk.ComboBox):
|
|||||||
_apptype = _options.formats[self.get_active()][3]
|
_apptype = _options.formats[self.get_active()][3]
|
||||||
print_label = None
|
print_label = None
|
||||||
try:
|
try:
|
||||||
import Utils
|
|
||||||
import Mime
|
|
||||||
mprog = Mime.get_application(_apptype)
|
mprog = Mime.get_application(_apptype)
|
||||||
if Utils.search_for(mprog[0]):
|
if Utils.search_for(mprog[0]):
|
||||||
print_label = _("Open in %(program_name)s") % { 'program_name':
|
print_label = _("Open in %(program_name)s") % { 'program_name':
|
||||||
@ -1174,12 +1170,8 @@ class GraphVizGraphics(Report):
|
|||||||
break
|
break
|
||||||
if _apptype:
|
if _apptype:
|
||||||
try:
|
try:
|
||||||
import Utils
|
|
||||||
import Mime
|
|
||||||
|
|
||||||
app = Mime.get_application(_apptype)
|
app = Mime.get_application(_apptype)
|
||||||
os.environ["FILE"] = self.user_output
|
Utils.launch(app[0],self.user_output)
|
||||||
os.system ('%s "$FILE" &' % app[0])
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -1191,11 +1183,8 @@ class GraphVizGraphics(Report):
|
|||||||
break
|
break
|
||||||
if _apptype:
|
if _apptype:
|
||||||
try:
|
try:
|
||||||
import Utils
|
|
||||||
import Mime
|
|
||||||
app = Mime.get_application(_apptype)
|
app = Mime.get_application(_apptype)
|
||||||
os.environ["FILE"] = self.user_output
|
Utils.launch(app[0],self.user_output)
|
||||||
os.system ('%s "$FILE" &' % app[0])
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user