thinkle / gourmet

Gourmet Recipe Manager
GNU General Public License v2.0
338 stars 139 forks source link

[Windows] Cannot import old gourmet XML export on windows #310

Closed ockham closed 10 years ago

ockham commented 11 years ago

Converted from SourceForge issue 1339175, submitted by SourceForge user goweropolis on 2005-10-27 05:24:56 UTC.

Running 0.8.5.12 on Debian (testing branch), importing recipe file from export of same Gourmet Manager version running on WinXP.

Trying to import in RTF and TXT format gives error message directing me to this URL to submit a bug.

Trying to import XML files gives me the following Python error: Traceback (most recent call last): File "/usr/share/gourmet/GourmetThreads.py", line 36, in target_func self.c.run() File "/usr/share/gourmet/importers/importer.py", line 300, in run self.iclass.run() File "/usr/share/gourmet/importers/xml_importer.py", line 59, in run self.parse = xml.sax.parse(self.fn, self.rh) File "/usr/lib/python2.3/xml/sax/init.py", line 33, in parse parser.parse(source) File "/usr/lib/python2.3/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.3/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.3/xml/sax/expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.3/xml/sax/expatreader.py", line 379, in external_entity_ref self._source.getSystemId() or File "/usr/lib/python2.3/xml/sax/saxutils.py", line 292, in prepare_input_source f = urllib.urlopen(source.getSystemId()) File "/usr/lib/python2.3/urllib.py", line 76, in urlopen return opener.open(url) File "/usr/lib/python2.3/urllib.py", line 178, in open return self.open_unknown(fullurl, data) File "/usr/lib/python2.3/urllib.py", line 190, in open_unknown raise IOError, ('url error', 'unknown url type', type) IOError: [Errno url error] unknown url type: 'g'

ockham commented 11 years ago

Submitted by SourceForge user leggewie on 2008-09-23 08:40:41 UTC.

Thomas, what is the status here?

ockham commented 11 years ago

Submitted by SourceForge user goweropolis on 2005-10-28 06:16:57 UTC.

Logged In: YES user_id=658675

Thank you for the quick response Tim. I made your suggested correction to the XML file (changing "G:\Program Files\gourmet\data/recipe.dtd" to "file:///usr/share/gourmet/recipe.dtd") and the import worked perfectly.

May I make a suggestion? Currently in the Import Recipes dialog box, the filelist is not filtered according to the selection in the filetype box (where the default value is "All importable files"). It would be nice if the default filelisting only showed files where the file suffix (.xml, .html, etc.) matched the selection in the filetype box. Perhaps that is something that you are working on for the next release.

Thanks very much for the great program. I really appreciate it, and it is extremely useful.

ockham commented 11 years ago

Submitted by SourceForge user thomas_hinkle on 2005-10-27 10:56:49 UTC.

Logged In: YES user_id=1030390

There is currently no support for generic text or RTF import, so the first part of this bug is invalid. Support for generic text and HTML import is coming (it's already in CVS), however.

However, the error on XML is a bug -- it's actually a bug in the original export rather than the import -- the file you attached is invalid.

This is a windows-specific bug in the way the path to the DTD is written -- specifically, in the file you sent me, the slashes are mixed up.

"G:\Program Files\gourmet\data/recipe.dtd"

On linux, switching this to "file:///usr/share/gourmet/recipe.dtd"

made the import work.

If you just want to import the file, you can fix it by hand -- you just need to twiddle the path until it actually matches the path of the DTD on your system. Alternatively, it will work to give it the path to the web location of the file (currently only via cvs).

Just replace the G:...dtd with the following: http://cvs.sourceforge.net/viewcvs.py/*checkout*/grecipe-manager/grm/data/recipe.dtd?rev=1.1.1.1

pounamu commented 10 years ago

Is this still an issue?

ockham commented 10 years ago

I think it isn't.