Browse Source

rename as ProjectManager

master 0.7.0
Randy Lai 5 years ago
parent
commit
e97516464e
  1. 4
      Main.sublime-menu
  2. 27
      pm.py
  3. 2
      project_manager.sublime-settings

4
Main.sublime-menu

@ -79,12 +79,12 @@
[
{
"command": "open_file",
"args": {"file": "${packages}/Project Manager/Project Manager.sublime-settings"},
"args": {"file": "${packages}/ProjectManager/project_manager.sublime-settings"},
"caption": "Settings – Default"
},
{
"command": "open_file",
"args": {"file": "${packages}/User/Project Manager.sublime-settings"},
"args": {"file": "${packages}/User/project_manager.sublime-settings"},
"caption": "Settings – User"
},
{ "caption": "-" }

27
pm.py

@ -7,14 +7,27 @@ import platform
import re
def update_settings():
def plugin_loaded():
t = sublime.load_settings("Project Manager.sublime-settings")
projects_path = t.get("projects_fpath")
if projects_path:
t.set("projects_path", projects_path)
sublime.save_settings("Project Manager.sublime-settings")
update_settings()
s = sublime.load_settings("project_manager.sublime-settings")
keys = [
"projects_path",
"use_local_projects_dir",
"show_open_files",
"show_recent_projects_first"
]
d = {}
for k in keys:
if t.has(k) and not s.has(k):
d.update({k: t.get(k)})
for key, value in d.items():
s.set(key, value)
if d:
sublime.save_settings("project_manager.sublime-settings")
old_file = os.path.join(sublime.packages_path(), "User", "Project Manager.sublime-settings")
if os.path.exists(old_file):
os.unlink(old_file)
class JsonFile:

2
Project Manager.sublime-settings → project_manager.sublime-settings

@ -6,7 +6,7 @@
// "Projects - computer_name", where computer_name is your computer hostname.
// It would be useful if Sublime Text settings are synced across different computers.
// To discover your computer hostname, run
// import sys; sys.modules['Project Manager'].pm.get_node() in your sublime console
// import sys; sys.modules['ProjectManager'].pm.get_node() in your sublime console
// "use_local_projects_dir": true
// force to `Hide Open Files` or `Show Open Files` in the sidebar.
Loading…
Cancel
Save