From 06fdeedf20819bfac8de9a648788fdb16bf665b5 Mon Sep 17 00:00:00 2001 From: SAIKAT KARMAKAR Date: Mon, 9 Oct 2023 01:17:40 +0100 Subject: [PATCH] late night changes --- src/fds/contracts/ENSRegistry.py | 24 +++++++++++++++ src/fds/contracts/ens_registry.py | 0 src/fds/fds_contract.py | 23 ++++++++++++++ src/fds/fds_utils.py | 50 +++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 src/fds/contracts/ENSRegistry.py delete mode 100644 src/fds/contracts/ens_registry.py diff --git a/src/fds/contracts/ENSRegistry.py b/src/fds/contracts/ENSRegistry.py new file mode 100644 index 0000000..da77c9e --- /dev/null +++ b/src/fds/contracts/ENSRegistry.py @@ -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 . + +handles crypto +""" + + +class ENSRegistry: + def __init__(self): + ... diff --git a/src/fds/contracts/ens_registry.py b/src/fds/contracts/ens_registry.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/fds/fds_contract.py b/src/fds/fds_contract.py index e69de29..a87cbde 100644 --- a/src/fds/fds_contract.py +++ b/src/fds/fds_contract.py @@ -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 . + +handles crypto +""" + + +class FDSContract: + pass diff --git a/src/fds/fds_utils.py b/src/fds/fds_utils.py index e69de29..021aacb 100644 --- a/src/fds/fds_utils.py +++ b/src/fds/fds_utils.py @@ -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 . + +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)