This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# not working | |
def svn_commit(): | |
"""commit any changes to svn""" | |
mod = local('svn st -q',capture=True) | |
if mod != '': | |
print "Modified:" | |
print mod | |
#working |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: ascii -*- | |
""" | |
Module Docstring | |
Docstrings: http://www.python.org/dev/peps/pep-0257/ | |
""" | |
__author__ = 'Joe Author ([email protected])' | |
__copyright__ = 'Copyright (c) 2009-2010 Joe Author' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Module Docstring | |
""" | |
# | |
## Code goes here. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: ascii -*- | |
""" | |
package.module | |
~~~~~~~~~~~~~ | |
A description which can be long and explain the complete | |
functionality of this module even with indented code examples. | |
Class/Function however should not be documented here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
package.module | |
~~~~~~~~~~~~~ | |
A description which can be long and explain the complete | |
functionality of this module even with indented code examples. | |
Class/Function however should not be documented here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
package.module | |
~~~~~~~~~~~~~ | |
A description which can be long and explain the complete | |
functionality of this module even with indented code examples. | |
Class/Function however should not be documented here. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
SYNOPSIS | |
TODO helloworld [-h,--help] [-v,--verbose] [--version] | |
DESCRIPTION | |
TODO This describes how to use this script. This docstring | |
will be printed by the script if there is an error or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from setuptools import setup | |
except ImportError: | |
from distutils.core import setup | |
config = { | |
'description': 'My Project', | |
'author': 'My Name', | |
'url': 'URL to get it at.', | |
'download_url': 'Where to download it.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set up logging | |
logger = logging.getLogger('main') | |
logger.setLevel(logging.DEBUG) | |
# Use file output for production logging: | |
filename, fileextension = os.path.splitext(sys.argv[0]) | |
# log file name <script name>.log | |
log_file = '{0}.log'.format(filename) | |
filelog = logging.FileHandler(log_file, 'a') | |
filelog.setLevel(logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logger = logging.getLogger('myapp') | |
hdlr = logging.FileHandler('/var/tmp/myapp.log') | |
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') | |
hdlr.setFormatter(formatter) | |
logger.addHandler(hdlr) | |
logger.setLevel(logging.WARNING) |
OlderNewer