licenses / lice

Generate license files for your projects
BSD 3-Clause "New" or "Revised" License
506 stars 38 forks source link

Tests fixed #23

Closed alex179ohm closed 11 years ago

alex179ohm commented 11 years ago

Fixed tests

( works on python 2.7, 3.3)

Yonaba commented 11 years ago

This is nice patch. I like all those new features. Though, I'd like to know, on the basis of what have to selected the set of languages for output formattiing ? Or did you just provided some, to be extended later on ?

Best regards, Roland.

alex179ohm commented 11 years ago

Extend the language output formatting is very simple,you just have to edit the LANGS and LANG_CMT dicts in core.py:

LANG_CMT = {"comment_name":[u'string', u'string', u'string'], } 

is the dict that contains the comment types

key: is the name of the comment type value: is a len 3 list of strings, the first string is the string which open a multiline comment, the second string is the string which comment every line of the license and the last string is the the string which close a multiline comment.

LANGS = {"string":"string", } 

is the dict that associate lang to comment type key: is the name of the language and the suffix of the source file value: is the name of the comment type associated

Example:

LANGS = {"py":"unix", "c":"c"}

LANG_CMT = {"unix":{u'', u'#', u''}, "c":[u'/*', u'*', u'*/']}

NOTE: unicode (u) after the comment strings is required to avoid problem with StringIO() (used for perfomance and unicode porting problems) If you want add a cpp source file format and language, you just have to add "cpp":"c" to LANGS (c comment type already exist in LANG_CMT)

now I write a few lines of doc in core.py and I drop you a pull_request....

Regards, Alex.