-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
__author__ = "Jérôme Kieffer" | ||
__contact__ = "[email protected]" | ||
__license__ = "MIT" | ||
__date__ = "04/07/2023" | ||
__date__ = "07/10/2024" | ||
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" | ||
|
||
import os | ||
|
@@ -923,9 +923,12 @@ def clean_string(cls, input_string): | |
i += 1 | ||
return lines | ||
|
||
def __init__(self, content, convention="PILATUS_1.2"): | ||
def __init__(self, content=None, convention="PILATUS_1.2"): | ||
assert convention == "PILATUS_1.2" | ||
self._dict = self._parse(content) | ||
if content: | ||
self._dict = self._parse(content) | ||
else: | ||
self._dict = OrderedDict() | ||
|
||
def __repr__(self): | ||
lines = [] | ||
|
@@ -973,3 +976,6 @@ def __setitem__(self, key, value): | |
|
||
def __getitem__(self, key): | ||
return self._dict[key] | ||
|
||
def __contains__(self, key): | ||
return key in self._dict |