-
Notifications
You must be signed in to change notification settings - Fork 0
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 dd4019a
Showing
1,202 changed files
with
47,283 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,97 @@ | ||
import glob | ||
import os | ||
import unittest | ||
|
||
import coverage | ||
|
||
|
||
from flask import jsonify | ||
from flask_fixtures import load_fixtures | ||
|
||
from flask_fixtures.loaders import JSONLoader | ||
from flask_script import Manager | ||
from flask_migrate import MigrateCommand | ||
|
||
from project.server import app, MigrationManager | ||
from project.server.config import config | ||
from project.server.managers import database | ||
from project.server.managers.schema import get_ulm | ||
|
||
manager = Manager(app) | ||
# migrations | ||
manager.add_command('db', MigrateCommand) | ||
|
||
|
||
COV = coverage.coverage( | ||
branch=True, | ||
include='project/*', | ||
omit=[ | ||
'project/tests/*', | ||
'project/server/config.py', | ||
'project/server/*/__init__.py' | ||
] | ||
) | ||
COV.start() | ||
|
||
|
||
|
||
@app.route('/start_GPU') | ||
def GPU_startup(): | ||
os.system('bash StartVM.sh') | ||
return jsonify("GPU VM is start in 5 minutes") | ||
|
||
@app.route('/stop_GPU') | ||
def GPU_stop(): | ||
os.system('bash StopVM.sh') | ||
return jsonify("GPU VM is stop") | ||
|
||
@manager.command | ||
def test(): | ||
"""Runs the unit tests without test coverage.""" | ||
tests = unittest.TestLoader().discover('project/tests', pattern='test*.py') | ||
result = unittest.TextTestRunner(verbosity=2).run(tests) | ||
if result.wasSuccessful(): | ||
return 0 | ||
return 1 | ||
|
||
|
||
@manager.command | ||
def cov(): | ||
"""Runs the unit tests with coverage.""" | ||
tests = unittest.TestLoader().discover('project/tests') | ||
result = unittest.TextTestRunner(verbosity=2).run(tests) | ||
if result.wasSuccessful(): | ||
COV.stop() | ||
COV.save() | ||
print('Coverage Summary:') | ||
COV.report() | ||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
covdir = os.path.join(basedir, 'tmp/coverage') | ||
COV.html_report(directory=covdir) | ||
print('HTML version: file://%s/index.html' % covdir) | ||
COV.erase() | ||
return 0 | ||
return 1 | ||
|
||
|
||
@manager.command | ||
def create_db(): | ||
"""Creates the db tables.""" | ||
database.db.create_all() | ||
get_ulm() | ||
for fixture_file in glob.glob(config.DevelopmentConfig.FIXTURES_DIRS + '/*.json'): | ||
fixtures = JSONLoader().load(fixture_file) | ||
load_fixtures(database.db, fixtures) | ||
MigrationManager().stamp_db() | ||
|
||
|
||
@manager.command | ||
def drop_db(): | ||
"""Drops the db tables.""" | ||
database.db.reflect() | ||
database.db.drop_all() | ||
print('Dropped the database') | ||
|
||
|
||
if __name__ == "__main__": | ||
manager.run() |
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,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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,97 @@ | ||
import glob | ||
import os | ||
import unittest | ||
|
||
import coverage | ||
|
||
|
||
from flask import jsonify | ||
from flask_fixtures import load_fixtures | ||
|
||
from flask_fixtures.loaders import JSONLoader | ||
from flask_script import Manager | ||
from flask_migrate import MigrateCommand | ||
|
||
from project.server import app, MigrationManager | ||
from project.server.config import config | ||
from project.server.managers import database | ||
from project.server.managers.schema import get_ulm | ||
|
||
manager = Manager(app) | ||
# migrations | ||
manager.add_command('db', MigrateCommand) | ||
|
||
|
||
COV = coverage.coverage( | ||
branch=True, | ||
include='project/*', | ||
omit=[ | ||
'project/tests/*', | ||
'project/server/config.py', | ||
'project/server/*/__init__.py' | ||
] | ||
) | ||
COV.start() | ||
|
||
|
||
|
||
@app.route('/start_GPU') | ||
def GPU_startup(): | ||
os.system('bash StartVM.sh') | ||
return jsonify("GPU VM is start in 5 minutes") | ||
|
||
@app.route('/stop_GPU') | ||
def GPU_stop(): | ||
os.system('bash StopVM.sh') | ||
return jsonify("GPU VM is stop") | ||
|
||
@manager.command | ||
def test(): | ||
"""Runs the unit tests without test coverage.""" | ||
tests = unittest.TestLoader().discover('project/tests', pattern='test*.py') | ||
result = unittest.TextTestRunner(verbosity=2).run(tests) | ||
if result.wasSuccessful(): | ||
return 0 | ||
return 1 | ||
|
||
|
||
@manager.command | ||
def cov(): | ||
"""Runs the unit tests with coverage.""" | ||
tests = unittest.TestLoader().discover('project/tests') | ||
result = unittest.TextTestRunner(verbosity=2).run(tests) | ||
if result.wasSuccessful(): | ||
COV.stop() | ||
COV.save() | ||
print('Coverage Summary:') | ||
COV.report() | ||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
covdir = os.path.join(basedir, 'tmp/coverage') | ||
COV.html_report(directory=covdir) | ||
print('HTML version: file://%s/index.html' % covdir) | ||
COV.erase() | ||
return 0 | ||
return 1 | ||
|
||
|
||
@manager.command | ||
def create_db(): | ||
"""Creates the db tables.""" | ||
database.db.create_all() | ||
get_ulm() | ||
for fixture_file in glob.glob(config.DevelopmentConfig.FIXTURES_DIRS + '/*.json'): | ||
fixtures = JSONLoader().load(fixture_file) | ||
load_fixtures(database.db, fixtures) | ||
MigrationManager().stamp_db() | ||
|
||
|
||
@manager.command | ||
def drop_db(): | ||
"""Drops the db tables.""" | ||
database.db.reflect() | ||
database.db.drop_all() | ||
print('Dropped the database') | ||
|
||
|
||
if __name__ == "__main__": | ||
manager.run() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 89b1bb24f56735532d217535f3978742 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
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,7 @@ | ||
app module | ||
========== | ||
|
||
.. automodule:: app | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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,39 @@ | ||
.. LIYO-DOC documentation master file, created by | ||
sphinx-quickstart on Fri Sep 18 23:52:02 2020. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to LIYO-DOC's documentation! | ||
==================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 20 | ||
:caption: Contents: | ||
index | ||
modules | ||
app | ||
project | ||
project.server.config | ||
project.server.controllers | ||
project.server.controllers.v1 | ||
project.server.decorators | ||
project.server.encoders | ||
project.server.factories | ||
project.server.handlers | ||
project.server.helpers | ||
project.server.managers | ||
project.server.models | ||
project.server.objects | ||
project.server | ||
project.tests | ||
project.tests.v1 | ||
side_script | ||
|
||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
29 changes: 29 additions & 0 deletions
29
g/docs/build/html/_sources/mimi.project.server.config.rst.txt
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,29 @@ | ||
project.server.config package | ||
============================= | ||
|
||
Submodules | ||
---------- | ||
|
||
project.server.config.config module | ||
----------------------------------- | ||
|
||
.. automodule:: project.server.config.config | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
project.server.config.routes module | ||
----------------------------------- | ||
|
||
.. automodule:: project.server.config.routes | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: project.server.config | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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,9 @@ | ||
mimi | ||
==== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
app | ||
project | ||
side_script |
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,19 @@ | ||
project package | ||
=============== | ||
|
||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
project.server | ||
project.tests | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: project | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
18 changes: 18 additions & 0 deletions
18
g/docs/build/html/_sources/project.server.controllers.rst.txt
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,18 @@ | ||
project.server.controllers package | ||
================================== | ||
|
||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
project.server.controllers.v1 | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: project.server.controllers | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
Oops, something went wrong.