mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Jan. 13 2008,15:39 |
|
Quote (roberts @ Jan. 13 2008,01:35) | Also note that I am also now updating a Master List of all extensions. Use your browser to search it, or download it and use Beaver to search it. Or have fun with grep. |
Here's a simple gui that can be used to parse this file, currently by filename, package builder, or extension category.
NOTE: This is a quick test, and should not be considered complete or stable. The list.txt file must be saved locally The application must be run from a terminal in order to view any output Text parsing needs work. The "filename" in particular could be handled better...it will accept Lua string patters, but needs further testing to determine whether certain input could be harmful.
Code Sample | listfile="list.txt"
inputfile=io.open(listfile) if not inputfile then print("can't open "..listfile) os.exit(1) end
data=inputfile:read("*a") inputfile:close()
function parse_info() if radio_buttons[1]:value()==1 then searchstring="Location:%s*"..inputs[1]:value() elseif radio_buttons[2]:value()==1 then searchstring="\nExtension.by:%s*"..inputs[2]:value() elseif radio_buttons[3]:value()==1 then searchstring="\nTitle:%s*"..inputs[3]:value() else searchstring=nil end if searchstring then for info in string.gmatch(data,"(Location:.-\n)Location:") do if string.find(info,searchstring) then print(info.."\n..........\n") end end end end
w=fltk:Fl_Window(350,200,"MyDSL Info Search")
radio_labels={"category","extension by","filename"} radio_buttons={};inputs={} for i=1,table.getn(radio_labels) do radio_buttons[i]=fltk:Fl_Radio_Round_Button(10,20*i,100,20,radio_labels[i]) inputs[i]=fltk:Fl_Input(120,20*i,200,20) end
gobutton=fltk:Fl_Button(10,100,100,20,"go") gobutton:callback(parse_info)
w:show() Fl:run()
|
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|