Skip to content

Commit

Permalink
Read package name from relative file path
Browse files Browse the repository at this point in the history
  • Loading branch information
vicke4 committed Nov 14, 2017
1 parent 59c8a3f commit c6c581e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.5] - 2017-11-14
### Changed
- Fix to read phantom icon.

## [1.2.4] - 2017-11-14
### Changed
- Fix to read phantom icon.
Expand Down
7 changes: 5 additions & 2 deletions open_in_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
from urllib.parse import urlparse
from .settings import get_setting

image_path = os.path.join(os.path.dirname(__file__), 'open-in-browser.png')
ENCODED_IMG = base64.b64encode(sublime.load_binary_resource("Packages/Open In Browser/open-in-browser.png")).decode()
import os

PLUGIN_PATH = os.path.dirname(os.path.realpath(__file__))
PLUGIN_NAME = os.path.basename(PLUGIN_PATH).replace(".sublime-package", "")
ENCODED_IMG = base64.b64encode(sublime.load_binary_resource("Packages/" + PLUGIN_NAME +"/open-in-browser.png")).decode()
REGEX = "(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?"

class OpenInBrowser(sublime_plugin.ViewEventListener):
Expand Down

0 comments on commit c6c581e

Please sign in to comment.