-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f7c9826
Showing
17 changed files
with
599 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
0.0 | ||
--- | ||
|
||
- Initial version |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include *.txt *.ini *.cfg *.rst | ||
recursive-include lingvodoc *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
lingvodoc README | ||
================== | ||
|
||
Getting Started | ||
--------------- | ||
|
||
- cd <directory containing this file> | ||
|
||
- $VENV/bin/python setup.py develop | ||
|
||
- $VENV/bin/initialize_lingvodoc_db development.ini | ||
|
||
- $VENV/bin/pserve development.ini | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
### | ||
# app configuration | ||
# http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/environment.html | ||
### | ||
|
||
[app:main] | ||
use = egg:lingvodoc | ||
|
||
pyramid.reload_templates = true | ||
pyramid.debug_authorization = false | ||
pyramid.debug_notfound = false | ||
pyramid.debug_routematch = false | ||
pyramid.default_locale_name = en | ||
pyramid.includes = | ||
pyramid_debugtoolbar | ||
pyramid_tm | ||
|
||
sqlalchemy.url = sqlite:///%(here)s/lingvodoc.sqlite | ||
|
||
# By default, the toolbar only appears for clients from IP addresses | ||
# '127.0.0.1' and '::1'. | ||
# debugtoolbar.hosts = 127.0.0.1 ::1 | ||
|
||
### | ||
# wsgi server configuration | ||
### | ||
|
||
[server:main] | ||
use = egg:waitress#main | ||
host = 0.0.0.0 | ||
port = 6543 | ||
|
||
### | ||
# logging configuration | ||
# http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/logging.html | ||
### | ||
|
||
[loggers] | ||
keys = root, lingvodoc, sqlalchemy | ||
|
||
[handlers] | ||
keys = console | ||
|
||
[formatters] | ||
keys = generic | ||
|
||
[logger_root] | ||
level = INFO | ||
handlers = console | ||
|
||
[logger_lingvodoc] | ||
level = DEBUG | ||
handlers = | ||
qualname = lingvodoc | ||
|
||
[logger_sqlalchemy] | ||
level = INFO | ||
handlers = | ||
qualname = sqlalchemy.engine | ||
# "level = INFO" logs SQL queries. | ||
# "level = DEBUG" logs SQL queries and results. | ||
# "level = WARN" logs neither. (Recommended for production systems.) | ||
|
||
[handler_console] | ||
class = StreamHandler | ||
args = (sys.stderr,) | ||
level = NOTSET | ||
formatter = generic | ||
|
||
[formatter_generic] | ||
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pyramid.config import Configurator | ||
from sqlalchemy import engine_from_config | ||
|
||
from .models import ( | ||
DBSession, | ||
Base, | ||
) | ||
|
||
|
||
def main(global_config, **settings): | ||
""" This function returns a Pyramid WSGI application. | ||
""" | ||
engine = engine_from_config(settings, 'sqlalchemy.') | ||
DBSession.configure(bind=engine) | ||
Base.metadata.bind = engine | ||
config = Configurator(settings=settings) | ||
config.include('pyramid_chameleon') | ||
config.add_static_view('static', 'static', cache_max_age=3600) | ||
config.add_route('home', '/') | ||
config.scan() | ||
return config.make_wsgi_app() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from sqlalchemy import ( | ||
Column, | ||
Index, | ||
Integer, | ||
Text, | ||
) | ||
|
||
from sqlalchemy.ext.declarative import declarative_base | ||
|
||
from sqlalchemy.orm import ( | ||
scoped_session, | ||
sessionmaker, | ||
) | ||
|
||
from zope.sqlalchemy import ZopeTransactionExtension | ||
|
||
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) | ||
Base = declarative_base() | ||
|
||
|
||
class MyModel(Base): | ||
__tablename__ = 'models' | ||
id = Column(Integer, primary_key=True) | ||
name = Column(Text) | ||
value = Column(Integer) | ||
|
||
Index('my_index', MyModel.name, unique=True, mysql_length=255) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# package |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
import sys | ||
import transaction | ||
|
||
from sqlalchemy import engine_from_config | ||
|
||
from pyramid.paster import ( | ||
get_appsettings, | ||
setup_logging, | ||
) | ||
|
||
from pyramid.scripts.common import parse_vars | ||
|
||
from ..models import ( | ||
DBSession, | ||
MyModel, | ||
Base, | ||
) | ||
|
||
|
||
def usage(argv): | ||
cmd = os.path.basename(argv[0]) | ||
print('usage: %s <config_uri> [var=value]\n' | ||
'(example: "%s development.ini")' % (cmd, cmd)) | ||
sys.exit(1) | ||
|
||
|
||
def main(argv=sys.argv): | ||
if len(argv) < 2: | ||
usage(argv) | ||
config_uri = argv[1] | ||
options = parse_vars(argv[2:]) | ||
setup_logging(config_uri) | ||
settings = get_appsettings(config_uri, options=options) | ||
engine = engine_from_config(settings, 'sqlalchemy.') | ||
DBSession.configure(bind=engine) | ||
Base.metadata.create_all(engine) | ||
with transaction.manager: | ||
model = MyModel(name='one', value=1) | ||
DBSession.add(model) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700); | ||
body { | ||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
font-weight: 300; | ||
color: #ffffff; | ||
background: #bc2131; | ||
} | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
font-weight: 300; | ||
} | ||
p { | ||
font-weight: 300; | ||
} | ||
.font-normal { | ||
font-weight: 400; | ||
} | ||
.font-semi-bold { | ||
font-weight: 600; | ||
} | ||
.font-bold { | ||
font-weight: 700; | ||
} | ||
.starter-template { | ||
margin-top: 250px; | ||
} | ||
.starter-template .content { | ||
margin-left: 10px; | ||
} | ||
.starter-template .content h1 { | ||
margin-top: 10px; | ||
font-size: 60px; | ||
} | ||
.starter-template .content h1 .smaller { | ||
font-size: 40px; | ||
color: #f2b7bd; | ||
} | ||
.starter-template .content .lead { | ||
font-size: 25px; | ||
color: #f2b7bd; | ||
} | ||
.starter-template .content .lead .font-normal { | ||
color: #ffffff; | ||
} | ||
.starter-template .links { | ||
float: right; | ||
right: 0; | ||
margin-top: 125px; | ||
} | ||
.starter-template .links ul { | ||
display: block; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
.starter-template .links ul li { | ||
list-style: none; | ||
display: inline; | ||
margin: 0 10px; | ||
} | ||
.starter-template .links ul li:first-child { | ||
margin-left: 0; | ||
} | ||
.starter-template .links ul li:last-child { | ||
margin-right: 0; | ||
} | ||
.starter-template .links ul li.current-version { | ||
color: #f2b7bd; | ||
font-weight: 400; | ||
} | ||
.starter-template .links ul li a { | ||
color: #ffffff; | ||
} | ||
.starter-template .links ul li a:hover { | ||
text-decoration: underline; | ||
} | ||
.starter-template .links ul li .icon-muted { | ||
color: #eb8b95; | ||
margin-right: 5px; | ||
} | ||
.starter-template .links ul li:hover .icon-muted { | ||
color: #ffffff; | ||
} | ||
.starter-template .copyright { | ||
margin-top: 10px; | ||
font-size: 0.9em; | ||
color: #f2b7bd; | ||
text-transform: lowercase; | ||
float: right; | ||
right: 0; | ||
} | ||
@media (max-width: 1199px) { | ||
.starter-template .content h1 { | ||
font-size: 45px; | ||
} | ||
.starter-template .content h1 .smaller { | ||
font-size: 30px; | ||
} | ||
.starter-template .content .lead { | ||
font-size: 20px; | ||
} | ||
} | ||
@media (max-width: 991px) { | ||
.starter-template { | ||
margin-top: 0; | ||
} | ||
.starter-template .logo { | ||
margin: 40px auto; | ||
} | ||
.starter-template .content { | ||
margin-left: 0; | ||
text-align: center; | ||
} | ||
.starter-template .content h1 { | ||
margin-bottom: 20px; | ||
} | ||
.starter-template .links { | ||
float: none; | ||
text-align: center; | ||
margin-top: 60px; | ||
} | ||
.starter-template .copyright { | ||
float: none; | ||
text-align: center; | ||
} | ||
} | ||
@media (max-width: 767px) { | ||
.starter-template .content h1 .smaller { | ||
font-size: 25px; | ||
display: block; | ||
} | ||
.starter-template .content .lead { | ||
font-size: 16px; | ||
} | ||
.starter-template .links { | ||
margin-top: 40px; | ||
} | ||
.starter-template .links ul li { | ||
display: block; | ||
margin: 0; | ||
} | ||
.starter-template .links ul li .icon-muted { | ||
display: none; | ||
} | ||
.starter-template .copyright { | ||
margin-top: 20px; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.