Replace uuid().hex with just uuid()
This commit is contained in:
parent
059360ac76
commit
2b90829020
6 changed files with 8 additions and 8 deletions
|
|
@ -129,7 +129,7 @@ class CaptureObject(object):
|
||||||
"""Create a new StreamObject, to manage capture data."""
|
"""Create a new StreamObject, to manage capture data."""
|
||||||
|
|
||||||
# Store a nice ID
|
# Store a nice ID
|
||||||
self.id = uuid.uuid4().hex #: str: Unique capture ID
|
self.id = uuid.uuid4() #: str: Unique capture ID
|
||||||
logging.debug("Created StreamObject {}".format(self.id))
|
logging.debug("Created StreamObject {}".format(self.id))
|
||||||
self.timestring = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
self.timestring = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class TaskThread(threading.Thread):
|
||||||
)
|
)
|
||||||
|
|
||||||
# A UUID for the TaskThread (not the same as the threading.Thread ident)
|
# A UUID for the TaskThread (not the same as the threading.Thread ident)
|
||||||
self._ID = uuid.uuid4().hex # Task ID
|
self._ID = uuid.uuid4() # Task ID
|
||||||
|
|
||||||
# Make _target, _args, and _kwargs available to the subclass
|
# Make _target, _args, and _kwargs available to the subclass
|
||||||
self._target = target
|
self._target = target
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class Microscope:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Initial attributes
|
# Initial attributes
|
||||||
self.id = uuid.uuid4().hex
|
self.id = uuid.uuid4()
|
||||||
self.name = self.id
|
self.name = self.id
|
||||||
self.fov = [0, 0]
|
self.fov = [0, 0]
|
||||||
self.camera = None
|
self.camera = None
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ class ScanPlugin(MicroscopePlugin):
|
||||||
basename = generate_basename()
|
basename = generate_basename()
|
||||||
|
|
||||||
# Generate a stack ID
|
# Generate a stack ID
|
||||||
scan_id = uuid.uuid4().hex
|
scan_id = uuid.uuid4()
|
||||||
|
|
||||||
# Store initial position
|
# Store initial position
|
||||||
initial_position = self.microscope.stage.position
|
initial_position = self.microscope.stage.position
|
||||||
|
|
@ -288,7 +288,7 @@ class ScanPlugin(MicroscopePlugin):
|
||||||
|
|
||||||
# Generate a stack ID
|
# Generate a stack ID
|
||||||
if not scan_id:
|
if not scan_id:
|
||||||
scan_id = uuid.uuid4().hex
|
scan_id = uuid.uuid4()
|
||||||
|
|
||||||
# Add scan metadata
|
# Add scan metadata
|
||||||
if not "time" in metadata:
|
if not "time" in metadata:
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ class ZipBuilderPlugin(MicroscopePlugin):
|
||||||
# Update task progress
|
# Update task progress
|
||||||
update_task_progress(int((index / n_files) * 100))
|
update_task_progress(int((index / n_files) * 100))
|
||||||
|
|
||||||
session_id = uuid.uuid4().hex
|
session_id = uuid.uuid4()
|
||||||
# self.session_zips[session_id] = fp
|
# self.session_zips[session_id] = fp
|
||||||
self.session_zips[session_id] = {
|
self.session_zips[session_id] = {
|
||||||
"id": session_id,
|
"id": session_id,
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ def tile(
|
||||||
basename = generate_basename()
|
basename = generate_basename()
|
||||||
|
|
||||||
# Generate a stack ID
|
# Generate a stack ID
|
||||||
scan_id = uuid.uuid4().hex
|
scan_id = uuid.uuid4()
|
||||||
|
|
||||||
# Store initial position
|
# Store initial position
|
||||||
initial_position = microscope.stage.position
|
initial_position = microscope.stage.position
|
||||||
|
|
@ -296,7 +296,7 @@ def stack(
|
||||||
|
|
||||||
# Generate a stack ID
|
# Generate a stack ID
|
||||||
if not scan_id:
|
if not scan_id:
|
||||||
scan_id = uuid.uuid4().hex
|
scan_id = uuid.uuid4()
|
||||||
|
|
||||||
# Add scan metadata
|
# Add scan metadata
|
||||||
if not "time" in metadata:
|
if not "time" in metadata:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue