Skip to content

Commit

Permalink
Merge pull request venmo#18 from yoyowallet/consistent-imports
Browse files Browse the repository at this point in the history
Use relative imports
  • Loading branch information
jianyuan authored Jan 31, 2018
2 parents b016683 + 052de5b commit a3acc14
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
6 changes: 3 additions & 3 deletions business_rules/engine.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import inspect
import logging

import utils
from business_rules.models import ConditionResult
from util import method_type
from . import utils
from .fields import FIELD_NO_INPUT
from .models import ConditionResult
from .util import method_type

logger = logging.getLogger(__name__)

Expand Down
15 changes: 8 additions & 7 deletions business_rules/operators.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import calendar
import inspect
import re
from datetime import date, datetime, time
from decimal import Decimal
from functools import wraps
from datetime import datetime, date, time
from six import string_types, integer_types
import calendar

from .fields import (
FIELD_TEXT, FIELD_NUMERIC, FIELD_NO_INPUT, FIELD_SELECT, FIELD_SELECT_MULTIPLE, FIELD_DATETIME, FIELD_TIME
)
from .utils import fn_name_to_pretty_label, float_to_decimal
from six import integer_types, string_types

from .fields import (FIELD_DATETIME, FIELD_NO_INPUT, FIELD_NUMERIC,
FIELD_SELECT, FIELD_SELECT_MULTIPLE, FIELD_TEXT,
FIELD_TIME)
from .utils import float_to_decimal, fn_name_to_pretty_label


class BaseType(object):
Expand Down
7 changes: 4 additions & 3 deletions business_rules/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import inspect
from decimal import Decimal, Inexact, Context
from decimal import Context, Decimal, Inexact

import fields, engine
from util import method_type
from .util import method_type


def fn_name_to_pretty_label(name):
Expand Down Expand Up @@ -56,6 +55,8 @@ def float_to_decimal(f):


def get_valid_fields():
from . import fields

valid_fields = [getattr(fields, f) for f in dir(fields) if f.startswith("FIELD_")]
return valid_fields

Expand Down
18 changes: 5 additions & 13 deletions business_rules/variables.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import inspect

from typing import List, Callable, Type

import utils
from .operators import (
BaseType,
NumericType,
StringType,
BooleanType,
SelectType,
SelectMultipleType,
DateTimeType,
TimeType,
)
from typing import Callable, List, Type # noqa: F401

from . import utils
from .operators import (BaseType, BooleanType, DateTimeType, NumericType,
SelectMultipleType, SelectType, StringType, TimeType)
from .utils import fn_name_to_pretty_label


Expand Down

0 comments on commit a3acc14

Please sign in to comment.