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:"
wherelist = []
wherelist.append(("WHERE_EXTENSIONSMENU", add_where_extensionsmenu))
-wherelist.append(("WHERE_PLUGINMENU", add_where_extensionsmenu))
+wherelist.append(("WHERE_PLUGINMENU", add_where_pluginmenu))
targetlist = []
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:
return %s
""" % descriptorlist)
-file.close()
\ No newline at end of file
+file.close()
+
+makefile = open(pluginpath + "/Makefile.am", "w")
+makefile.write("""installdir = $(LIBDIR)/enigma2/python/Plugins/%s/%s
+
+install_PYTHON = \\
+ __init__.py \\
+ plugin.py
+""" % (category, internalname))
+makefile.close()