Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Python (http://www.programmingforums.org/forum43.html)
-   -   Code library (in working progress) (http://www.programmingforums.org/showthread.php?t=4771)

Cerulean Jul 6th, 2005 9:21 PM

Code library (in working progress)
 
Someone brought up the idea of a code library, and it's been something i've been in desperate need of for a while. I have a large ~/Python directory with no structure, containing around a hundred cryptically named files, so i've started creating my own code library.
I think a really clean, intuitive, and efficient one is needed, so you can get to your code quickly and easily.

Here's what i've got so far.

Current features implemented are:
- Search-as-you-type filter
- Filter by category
- Source sample adding via drag-n-drop - you can drop a file, an FTP/HTTP link, or a direct snippet, and you'll be greeted with a simple dialog that allows you to select categories and set the title and description.

Future features I want in there:
- Statistics for each file: lists of classes, functions, and their parameters; creation/modification date (maybe diffs?), etc..
- Backup the library to an archive (zip, rar, tar.gz, tar.bz2, or lzw)

Any ideas on what features you think would be cool in there? Be creative ;)

Dietrich Jul 6th, 2005 10:16 PM

Some work I have done uses an editbox for the code and an associated editbox for notes. The search-as-you-type indexing is a good idea. Right now I have it search a listbox of keywords to speed things up. Of course you have to supply the keywords with each new entry. On the other hand, you can supply keywords that are not necessarily in the code. The keywords do crossreference the various code snippets.

I also made the topline in the code a remark containing the description. It is fished out and diplayed as you go through the title listbox. This way the description can go with the cut and paste of the code. Helpful, if you splice a larger program together from the snippets.

Cerulean Jul 7th, 2005 5:06 AM

Quote:

This way the description can go with the cut and paste of the code. Helpful, if you splice a larger program together from the snippets.
Hrm yeah, I was debating doing this actually. I just find that my consistency when it comes to top-line comments is pretty weak, and if I was to rely on that then I wouldn't be able to exploit the drag and drop of URLs (not all snippets I see on the web will have a top-level comment, especially if I only want a single function)

Dietrich Jul 7th, 2005 8:00 AM

I see your point. I guess you can always copy/paste the description along with the code copy/paste then.

Infinite Recursion Jul 7th, 2005 8:58 AM

looks very good. one of these days I will get around to writing one in C# ...


All times are GMT -5. The time now is 2:22 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC