Skip to content

Commit

Permalink
update import statements to match formatting style
Browse files Browse the repository at this point in the history
  • Loading branch information
asampat3090 committed Apr 8, 2018
1 parent a3cd11d commit aa15c60
Show file tree
Hide file tree
Showing 30 changed files with 57 additions and 14 deletions.
1 change: 1 addition & 0 deletions datmo/cli/command/test/test_project.py
Expand Up @@ -15,6 +15,7 @@
import os
import shutil
import tempfile

from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand

Expand Down
1 change: 1 addition & 0 deletions datmo/cli/command/test/test_snapshot.py
Expand Up @@ -14,6 +14,7 @@

import shutil
import tempfile

from datmo.cli.driver.helper import Helper
from datmo.cli.command.project import ProjectCommand
from datmo.cli.command.snapshot import SnapshotCommand
Expand Down
1 change: 1 addition & 0 deletions datmo/cli/driver/helper.py
Expand Up @@ -6,6 +6,7 @@
import sys
import importlib
import inspect

from datmo.util.i18n import get as _
from datmo.util.exceptions import ArgumentException

Expand Down
3 changes: 2 additions & 1 deletion datmo/cli/driver/parser.py
@@ -1,5 +1,6 @@
import argparse
import sys
import argparse

from datmo.util.exceptions import UnrecognizedCLIArgument

class Parser(argparse.ArgumentParser):
Expand Down
1 change: 1 addition & 0 deletions datmo/cli/main.py
@@ -1,5 +1,6 @@
import os
import sys

from datmo.util.i18n import get as _
from datmo.cli.driver.helper import Helper
from datmo.cli.command.base import BaseCommand
Expand Down
1 change: 1 addition & 0 deletions datmo/controller/base.py
@@ -1,4 +1,5 @@
import os

from datmo.storage.local.driver.driver_type import DriverType
from datmo.util.i18n import get as _
from datmo.util import get_class_contructor
Expand Down
2 changes: 1 addition & 1 deletion datmo/controller/environment/driver/test/test_dockerenv.py
Expand Up @@ -9,8 +9,8 @@
import tempfile
import shutil
import uuid
from ..dockerenv import DockerEnvironmentDriver

from datmo.controller.environment.driver.dockerenv import DockerEnvironmentDriver
from datmo.util.exceptions import EnvironmentInitFailed


Expand Down
17 changes: 17 additions & 0 deletions datmo/controller/environment/environment.py
Expand Up @@ -6,7 +6,24 @@
from datmo.util.exceptions import RequiredArgumentMissing, \
DoesNotExistException


class EnvironmentController(BaseController):
"""
EnvironmentController inherits from BaseController and manages business logic related to the
environment.
Methods
-------
create(dictionary)
Create an environment within the project
build(id)
Build the environment for use within the project
list()
List all environments within the project
delete(id)
Delete the specified environment from the project
"""
def __init__(self, home, dal_driver=None):
super(EnvironmentController, self).__init__(home, dal_driver)

Expand Down
2 changes: 1 addition & 1 deletion datmo/controller/environment/test/test_environment.py
Expand Up @@ -12,9 +12,9 @@
from datmo.controller.project import ProjectController
from datmo.controller.environment.environment import \
EnvironmentController

from datmo.util.exceptions import EntityNotFound


class TestEnvironmentController():
def setup_method(self):
# provide mountable tmp directory for docker
Expand Down
1 change: 1 addition & 0 deletions datmo/controller/file/driver/local.py
Expand Up @@ -9,6 +9,7 @@
from datmo.util.exceptions import DoesNotExistException, \
FileIOException, FileStructureException


class LocalFileDriver(object):
"""
This FileDriver handles the datmo file tree on the local system
Expand Down
3 changes: 2 additions & 1 deletion datmo/controller/model.py
Expand Up @@ -2,7 +2,8 @@

class ModelController(BaseController):
"""
Model Controller for functions to manage a model.
ModelController inherits from BaseController and manages business logic related to the
model.
# TODO: Enable multiple models per project
"""
Expand Down
1 change: 1 addition & 0 deletions datmo/controller/snapshot.py
Expand Up @@ -6,6 +6,7 @@
from datmo.util.exceptions import RequiredArgumentMissing, \
FileIOException


class SnapshotController(BaseController):
"""
SnapshotController inherits from BaseController and manages business logic related to snapshots
Expand Down
1 change: 1 addition & 0 deletions datmo/controller/task.py
Expand Up @@ -6,6 +6,7 @@
from datmo.controller.snapshot import SnapshotController
from datmo.util.exceptions import TaskRunException


