Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed (OS X ?) Problem #1

Merged
merged 5 commits into from

2 participants

@pdaether

Hello @erinata ,

on my Laptop with OS X 10.6.8 the MarkdownBuild plugin did not work.
The html was generated but no browser window popped up.

So i changed the last call and know everything just works. Maybe you want to test this change on windows an push it to your repository.

Greetings
Patrick

@erinata
Owner

I cannot look at it now because I am on the go. But I will look at it and and want to send a BIG THANKS to you. I am not a mac user and I am very grateful that some one help me to make it work in mac.

@erinata
Owner

Hey I try that out but it seem that I cannot get it work......

I got

ImportError: No module named desktop

So it seems that there is nothing named "desktop" for me to import. In the mac version of Sublime Text 2 the python has desktop for importing?

@pdaether

You are right. I had this lib on my laptop.

But i had changed the open method again. If you call the open_url command not with just the file path but with a complete URI scheme it works on my computer.
Maybe this does the trick?

@pdaether pdaether URL-encode the file path before calling the 'open_url' command.
Otherwise some errors may occur if the file path contains spaces or special characters.
19295f6
@erinata
Owner

if you use the liburl quote....it doesn't work on windows anymore.

Can you try the lastest version out on mac? It use import webbrowser and webbrowser.open("file://" + output.name) to do the trick, and it works on both window and linux.

If it still doesn't work on macI guess I can just put a conditional statement to check the platform.

@pdaether

webbrowser.opendoes the trick on osx also without further modifications.
I think we're done.

@erinata erinata merged commit c187a62 into from
@erinata
Owner

Thanks so much for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 13, 2012
  1. @pdaether
Commits on Apr 14, 2012
  1. @pdaether
  2. @pdaether

    URL-encode the file path before calling the 'open_url' command.

    pdaether authored
    Otherwise some errors may occur if the file path contains spaces or special characters.
  3. @pdaether

    Merged upstream into master

    pdaether authored
  4. @pdaether

    Removed unused code

    pdaether authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 5 deletions.
  1. +1 −5 MarkdownBuild.py
View
6 MarkdownBuild.py
@@ -28,8 +28,4 @@ def run(self):
output = tempfile.NamedTemporaryFile(delete=False, suffix='.html')
output.write(html.encode('UTF-8'))
output.close()
- webbrowser.open("file://" + output.name)
- #if sublime.platform() == 'osx':
- # subprocess.call("open " + output.name, shell=True)
- #else:
- # self.window.run_command('open_url', {"url": output.name})
+ webbrowser.open("file://" + output.name)
Something went wrong with that request. Please try again.