Skip to content

Commit

Permalink
Reformat import statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mitaa committed Sep 20, 2024
1 parent e7f827f commit 14ab190
Show file tree
Hide file tree
Showing 20 changed files with 224 additions and 48 deletions.
6 changes: 5 additions & 1 deletion src/production_planner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@

from docopt import docopt

from textual.app import App, SystemCommand, ComposeResult
from textual.app import (
App,
SystemCommand,
ComposeResult
)
from textual.screen import Screen
from textual.widgets import Footer
from textual.reactive import reactive
Expand Down
10 changes: 8 additions & 2 deletions src/production_planner/cells/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ._cells import Cell, SetCellValue, Bounds, EmptyCell, EditableCell, NumericEditaleCell

from ._cells import (
Cell,
SetCellValue,
Bounds,
EmptyCell,
EditableCell,
NumericEditaleCell,
)
from .producer import ProducerCell
from .recipe import RecipeCell
from .count import CountCell
Expand Down
7 changes: 5 additions & 2 deletions src/production_planner/cells/_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ..core import get_path, set_path, SummaryNode

from ..core import (
get_path,
set_path,
SummaryNode,
)
from dataclasses import dataclass

from rich.text import Text
Expand Down
13 changes: 11 additions & 2 deletions src/production_planner/cells/_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
from textual import on
from textual.screen import Screen
from textual.app import ComposeResult
from textual.containers import Container, Horizontal
from textual.widgets import DataTable, Header, Footer, Input, Static
from textual.containers import (
Container,
Horizontal,
)
from textual.widgets import (
DataTable,
Header,
Footer,
Input,
Static,
)
from textual.coordinate import Coordinate
from textual import events

Expand Down
6 changes: 5 additions & 1 deletion src/production_planner/cells/clockrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


from ._cells import NumericEditaleCell, Bounds, CellValue
from ._cells import (
NumericEditaleCell,
Bounds,
CellValue,
)
from ..core import smartround


Expand Down
6 changes: 5 additions & 1 deletion src/production_planner/cells/ingredient.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from .. import core
from ._cells import NumericEditaleCell, Bounds, CellValue
from ._cells import (
NumericEditaleCell,
Bounds,
CellValue,
)
from ..core import smartround
from ..core import SummaryNode
from ..core import Ingredient
Expand Down
5 changes: 4 additions & 1 deletion src/production_planner/cells/mk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ._cells import NumericEditaleCell, Bounds
from ._cells import (
NumericEditaleCell,
Bounds,
)


class MkCell(NumericEditaleCell):
Expand Down
5 changes: 4 additions & 1 deletion src/production_planner/cells/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ._cells import Cell, CellValue
from ._cells import (
Cell,
CellValue,
)
from ..core import get_path

import math
Expand Down
12 changes: 10 additions & 2 deletions src/production_planner/cells/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ._cells import EditableCell
from ._selector import Sidebar, FilteredListSelector
from ._selector import (
Sidebar,
FilteredListSelector,
)
from .. import core
from ..core import SummaryNode, NodeInstance, Node, Recipe
from ..core import (
SummaryNode,
NodeInstance,
Node,
Recipe,
)

from textual.widgets import DataTable

Expand Down
11 changes: 8 additions & 3 deletions src/production_planner/cells/purity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ._cells import NumericEditaleCell, Bounds, SetCellValue
from ._cells import (
NumericEditaleCell,
Bounds,
SetCellValue,
)
from ..core import Purity

from textual.app import ComposeResult
from textual.screen import ModalScreen
from textual.containers import Container
from textual.widgets import DataTable, Footer
from textual.widgets import (
DataTable,
)
from textual.coordinate import Coordinate


Expand All @@ -31,7 +37,6 @@ class PuritySelector(ModalScreen[Purity]):

def compose(self) -> ComposeResult:
yield Container(DataTable())
# yield Footer()

def on_mount(self) -> None:
def bool_to_mark(a, mark="x"):
Expand Down
32 changes: 28 additions & 4 deletions src/production_planner/cells/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from ._cells import EditableCell, SetCellValue, CellValue
from ._selector import StringifyFilter, FilteredListSelector, Sidebar
from ._cells import (
EditableCell,
SetCellValue,
CellValue,
)
from ._selector import (
StringifyFilter,
FilteredListSelector,
Sidebar,
)
from .producer import ProducerCell
from .. import core
from .. core import ModuleFile
from ..core import CONFIG, PRODUCER_NAMES, PRODUCER_MAP, Recipe, Ingredient, all_recipes_producer, Node, NodeInstance
from ..core import (
CONFIG,
PRODUCER_NAMES,
PRODUCER_MAP,
Recipe,
Ingredient,
all_recipes_producer,
Node,
NodeInstance,
)
from ..core import MODULE_PRODUCER
from ..core import smartround

