Show More
@@ -21,6 +21,9 b' def save_svg(string, parent=None):' | |||
|
21 | 21 | The name of the file to which the document was saved, or None if the save |
|
22 | 22 | was cancelled. |
|
23 | 23 | """ |
|
24 | if isinstance(string, unicode): | |
|
25 | string = string.encode('utf-8') | |
|
26 | ||
|
24 | 27 | dialog = QtGui.QFileDialog(parent, 'Save SVG Document') |
|
25 | 28 | dialog.setAcceptMode(QtGui.QFileDialog.AcceptSave) |
|
26 | 29 | dialog.setDefaultSuffix('svg') |
@@ -29,7 +32,7 b' def save_svg(string, parent=None):' | |||
|
29 | 32 | filename = dialog.selectedFiles()[0] |
|
30 | 33 | f = open(filename, 'w') |
|
31 | 34 | try: |
|
32 |
f.write(string |
|
|
35 | f.write(string) | |
|
33 | 36 | finally: |
|
34 | 37 | f.close() |
|
35 | 38 | return filename |
General Comments 0
You need to be logged in to leave comments.
Login now