forked from expo/troggle
ruf cleanup imports, bigly.
This commit is contained in:
@@ -1,24 +1,12 @@
|
||||
import datetime
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import resource
|
||||
import string
|
||||
import subprocess
|
||||
from decimal import Decimal, getcontext
|
||||
from decimal import getcontext
|
||||
from pathlib import Path
|
||||
from urllib.parse import urljoin
|
||||
|
||||
getcontext().prec = 2 # use 2 significant figures for decimal calculations
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.template import Context, loader
|
||||
from django.urls import reverse
|
||||
|
||||
import settings
|
||||
|
||||
@@ -156,7 +144,7 @@ def write_and_commit(files, message):
|
||||
)
|
||||
else:
|
||||
print(f"No change {filepah}")
|
||||
cp_commit = subprocess.run([git, "commit", "-m", message], cwd=cwd, capture_output=True, text=True)
|
||||
subprocess.run([git, "commit", "-m", message], cwd=cwd, capture_output=True, text=True)
|
||||
cp_status = subprocess.run([git, "status"], cwd=cwd, capture_output=True, text=True)
|
||||
# This produces return code = 1 if it commits OK, but when the repo still needs to be pushed to origin/expoweb
|
||||
if cp_status.stdout.split("\n")[-2] != "nothing to commit, working tree clean":
|
||||
@@ -265,9 +253,9 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}):
|
||||
print(f" !! - lookupAttribs:{lookupAttribs}\n !! - nonLookupAttribs:{nonLookupAttribs}")
|
||||
raise
|
||||
try:
|
||||
msg = str(instance)
|
||||
str(instance)
|
||||
except:
|
||||
msg = f"FAULT getting __str__ for instance with lookupattribs: {lookupAttribs}:"
|
||||
pass
|
||||
if created:
|
||||
logging.info(str(instance) + " was just added to the database for the first time. \n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user