LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   A slack-desc file generator program. (http://www.linuxquestions.org/questions/slackware-14/a-slack-desc-file-generator-program-884213/)

Gerwar 06-02-2011 05:50 PM

A slack-desc file generator program.
 
Hi everyone this thread is not meant to be as a question. I would like to introduce you a program made by me. It is a slack-desc generator. In which you enter the parameters for the file, like: the name of the program, nome of the homepage, a short description and a long description. Hope you like the program if you have comments please let me know.

EDIT:
Thanks to the advice of dugan, i've uploaded my program to github. If you want the source you can download it at https://github.com/GerardoGR/gensd

Sorry because not everybody has a github account ill post the link for the program (via megaupload), here it is: http://www.megaupload.com/?d=T58OA6WR

EDIT:
Newest release of this program http://www.megaupload.com/?d=H27BBQ25

dugan 06-02-2011 06:02 PM

If you plan on open sourcing and maintaining it, then you should put it on GitHub.

DragonWisard 06-02-2011 06:20 PM

I agree with dugan.

disturbed1 06-02-2011 06:24 PM

Really interesting. Thanks!

You should add some basic usage output for those that just run the program and hit enter, or ./gensd -h --help ... Right now you only get
Error: you have enter a wrong number of parameters at the command line.

piratesmack 06-02-2011 08:33 PM

This is the python script I use to generate mine
Code:

#!/usr/bin/env python
# Usage: mkdesc.py program_name > slack-desc

import sys

def main(arg):
        print """\
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in.  You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

%s|-----handy-ruler------------------------------------------------------|
%s""" % ( " " * len(arg), (arg + ":\n") * 10 + arg + ":" )

if __name__ == "__main__" and len(sys.argv) == 2:
        main(sys.argv[1])
else:
        print "Usage: %s program_name > slack-desc" % ( sys.argv[0] )

Nothing fancy. Doesn't fill in the description or homepage, just creates a template you can edit.

Gerwar 06-03-2011 12:05 AM

Thank you very much for your rapid responses, and your suggestions. The github things sounds good, i didnt know about that. And i agree, i think i must have some other basic output functions like you said, the -h or --help.


All times are GMT -5. The time now is 09:34 PM.