copyright (version 1.3)
index
/home/ut3hax/bin/copyright

copyright
=========
This tool will automatically edit files and add your copyright loaded from a 
template.  The use of this "template" can be over-ridden using the -t flag.
 
Features:
    *  Will not add copyright to file twice.
    *  Can determine best comment char to use for ini, html, php, and python.
    *  Manages multiple copyrights.
    *  Creates default copyright for you.

 
Modules
       
pytis
cStringIO
datetime
glob
optparse
os
shutil
sys

 
Functions
       
addConfigDir(d)
apply(func)
applyCopyright(fi, data, cp)
For the given file :fi: insert the copyright text :cp: using the 
appropriate comment strings defined in comment_chars and returned by the
FileType function.
check(func)
checkCopyright(fi, data, cp)
dispatch to correct checking func
:fi: file in question
:data: a bag of information about that file's language from comment_chars
:cp: a copyright
config(opts)
copyright(opts, args)
Do the nasty
Errors to catch:
    class DuplicateCopyright(UserWarning): pass
    class EmptyTemplate(FileNotFound): pass
    class FileNotFound(UserWarning): pass
    class IdiotError(Exception): pass
    class QuitNow(Exception): pass
createDefault(opts, fi=None)
The contents of this file are subject to the YOUR COMPANY Public License Version
1.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
 
    http://www.YOURSITE.com/License/
    
    Copyright © %s YOUR NAME
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
dos2unix(fi)
edit(fi, direct=False)
Allows the user the option to edit a license/copyright template.
efpath(opts, default=False)
edit template file path with file name
fileType(fi)
For the given file :fi: find and return the dict object associated with
this file defined in the above comment_chars.  If none is found return 
none.
func(method)
# I like this way more, but the other is easier to understand
generic_check(fi, cp, lang)
loadCopyright(opts)
Load a copyright from one of the template files.  Present a warning 
if the file is empty.
main()
usage: copyright [optional: -t{TEMLATE}] [file(s)]
nfpath(opts, default=False)
new template file path with file name
prettyCopyright(cp, d)
Using data provided in the comment_chars, format the Copyright already
loaded for it's filetype.
removeConfigDir(opath)
setConfig(d)
tList(opts)
# =============================================================================
# Begin Copyright creation / editing functions
# -----------------------------------------------------------------------------
testConfig()
toContinue()
Silly a function this big for somethign so simple, but I haven't found an 
easier way yet in linux to present a dos "pause."
tpath(opts, default=False)
template file path with file name

 
Data
        __author__ = 'Josh Lee'
__configdir__ = '/home/ut3hax/.mycopyright'
__copyright__ = 'PyTis'
__created__ = '06:14pm 09 Sep, 2009'
__version__ = '1.3'
comment_chars = {'css': {'apply': <function css>, 'begin': '/*', 'bin': None, 'check': <function css>, 'end': '*/', 'ext': ['.css'], 'middle': '//'}, 'html': {'apply': <function html>, 'begin': '<!-- ', 'bin': None, 'check': <function html>, 'end': ' -->', 'ext': ['.html', '.htm', '.shtml', '.dhtml', '.xml'], 'middle': '-'}, 'ini': {'apply': <function ini>, 'begin': ';', 'bin': None, 'check': <function ini>, 'end': ';', 'ext': ['.ini'], 'middle': ';'}, 'javascript': {'apply': <function javascript>, 'begin': '/*', 'bin': None, 'check': <function javascript>, 'end': '*/', 'ext': ['.js'], 'middle': '//'}, 'php': {'apply': <function php>, 'begin': '/*', 'bin': 'php', 'check': <function php>, 'end': '*/', 'ext': ['.php', '.php4', '.php5', 'phtml'], 'middle': '//'}, 'python': {'apply': <function python>, 'begin': '#', 'bin': 'python', 'check': <function python>, 'end': '#', 'ext': ['.py', '.pyw'], 'middle': '#'}}
css = None
html = None
ini = None
javascript = None
php = None
python = None

 
Author
        Josh Lee