class TaskController(BaseController):
"""
TaskController inherits from BaseController and manages business logic associated with tasks
Expand Down
4 changes: 2 additions & 2 deletions datmo/controller/test/test_base.py
Expand Up @@ -8,12 +8,12 @@
import shutil
import tempfile

from ..base import BaseController
from datmo.controller.base import BaseController
from datmo.controller.code.driver.git import GitCodeDriver

from datmo.util.exceptions import \
DatmoModelNotInitializedException


class TestBaseController():
def setup_method(self):
# provide mountable tmp directory for docker
Expand Down
1 change: 1 addition & 0 deletions datmo/controller/test/test_project.py
Expand Up @@ -10,6 +10,7 @@

from datmo.controller.project import ProjectController


class TestProjectController():
def setup_method(self):
# provide mountable tmp directory for docker
Expand Down
8 changes: 4 additions & 4 deletions datmo/controller/test/test_snapshot.py
Expand Up @@ -9,12 +9,12 @@
import shutil
import tempfile

from ..project import ProjectController
from ..environment.environment import EnvironmentController
from ..snapshot import SnapshotController

from datmo.controller.project import ProjectController
from datmo.controller.environment.environment import EnvironmentController
from datmo.controller.snapshot import SnapshotController
from datmo.util.exceptions import EntityNotFound


class TestSnapshotController():
def setup_method(self):
# provide mountable tmp directory for docker
Expand Down
1 change: 1 addition & 0 deletions datmo/entity/session.py
@@ -1,5 +1,6 @@
from datetime import datetime


class Session():
"""
Session is an entity object to represent a workspace to group tasks and snapshots
Expand Down
1 change: 1 addition & 0 deletions datmo/entity/snapshot.py
@@ -1,5 +1,6 @@
import os
from datetime import datetime

from datmo.util.file_storage import JSONKeyValueStore


Expand Down
1 change: 1 addition & 0 deletions datmo/entity/user.py
@@ -1,5 +1,6 @@
from datetime import datetime


class User():
"""
User is an entity object to represent a given user
Expand Down
1 change: 1 addition & 0 deletions datmo/storage/local/dal.py
Expand Up @@ -12,6 +12,7 @@
from datmo.entity.user import User
from datmo.util.exceptions import InputException


class LocalDAL():
"""
LocalDAL is a local DAL object that stores info locally. DAL stands for 'data access layer' and serves as a storage for
Expand Down
1 change: 1 addition & 0 deletions datmo/storage/local/driver/blitzdb_driver.py
@@ -1,5 +1,6 @@
from blitzdb import Document
from datetime import datetime

from datmo.util.exceptions import EntityNotFound, \
EntityCollectionNotFound, IncorrectTypeException
from datmo.storage.local.driver.driver_type import DriverType
Expand Down
1 change: 0 additions & 1 deletion datmo/storage/remote/dal.py
@@ -1,4 +1,3 @@

class RemoteDAL():
def __init__(self, driver):
self.driver = driver
Expand Down
2 changes: 1 addition & 1 deletion datmo/test/test_module_loader.py
Expand Up @@ -5,8 +5,8 @@
from __future__ import print_function
from __future__ import unicode_literals

from datmo.util import get_class_contructor

from ..util import get_class_contructor

class TestModuleLoader():
def test_loader(self):
Expand Down
4 changes: 3 additions & 1 deletion datmo/util/file_storage.py
Expand Up @@ -2,14 +2,16 @@
import io
import json
import yaml
from .exceptions import SaveSettingException, \

from datmo.util.exceptions import SaveSettingException, \
FileIOException

try:
to_unicode = unicode
except NameError:
to_unicode = str


class JSONKeyValueStore():
# TODO: add file locking
# https://stackoverflow.com/questions/186202/what-is-the-best-way-to-open-a-file-for-exclusive-access-in-python
Expand Down
2 changes: 2 additions & 0 deletions datmo/util/i18n.py
@@ -1,8 +1,10 @@
from past.builtins import basestring

from datmo.util.lang import get_lang

MESSAGES = get_lang()


def get(type, key, values=None):
if isinstance(values, dict) and len(values) > 0:
return MESSAGES[type][key].format(*values, **values)
Expand Down
1 change: 1 addition & 0 deletions datmo/util/misc_functions.py
Expand Up @@ -3,6 +3,7 @@
import logging
import textwrap
from glob import glob

from datmo.util.i18n import get as _
from datmo.util.exceptions import DoesNotExistException

Expand Down
2 changes: 2 additions & 0 deletions datmo/util/project_settings.py
@@ -1,6 +1,8 @@
import os

from datmo.util.file_storage import JSONKeyValueStore


class ProjectSettings():
def __init__(self, home):
self.home = home
Expand Down
3 changes: 2 additions & 1 deletion datmo/util/test/test_file_storage.py
Expand Up @@ -9,7 +9,8 @@
import tempfile
import os

from ..file_storage import JSONKeyValueStore
from datmo.util.file_storage import JSONKeyValueStore


class TestDatmoDAL():
def setup_class(self):
Expand Down
1 change: 1 addition & 0 deletions datmo/util/test/test_i18n.py
Expand Up @@ -7,6 +7,7 @@

from datmo.util.i18n import get


class Testi18n():

def test_get(self):
Expand Down
2 changes: 2 additions & 0 deletions datmo/util/user_settings.py
@@ -1,6 +1,8 @@
import os

from datmo.util.file_storage import JSONKeyValueStore


class UserSettings():
def __init__(self, home):
self.home = home
Expand Down

0 comments on commit aa15c60

Please sign in to comment.