Skip to content

Commit

Permalink
'DOC-HOST'
Browse files Browse the repository at this point in the history
  • Loading branch information
Denzel4 committed Sep 18, 2020
0 parents commit dd4019a
Show file tree
Hide file tree
Showing 1,202 changed files with 47,283 additions and 0 deletions.
97 changes: 97 additions & 0 deletions g/app.py
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()
20 changes: 20 additions & 0 deletions g/docs/Makefile
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)
97 changes: 97 additions & 0 deletions g/docs/app.py
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 added g/docs/build/doctrees/app.doctree
Binary file not shown.
Binary file added g/docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file added g/docs/build/doctrees/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added g/docs/build/doctrees/modules.doctree
Binary file not shown.
Binary file added g/docs/build/doctrees/project.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added g/docs/build/doctrees/project.server.doctree
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 added g/docs/build/doctrees/project.tests.doctree
Binary file not shown.
Binary file added g/docs/build/doctrees/project.tests.v1.doctree
Binary file not shown.
Binary file added g/docs/build/doctrees/side_script.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions g/docs/build/html/.buildinfo
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
7 changes: 7 additions & 0 deletions g/docs/build/html/_sources/app.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
app module
==========

.. automodule:: app
:members:
:undoc-members:
:show-inheritance:
39 changes: 39 additions & 0 deletions g/docs/build/html/_sources/index.rst.txt
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 g/docs/build/html/_sources/mimi.project.server.config.rst.txt
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:
9 changes: 9 additions & 0 deletions g/docs/build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mimi
====

.. toctree::
:maxdepth: 4

app
project
side_script
19 changes: 19 additions & 0 deletions g/docs/build/html/_sources/project.rst.txt
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 g/docs/build/html/_sources/project.server.controllers.rst.txt
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:

0 comments on commit dd4019a

Please sign in to comment.