Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jonatan Vignatti
Git-Zenodo-Assistant
Commits
8e30d76f
Commit
8e30d76f
authored
May 12, 2021
by
María José Ramos
Browse files
Changing windows size
parent
895bad08
Changes
4
Hide whitespace changes
Inline
Side-by-side
git_assistant/git_tools/git_more.py
View file @
8e30d76f
...
...
@@ -9,17 +9,17 @@ def git_review():
message0
=
"""
Git is more than a website, Git is a control version software, which is
a software made for tracking changes in any set of files in a directory.
Managing changes of your documents, data, notebooks and coding
scripts is
essential when you do research.
\n
As you probably have learned by now, just copying your files and
renaming
them as "myProjectUpdateFinalTrueFinalPrint.ipynb" is not the
most
efficient way to do so. Git makes it easier by providing an online
Managing changes of your documents, data, notebooks and coding
scripts is
essential when you do research.
\n
As you probably have learned by now, just copying your files and
renaming
them as "myProjectUpdateFinalTrueFinalPrint.ipynb" is not the
most
efficient way to do so. Git makes it easier by providing an online
plataform for Version Control of personal and collaborative projects.
"""
message1
=
"""
The Git software stores and save files to a directory called repository,
also shorten as repo. A Git repository allows various operations to create
also shorten as repo. A Git repository allows various operations to create
different versions of the files in it.
\n
A Git repository can be local (placed in your computer) or remote
(hosted on the Internet, or in a different server).
\n
...
...
@@ -34,7 +34,7 @@ def git_review():
Maybe you knew all of this already. In fact, you probably have this program
running because you did a git clone to your computer (or Virtual Machine,
for that matter).
\n
One more thing before you continue: remember than you can only push to git
One more thing before you continue: remember than you can only push to git
repositories where you have permissions to do so. If you need to clone a
repo that you do not own and need to make changes, fork the repo first and
then you can clone it.
...
...
@@ -42,10 +42,10 @@ def git_review():
message3
=
"""
You can obtain a Git repository by either cloning a Git repository
or by converting a local directory to a Git repository, using git init.
\n
or by converting a local directory to a Git repository, using git init.
\n
It does not matter if the directory is a new local directory, or an
already existent local directory, the command git init works in
both
cases.
\n
already existent local directory, the command git init works in
both
cases.
\n
And you can also git init a git repository, is it safe to do so,
it will not overwrite files that are already there.
"""
...
...
@@ -66,7 +66,7 @@ def git_review():
# Creating window
root
=
tk
.
Tk
()
root
.
title
(
"Review of Git"
)
root
.
geometry
(
"250x2
0
0"
)
root
.
geometry
(
"250x2
5
0"
)
root
.
config
(
background
=
"#F5F5F5"
)
root
.
eval
(
'tk::PlaceWindow . center'
)
label
=
tk
.
Label
(
root
,
text
=
"Select an option and
\n
review some concepts"
)
...
...
@@ -78,7 +78,7 @@ def git_review():
window_0
=
tk
.
Toplevel
(
root
)
window_0
.
title
(
"Git and Version Control"
)
window_0
.
geometry
(
"5
3
0x2
0
0"
)
window_0
.
geometry
(
"5
1
0x2
5
0"
)
window_0
.
config
(
background
=
"#F5F5F5"
)
# Texts
title
=
tk
.
Label
(
window_0
,
text
=
"
\n\n
What is Git?"
,
bg
=
"#F5F5F5"
).
pack
()
...
...
@@ -90,7 +90,7 @@ def git_review():
window_1
=
tk
.
Toplevel
(
root
)
window_1
.
title
(
"Git Repository"
)
window_1
.
geometry
(
"5
4
0x2
0
0"
)
window_1
.
geometry
(
"5
0
0x2
8
0"
)
window_1
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_1
,
text
=
"
\n\n
What is a Git repository?"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_1
,
text
=
message1
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
...
...
@@ -101,7 +101,7 @@ def git_review():
window_2
=
tk
.
Toplevel
(
root
)
window_2
.
title
(
"git fork/git clone"
)
window_2
.
geometry
(
"5
50x2
50"
)
window_2
.
geometry
(
"5
25x3
50"
)
window_2
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_2
,
text
=
"
\n\n
What does a git fork/git clone do?"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_2
,
text
=
message2
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
...
...
@@ -110,7 +110,7 @@ def git_review():
window_3
=
tk
.
Toplevel
(
root
)
window_3
.
title
(
"git init"
)
window_3
.
geometry
(
"
51
0x2
0
0"
)
window_3
.
geometry
(
"
46
0x2
6
0"
)
window_3
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_3
,
text
=
"
\n\n
What does a git init do?"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_3
,
text
=
message3
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
...
...
@@ -120,7 +120,7 @@ def git_review():
window_4
=
tk
.
Toplevel
(
root
)
window_4
.
title
(
"git add/git commit/git push"
)
window_4
.
geometry
(
"5
6
0x
2
30"
)
window_4
.
geometry
(
"5
1
0x3
2
0"
)
window_4
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_4
,
text
=
"
\n\n
Git push and the previous steps"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_4
,
text
=
message4
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
...
...
git_assistant/git_tutorial.py
View file @
8e30d76f
...
...
@@ -56,6 +56,7 @@ familiarized with {git}. If you are not, do not worry. We have created
a review of some important concepts, in case you need it.
"""
# Git review
print
(
more_message
)
input
(
f
"Press
{
enter
}
to see the review. Click
{
done
}
when you finish."
)
git_review
()
...
...
@@ -282,4 +283,4 @@ while push_answer =="n":
# End of tutorial
if
push_answer
==
"y"
:
print
(
"
\n
Alright! You have reached the end of this tutorial.
\n
"
)
input
(
"
\n
Press {enter} to continue.
\n
"
)
\ No newline at end of file
input
(
"
\n
Press {enter} to continue.
\n
"
)
zenodo_assistant/zenodo_tools/zenodo_more.py
0 → 100644
View file @
8e30d76f
def
zenodo_review
():
# Tools
import
tkinter
as
tk
import
tkinter.ttk
# Messages for windows
message0
=
"""
Zenodo is a website where you can upload and publish files,
funded by CERN, OpenAIRE and the EU.
\n
It is built and developed by researchers who want to
promote Open Science and welcome research from all nations
and disciplines, to help scientific work to be more
shareable and citeable.
\n
Currently, all meta data is openly available under CC0 licence,
and all open content is openly accessible through open APIs.
\n
"""
message1
=
"""
You can upload many types of files to Zenodo: publications, posters,
presentations, datasets, images, videos, audios, softwares, lessons,
all research outputs from all fields of science are welcome, and
they are currently accepting up to 50GB per dataset!.
\n
When your files are ready, you can publish them, so they will be
permanently available on the Internet: your work will be stored
safely and it will be easier to cite, discover, share, considering
flexible licensing (although Zenodo encourages you to share your
research as openly as possible).
"""
message2
=
"""
A DOI (Digital Object Identifier) is a unique string of numbers, letters,
and symbols used to identify objects (like your scientific publication).
\n
DOIs are standardized and assigned by a registration agency.
\n
Zenodo supports DOI versioning by providing your published work
two DOIs, allowing you to:
-Edit/update the record’s files after they have been published.
-Cite a specific version of a record.
-Cite all of versions of a record.
\n
This makes your work easier to identify, search and cite.
"""
message3
=
"""
Metadata is a set of data that contains information about other data.
\n
While uploading a file to Zenodo, and before you publish it in the
website, you have to provide important data about your file, like its
title, creators, and type, which represents its metadata.
\n
Not only this is a requirement of Zenodo, but it is very useful: it
helps to describe your work, making it easier to find and identify,
and it also makes it more accesible, by using a standard format and
vocabulary.
"""
# Creating window
root
=
tk
.
Tk
()
root
.
title
(
"Review of Zenodo"
)
root
.
geometry
(
"260x220"
)
root
.
config
(
background
=
"#F5F5F5"
)
root
.
eval
(
'tk::PlaceWindow . center'
)
label
=
tk
.
Label
(
root
,
text
=
"Select an option and
\n
review some concepts"
)
label
.
pack
(
pady
=
10
)
# Open window functions
def
open_window_0
():
window_0
=
tk
.
Toplevel
(
root
)
window_0
.
title
(
"About Zenodo"
)
window_0
.
geometry
(
"420x300"
)
window_0
.
config
(
background
=
"#F5F5F5"
)
# Texts
title
=
tk
.
Label
(
window_0
,
text
=
"
\n\n
What is Zenodo?"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_0
,
text
=
message0
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
return
def
open_window_1
():
window_1
=
tk
.
Toplevel
(
root
)
window_1
.
title
(
"Zenodo's repository"
)
window_1
.
geometry
(
"460x300"
)
window_1
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_1
,
text
=
"
\n\n
Uploading and publishing"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_1
,
text
=
message1
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
return
def
open_window_2
():
window_2
=
tk
.
Toplevel
(
root
)
window_2
.
title
(
"DOI Versioning in Zenodo"
)
window_2
.
geometry
(
"465x300"
)
window_2
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_2
,
text
=
"
\n\n
What is DOI Versioning?"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_2
,
text
=
message2
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
return
def
open_window_3
():
window_3
=
tk
.
Toplevel
(
root
)
window_3
.
title
(
"Zenodo's metadata"
)
window_3
.
geometry
(
"460x250"
)
window_3
.
config
(
background
=
"#F5F5F5"
)
title
=
tk
.
Label
(
window_3
,
text
=
"
\n\n
What is metadata?"
,
bg
=
"#F5F5F5"
).
pack
()
text
=
tk
.
Label
(
window_3
,
text
=
message3
,
bg
=
"#F5F5F5"
,
anchor
=
"e"
,
justify
=
"left"
,
width
=
100
).
pack
()
return
# Buttons that open windows and destroy the root window.
button_0
=
tk
.
Button
(
root
,
text
=
"What is Zenodo?"
,
bg
=
"#B0E0E6"
,
command
=
open_window_0
)
button_0
.
pack
(
side
=
"top"
)
button_1
=
tk
.
Button
(
root
,
text
=
"Uploading and publishing"
,
bg
=
"#B0E0E6"
,
command
=
open_window_1
)
button_1
.
pack
(
side
=
"top"
)
button_2
=
tk
.
Button
(
root
,
text
=
"What is DOI Versioning?"
,
bg
=
"#B0E0E6"
,
command
=
open_window_2
)
button_2
.
pack
(
side
=
"top"
)
button_3
=
tk
.
Button
(
root
,
text
=
"What is metadata?"
,
bg
=
"#B0E0E6"
,
command
=
open_window_3
)
button_3
.
pack
(
side
=
"top"
)
button_done
=
tk
.
Button
(
root
,
text
=
"Done"
,
bg
=
"#FF6347"
,
command
=
root
.
destroy
)
button_done
.
pack
(
side
=
"bottom"
)
# mainloop, runs infinitely, unless root.destroy
root
.
mainloop
()
return
zenodo_assistant/zenodo_tutorial.py
View file @
8e30d76f
...
...
@@ -12,6 +12,7 @@ import pandas as pd
# Libraries to obtain data
import
tkinter
as
tk
from
zenodo_assistant.zenodo_tools.zenodo_more
import
zenodo_review
from
zenodo_assistant.zenodo_tools.zenodo_search
import
filename_input
from
zenodo_assistant.zenodo_tools.zenodo_functions
import
type_title
,
type_description
,
creators_dict
,
author_check
from
zenodo_assistant.zenodo_tools.zenodo_date
import
date_input
...
...
@@ -36,9 +37,21 @@ paste = colored("PASTE", "green", attrs=['reverse'])
welcome_message
=
f
"""
Welcome to your
{
zenodo
}
assistant.
\n
From here, you can upload a file to your
{
zenodo
}
account.
Before starting the tutorial, you should already be a little bit
familiarized with
{
zenodo
}
. If you are not, do not worry.
We have created a review of some of its important features,
in case you need it.
"""
print
(
welcome_message
)
# Zenodo review
input
(
f
"Press
{
enter
}
to see the review. Click
{
done
}
when you finish."
)
zenodo_review
()
input
(
f
"Excellent! Let's start the assistant to upload your file. Press
{
enter
}
."
)
os
.
system
(
"clear"
)
# Submit file
input
(
f
"Press
{
enter
}
to open the File Browser to
{
select
}
and
{
submit
}
the file that you want to upload.
\n
"
)
...
...
@@ -213,4 +226,4 @@ before publishing.
"""
print
(
success_message
)
input
(
f
"
\n
Press
{
enter
}
to continue."
)
\ No newline at end of file
input
(
f
"
\n
Press
{
enter
}
to continue."
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment