Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
f2273833
Commit
f2273833
authored
Mar 17, 2013
by
Miguel Angel Ajo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReloadPlugins() python function, and mtime stored in the KICAD_PLUGINS dictionary
parent
1cf52baa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
kicadplugins.i
scripting/kicadplugins.i
+22
-7
python_scripting.cpp
scripting/python_scripting.cpp
+2
-2
No files found.
scripting/kicadplugins.i
View file @
f2273833
...
...
@@ -47,11 +47,25 @@ def ReloadPlugin(name):
if not KICAD_PLUGINS.has_key(name):
return False
KICAD_PLUGINS[name]["wizard"].deregister()
KICAD_PLUGINS[name]["object"].deregister()
mod = reload(KICAD_PLUGINS[name]["module"])
KICAD_PLUGINS[name]["object"]= mod.register()
def ReloadPlugins():
import os.path
for k in KICAD_PLUGINS.keys():
plugin = KICAD_PLUGINS[k]
filename = plugin["filename"]
mtime = plugin["modification_time"]
now_mtime = os.path.getmtime(filename)
if mtime!=now_mtime:
print filename, " is modified, reloading"
KICAD_PLUGINS[k]["modification_time"]=now_mtime
ReloadPlugin(k)
KICAD_PLUGINS[name]["wizard"]= mod.register()
def LoadPlugins():
import os
...
...
@@ -85,11 +99,12 @@ def LoadPlugins():
mod = __import__(module[:-3], locals(), globals())
module_filename = plugins_dir+"/"+module
mtime = os.path.getmtime(module_filename)
if hasattr(mod,'register'):
KICAD_PLUGINS[module]={"filename":plugins_dir+"/"+module,
"wizard":mod.register(),
KICAD_PLUGINS[module]={"filename":module_filename,
"modification_time":mtime,
"object":mod.register(),
"module":mod}
...
...
scripting/python_scripting.cpp
View file @
f2273833
...
...
@@ -224,8 +224,8 @@ wxWindow* CreatePythonShellWindow( wxWindow* parent )
"
\t\t
self.SetSizer(sizer)
\n\n
"
"
\n
"
"def makeWindow(parent):
\n
"
"
win
= PyCrustPanel(parent)
\n
"
" return
win
\n
"
"
shell_window
= PyCrustPanel(parent)
\n
"
" return
shell_window
\n
"
"
\n
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment