diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2019-04-01 00:40:47 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2019-04-01 00:40:47 -0400 |
| commit | d0bb54b229b8ffc19d1a41359b22eeae06fc77c0 (patch) | |
| tree | 84695925e26d7086ec9af0aa63645a3ef5b9b8cc | |
| parent | a86c259bd973d1e52446dc44d0ce843ba9fcfb3c (diff) | |
make qsettings match on non-macos platforms and craete snippet folder if missing
| -rw-r--r-- | python/examples/snippets/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/examples/snippets/__init__.py b/python/examples/snippets/__init__.py index d393b4d9..32f2f8eb 100644 --- a/python/examples/snippets/__init__.py +++ b/python/examples/snippets/__init__.py @@ -16,6 +16,12 @@ from binaryninja.log import (log_info, log_warn, log_alert, log_debug) from binaryninjaui import (getMonospaceFont, UIAction, UIActionHandler, Menu) snippetPath = os.path.realpath(os.path.join(user_plugin_path(), "..", "snippets")) +try: + if not os.path.exists(snippetPath): + os.mkdir(snippetPath) +except IOError: + log_error("Unable to create %s" % snippetPath) + def includeWalk(dir, includeExt): filePaths = [] @@ -152,7 +158,7 @@ class Snippets(QDialog): hlayout.addWidget(hsplitter) self.showNormal() #Fixes bug that maximized windows are "stuck" - self.settings = QSettings("Vector35", "Snippet Editor") + self.settings = QSettings("Vector 35", "Snippet Editor") if self.settings.contains("ui/snippeteditor/geometry"): self.restoreGeometry(self.settings.value("ui/snippeteditor/geometry")) else: |
