提交 9ac04ab4 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

More pep8/pyflakes

上级 e9e7ed0c
#!/usr/bin/env python
import logging, os, sys
import logging
import os
import sys
import theano
from theano import config
from theano.gof.cc import get_module_cache
......@@ -41,4 +44,3 @@ else:
print 'Type "theano-cache unlock" to unlock the cache directory'
print 'Type "theano-cache cleanup" to delete keys in the old format'
sys.exit(1)
#!/usr/bin/env python
__authors__ = "Olivier Delalleau, Pascal Lamblin"
__contact__ = "delallea@iro"
__authors__ = "Olivier Delalleau, Pascal Lamblin"
__contact__ = "delallea@iro"
"""
This script should behave the same as the `nosetests` command.
......@@ -68,6 +68,7 @@ def main():
return nose.main(addplugins=addplugins)
def help():
help_msg = """
This script behaves mostly the same as the `nosetests` command.
......
......@@ -3,16 +3,16 @@
# theano documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 7 16:34:06 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
# This file is execfile()d with the current directory set to its containing
# directory.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
# that aren't pickleable (module imports are okay, they're removed
# automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
import sys, os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
......@@ -21,8 +21,8 @@ import sys, os
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
todo_include_todos = True
......@@ -64,11 +64,12 @@ today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directories, that shouldn't be searched
# for source files.
# List of directories, relative to source directories, that shouldn't be
# searched for source files.
exclude_dirs = ['images', 'scripts', 'sandbox']
# The reST default role (used for this markup: `text`) to use for all documents.
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
......@@ -166,7 +167,8 @@ htmlhelp_basename = 'theanodoc'
latex_font_size = '11pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
# (source start file, target name, title, author, document class
# [howto/manual]).
latex_documents = [
('index', 'theano.tex', 'theano Documentation',
'LISA lab, University of Montreal', 'manual'),
......
......@@ -4,16 +4,14 @@ import os
import shutil
import inspect
from epydoc import docintrospecter
from epydoc import docintrospecter
from epydoc.apidoc import RoutineDoc
def Op_to_RoutineDoc(op, routine_doc, module_name=None):
routine_doc.specialize_to(RoutineDoc)
#NB: this code is lifted from
# /u/bergstrj/pub/prefix/x86_64-unknown-linux-gnu-Fedora_release_7__Moonshine_/lib/python2.5/site-packages/epydoc
# /u/bergstrj/pub/prefix/x86_64-unknown-linux-gnu-Fedora_release_7__Moonshine_/lib/python2.5/site-packages/epydoc/docintrospecter.py
#NB: this code is lifted from epydoc/docintrospecter.py
# op should be an op instance
assert hasattr(op, 'perform')
......@@ -32,7 +30,7 @@ def Op_to_RoutineDoc(op, routine_doc, module_name=None):
routine_doc.kwarg = kwarg
# Set default values for positional arguments.
routine_doc.posarg_defaults = [None]*len(args)
routine_doc.posarg_defaults = [None] * len(args)
# Set the routine's line number.
if hasattr(func, 'func_code'):
......@@ -50,8 +48,8 @@ def Op_to_RoutineDoc(op, routine_doc, module_name=None):
return routine_doc
docintrospecter.register_introspecter(
lambda value: getattr(value, '__epydoc_asRoutine', False),
Op_to_RoutineDoc,
lambda value: getattr(value, '__epydoc_asRoutine', False),
Op_to_RoutineDoc,
priority=-1)
......@@ -63,13 +61,17 @@ if __name__ == '__main__':
throot = "/".join(sys.path[0].split("/")[:-2])
options = defaultdict(bool)
options.update(dict([x, y or True] for x, y in getopt.getopt(sys.argv[1:], 'o:', ['epydoc', 'rst', 'help', 'nopdf'])[0]))
options.update(dict([x, y or True] for x, y in
getopt.getopt(sys.argv[1:],
'o:',
['epydoc', 'rst', 'help', 'nopdf'])[0]))
if options['--help']:
print 'Usage: %s [OPTIONS]' % sys.argv[0]
print ' -o <dir>: output the html files in the specified dir'
print ' --rst: only compile the doc (requires sphinx)'
print ' --nopdf: do not produce a PDF file from the doc, only HTML'
print ' --epydoc: only compile the api documentation (requires epydoc)'
print ' --epydoc: only compile the api documentation',
print '(requires epydoc)'
print ' --help: this help'
sys.exit(0)
......@@ -94,13 +96,14 @@ if __name__ == '__main__':
if options['--all'] or options['--epydoc']:
mkdir("api")
from epydoc.cli import cli
sys.path[0:0] = [throot]
#Generate HTML doc
## This causes problems with the subsequent generation of sphinx doc
#sys.argv[:] = ['', '--config', '%s/doc/api/epydoc.conf' % throot, '-o', 'api']
#from epydoc.cli import cli
#sys.argv[:] = ['', '--config', '%s/doc/api/epydoc.conf' % throot,
# '-o', 'api']
#cli()
## So we use this instead
os.system("epydoc --config %s/doc/api/epydoc.conf -o api" % throot)
......@@ -131,6 +134,3 @@ if __name__ == '__main__':
print 'OSError:', e
except IOError, e:
print 'IOError:', e
......@@ -53,6 +53,7 @@ ISRELEASED = False
VERSION = '%d.%d.%d%s' % (MAJOR, MINOR, MICRO, SUFFIX)
def git_version():
"""
Return the sha1 of local git HEAD as a string.
......@@ -86,13 +87,15 @@ def git_version():
git_revision = "unknown-git"
return git_revision
def write_version_py(filename=os.path.join('theano', 'generated_version.py')):
cnt = """
# THIS FILE IS GENERATED FROM THEANO SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
git_revision = '%(git_revision)s'
full_version = '%(version)s.dev-%%(git_revision)s' %% {'git_revision': git_revision}
full_version = '%(version)s.dev-%%(git_revision)s' %% {
'git_revision': git_revision}
release = %(isrelease)s
if not release:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论