Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Jul 13, 2024
1 parent c00f991 commit 3b13e56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/meshapi/tests/test_update_panos_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
from django.test import Client, TestCase

from meshapi.models import Building, Install, Member
from meshapi.views.panoramas import PanoramaTitle, BadPanoramaTitle, set_panoramas, get_head_tree_sha, list_files_in_git_directory
from meshapi.views.panoramas import (
BadPanoramaTitle,
PanoramaTitle,
get_head_tree_sha,
list_files_in_git_directory,
set_panoramas,
)

from .sample_data import sample_building, sample_install, sample_member

Expand Down
8 changes: 5 additions & 3 deletions src/meshapi/views/panoramas.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import logging
import os
from dataclasses import dataclass
from pathlib import Path
from typing import Union, dataclass_transform
from dataclasses import dataclass

import requests
from meshapi.models.building import Building
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.request import Request
from rest_framework.response import Response

from meshapi.models import Install
from meshapi.models.building import Building
from meshapi.models.node import Node
from meshapi.permissions import HasPanoramaUpdatePermission
from meshapi.util.constants import DEFAULT_EXTERNAL_API_TIMEOUT_SECONDS
Expand Down Expand Up @@ -40,7 +40,7 @@
class PanoramaTitle:
filename: str
is_nn: bool
number: str # Confusingly, this is not a number.
number: str # Confusingly, this is not a number.
label: str

def __str__(self) -> str:
Expand Down Expand Up @@ -158,6 +158,7 @@ def sync_github_panoramas() -> tuple[int, list[str]]:
panos: dict[str, list[PanoramaTitle]] = build_pano_dict(panorama_files)
return set_panoramas(panos)


# Helper function to update panorama list. One day, this should probably
# clobber the panoramas already saved (since a robot should probably be
# controlling this), but for now, it either appends to the current list,
Expand All @@ -180,6 +181,7 @@ def save_building_panoramas(building: Building, panorama_titles: list[PanoramaTi

return len(panoramas)


# Iterate through the panoramas we're aware of, looking up buildings and setting
# panoramas on them as appropriate
def set_panoramas(panos: dict[str, list[PanoramaTitle]]) -> tuple[int, list[str]]:
Expand Down

0 comments on commit 3b13e56

Please sign in to comment.