-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
467e805
commit 06fdeed
Showing
4 changed files
with
97 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Copyright 2023 The FairDataSociety Authors | ||
This file is part of the FairDataSociety library. | ||
The FairDataSociety library is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
The FairDataSociety library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with the FairDataSociety library. If not, see <http:www.gnu.org/licenses/>. | ||
handles crypto | ||
""" | ||
|
||
|
||
class ENSRegistry: | ||
def __init__(self): | ||
... |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Copyright 2023 The FairDataSociety Authors | ||
This file is part of the FairDataSociety library. | ||
The FairDataSociety library is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
The FairDataSociety library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with the FairDataSociety library. If not, see <http:www.gnu.org/licenses/>. | ||
handles crypto | ||
""" | ||
|
||
|
||
class FDSContract: | ||
pass |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" | ||
Copyright 2023 The FairDataSociety Authors | ||
This file is part of the FairDataSociety library. | ||
The FairDataSociety library is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
The FairDataSociety library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with the FairDataSociety library. If not, see <http:www.gnu.org/licenses/>. | ||
handles crypto | ||
""" | ||
import os | ||
|
||
|
||
class Utils: | ||
@staticmethod | ||
def file_to_buffer(file): | ||
if os.name == "nt": # Windows | ||
with open(file, "rb") as f: | ||
return f.read() | ||
else: # Unix-based systems (Linux, macOS) | ||
with open(file, "rb") as f: | ||
return f.read() | ||
|
||
@staticmethod | ||
def file_to_string(file): | ||
if os.name == "nt": # Windows | ||
with open(file, "r") as f: | ||
return f.read() | ||
else: # Unix-based systems (Linux, macOS) | ||
with open(file, "r") as f: | ||
return f.read() | ||
|
||
|
||
if __name__ == "__main__": | ||
# Example usage: | ||
utils = Utils() | ||
|
||
buffer = utils.file_to_buffer("CHANGELOG.rst") | ||
string = utils.file_to_string("CHANGELOG.rst") | ||
print(string) | ||
print(buffer) |