add .pdf to filename, if needed

svn: r18521
This commit is contained in:
Paul Franklin 2011-11-28 04:21:35 +00:00
parent f05ce32f6f
commit 0c6834c365

View File

@ -6,6 +6,7 @@
# Copyright (C) 2009 Brian Matherly # Copyright (C) 2009 Brian Matherly
# Copyright (C) 2010 Peter Landgren # Copyright (C) 2010 Peter Landgren
# Copyright (C) 2010 Jakim Friant # Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Paul Franklin
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -1224,6 +1225,8 @@ class CairoDoc(BaseDoc, TextDoc, DrawDoc):
# BaseDoc implementation # BaseDoc implementation
def open(self, filename): def open(self, filename):
if filename[-4:] != '.pdf':
filename = filename + '.pdf'
self._backend = CairoBackend(filename) self._backend = CairoBackend(filename)
self._doc = GtkDocDocument() self._doc = GtkDocDocument()
self._active_element = self._doc self._active_element = self._doc