chore: fix imports for master service
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[project]
|
||||
name = "slc-hla-framework"
|
||||
name = "agebd"
|
||||
version = "0.1.0"
|
||||
description = "SLS HLA Framework"
|
||||
readme = "README.md"
|
||||
@@ -9,8 +9,7 @@ authors = [
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
"h5py>=3.14.0",
|
||||
"numpy>=2.0.2",
|
||||
# TODO: use systems epics
|
||||
"pyepics>=3.5.8",
|
||||
"typer>=0.23.2",
|
||||
]
|
||||
@@ -40,7 +39,6 @@ package = true
|
||||
include = [
|
||||
"src/**/*.py",
|
||||
"tests/**/*.py",
|
||||
"AGEBD-SERVICE-TEMPLATE.py"
|
||||
]
|
||||
line-length = 100
|
||||
|
||||
|
||||
@@ -24,3 +24,26 @@ def init_logging(log_level: LogLevel):
|
||||
Configure logging -- set log level
|
||||
"""
|
||||
logging.basicConfig(level=getattr(logging, log_level.upper()))
|
||||
|
||||
|
||||
def printgetversion(filehandle):
|
||||
"""
|
||||
Print and get version identifier based on the last
|
||||
modified time of the filehandle.
|
||||
"""
|
||||
|
||||
# Get the path of the current script
|
||||
script_path = os.path.abspath(filehandle)
|
||||
|
||||
# Get the last modification time (in seconds since the epoch)
|
||||
last_modified_timestamp = os.path.getmtime(script_path)
|
||||
|
||||
# Convert to a datetime object
|
||||
last_modified_datetime = datetime.fromtimestamp(last_modified_timestamp)
|
||||
|
||||
# Format the datetime object as "YYYY-MM-DD HH:MM:SS"
|
||||
formatted_time = last_modified_datetime.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
print(f"Last modified: {formatted_time}")
|
||||
|
||||
return formatted_time[:10]
|
||||
|
||||
@@ -15,8 +15,8 @@ Usage: screen -S MASTER bash -c 'source /opt/gfa/python ; python AGEBD-SERVICE-M
|
||||
|
||||
import traceback
|
||||
import html
|
||||
import numpy as np
|
||||
from AGEBD import printgetversion, pvlink as PV
|
||||
from agebd.pv import PVLink as PV
|
||||
from agebd.utils import printgetversion
|
||||
from time import sleep, perf_counter
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
@@ -305,4 +305,4 @@ else:
|
||||
# confirm unknown exit
|
||||
pvs.status.put('unknown crash')
|
||||
print('Service crashed without exception!')
|
||||
print(traceback.format_exc())
|
||||
print(traceback.format_exc())
|
||||
|
||||
Reference in New Issue
Block a user