New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link and Path fields added #109
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #109 +/- ##
==========================================
+ Coverage 99.47% 99.48% +0.01%
==========================================
Files 4 4
Lines 372 378 +6
Branches 58 58
==========================================
+ Hits 370 376 +6
Partials 2 2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sadrasabouri Thanks for your efforts 💯
JSON field shouldn't be dynamic (sometimes message
sometimes link
/path
)
I suggest replacing link
and path
with message
I think message field is necessary in some cases in which we return error message in |
samila/params.py
Outdated
@@ -28,6 +28,7 @@ | |||
SEED_UPPER_BOUND = 2**20 | |||
VALID_COLORS = list(dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS).keys()) | |||
NFT_STORAGE_API = "https://api.nft.storage/upload" | |||
NFT_STORAGE_LINK = "https://{}.ipfs.nftstorage.link/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest this format:
https://ipfs.io/ipfs/{}
samila/functions.py
Outdated
@@ -339,6 +342,7 @@ def save_data_file(g, file_adr): | |||
try: | |||
with open(file_adr, 'w') as fp: | |||
json.dump(data, fp) | |||
result["message"] = os.path.dirname(os.path.abspath(file_adr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a direct file address (os.path.abspath(file_adr)
) is better than a folder address. isn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Reference Issues/PRs
#99
What does this implement/fix? Explain your changes.
Since we need to know what's the link of uploaded art in the nft storage we decided to return the link to the art in the when using
nft_storage_upload
method.Same issue when saving a config/data/art file.