diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2008-12-21 16:50:16 +0100 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2008-12-21 16:58:05 +0100 |
| commit | 63d61a6e5ad877013cb450f3afad591e7ff22587 (patch) | |
| tree | a933e00a92f54a0d74ac858629cb5a1dfbc9d3f0 /lib/python | |
| parent | 7c24430321fba915f47f6437bfd395fb8f0ac04a (diff) | |
| download | enigma2-63d61a6e5ad877013cb450f3afad591e7ff22587.tar.gz enigma2-63d61a6e5ad877013cb450f3afad591e7ff22587.zip | |
create directory for plugin and add plugin to configure.ac and Makefile.am
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Plugins/newplugin.py | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/lib/python/Plugins/newplugin.py b/lib/python/Plugins/newplugin.py index 6a448407..c84f0609 100644 --- a/lib/python/Plugins/newplugin.py +++ b/lib/python/Plugins/newplugin.py @@ -2,10 +2,12 @@ import os -name = raw_input("Plugin name: ") - +os.system("clear") +internalname = raw_input("Internal plugin name (no whitespaces, plugin directory): ") +name = raw_input("Visible plugin name: ") print +os.system("clear") dirlist = [] count = 0 print "Plugin categories:" @@ -31,7 +33,7 @@ def add_where_pluginmenu(name, fnc): wherelist = [] wherelist.append(("WHERE_EXTENSIONSMENU", add_where_extensionsmenu)) -wherelist.append(("WHERE_PLUGINMENU", add_where_extensionsmenu)) +wherelist.append(("WHERE_PLUGINMENU", add_where_pluginmenu)) targetlist = [] @@ -61,7 +63,38 @@ while not stop: targetlist.remove(wherelist[int(target) - 1]) -file = open("plugin.py", "w") +pluginpath = category + "/" + internalname +os.mkdir(pluginpath) + +makefile = open(category + "/Makefile.am", "r") +lines = makefile.readlines() +lines = ''.join(lines) +lines = lines.strip() +lines += " " + internalname +makefile.close() + +makefile = open(category + "/Makefile.am", "w") +makefile.write(lines) +makefile.close() + +lines = [] +print "open" +configure = open("../../../configure.ac", "r") +while True: + line = configure.readline() + if not line: + break + lines.append(line) + if line.strip() == "lib/python/Plugins/" + category + "/Makefile": + lines.append("lib/python/Plugins/" + pluginpath + "/Makefile\n") +configure.close() +print "close" + +configure = open("../../../configure.ac", "w") +configure.writelines(lines) +configure.close() + +file = open(pluginpath + "/plugin.py", "w") importlist = [] for where in targetlist: |