Expand All @@ -20,7 +37,14 @@
from textual.app import ComposeResult
from textual.containers import Horizontal
from textual.widgets.selection_list import Selection
from textual.widgets import SelectionList, DataTable, Header, Footer, Select, Input
from textual.widgets import (
SelectionList,
DataTable,
Header,
Footer,
Select,
Input,
)

from rich.style import Style
from rich.text import Text
Expand Down
35 changes: 30 additions & 5 deletions src/production_planner/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,38 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from .link import CONFIG, DataFile, PortableFile, ModuleFile, ModuleFile, ensure_keys
from .recipe import Ingredient, Recipe
from .link import (
CONFIG,
DataFile,
PortableFile,
ModuleFile,
ModuleFile,
ensure_keys,
)
from .recipe import (
Ingredient,
Recipe,
)
from . import producer
from .producer import Producer, ProducerEncoder, PRODUCERS, PRODUCER_NAMES, PRODUCER_MAP, PRODUCER_ALIASES, MODULE_PRODUCER
from .producer import (
Producer,
ProducerEncoder,
PRODUCERS,
PRODUCER_NAMES,
PRODUCER_MAP,
PRODUCER_ALIASES,
MODULE_PRODUCER,
)
from .module import _ModuleProducer
from .node import Purity, Node
from .nodetree import NodeInstance, SummaryNode, NodeTree
from .node import (
Purity,
Node,
)
from .nodetree import (
NodeInstance,
SummaryNode,
NodeTree,
)
from . import marshal

import json
Expand Down
16 changes: 13 additions & 3 deletions src/production_planner/core/marshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from .link import ModuleFile
from .recipe import Ingredient, Recipe
from .recipe import (
Ingredient,
Recipe,
)
from .producer import PRODUCER_MAP
from .module import MODULE_PRODUCER
from .node import Purity, Node
from .nodetree import SummaryNode, NodeInstance, NodeTree
from .node import (
Purity,
Node,
)
from .nodetree import (
SummaryNode,
NodeInstance,
NodeTree,
)

import yaml

Expand Down
5 changes: 4 additions & 1 deletion src/production_planner/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from .recipe import Recipe, Ingredient
from .recipe import (
Recipe,
Ingredient,
)
from .producer import EMPTY_PRODUCER

import math
Expand Down
43 changes: 34 additions & 9 deletions src/production_planner/datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,45 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from . import core
from .core import PRODUCERS, MODULE_PRODUCER
from .core import DataFile, ModuleFile, Node, SummaryNode, NodeInstance, NodeTree
from .cells import Cell, SetCellValue
from .cells import ProducerCell, RecipeCell, CountCell, MkCell, PurityCell, ClockRateCell, PowerCell, IngredientCell
from .screens import SelectDataFile, SaveDataFile
from .core import (
PRODUCERS,
MODULE_PRODUCER
)
from .core import (
DataFile,
ModuleFile,
Node,
SummaryNode,
NodeInstance,
NodeTree
)
from .cells import (
Cell,
SetCellValue
)
from .cells import (
ProducerCell,
RecipeCell,
CountCell,
MkCell,
PurityCell,
ClockRateCell,
PowerCell,
IngredientCell
)
from .screens import (
SelectDataFile,
SaveDataFile
)

import os
from dataclasses import dataclass
from pathlib import Path
from copy import copy
from typing import Optional, Tuple
from typing import (
Optional,
Tuple
)

from textual.widgets import DataTable
from textual.coordinate import Coordinate
Expand All @@ -23,8 +50,6 @@
from rich.style import Style
from rich.color import Color

import yaml


@dataclass
class Selection:
Expand Down
5 changes: 4 additions & 1 deletion src/production_planner/gamedata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
from pathlib import Path
from collections import OrderedDict
from dataclasses import dataclass
from typing import Optional, ClassVar
from typing import (
Optional,
ClassVar,
)


@dataclass
Expand Down
5 changes: 4 additions & 1 deletion src/production_planner/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from textual.events import Mount
from textual import widgets
from textual.widget import Widget
from textual.widgets._header import HeaderClockSpace, HeaderIcon, HeaderTitle
from textual.widgets._header import (
HeaderIcon,
HeaderTitle
)

from rich.text import Text

Expand Down
12 changes: 10 additions & 2 deletions src/production_planner/help/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@

from textual.app import ComposeResult
from textual.screen import Screen
from textual.containers import Container, ScrollableContainer
from textual.widgets import Header, Footer, Static, Input
from textual.containers import (
Container,
ScrollableContainer,
)
from textual.widgets import (
Header,
Footer,
Static,
Input,
)

from rich.markdown import Markdown

Expand Down
Loading

0 comments on commit 14ab190

Please sign in to comment.