Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Crans Passwords
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
Crans Passwords
Commits
83a489fa
Commit
83a489fa
authored
8 years ago
by
Charlie Jacomme
Browse files
Options
Downloads
Patches
Plain Diff
[client] Fonctions de restaurations de fichiers corrompues
parent
5b8b19fe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client.py
+19
-0
19 additions, 0 deletions
client.py
with
19 additions
and
0 deletions
client.py
+
19
−
0
View file @
83a489fa
...
...
@@ -365,6 +365,12 @@ def all_files(options):
"""
Récupère les fichiers du serveur distant
"""
return
remote_command
(
options
,
"
listfiles
"
)
@simple_memoize
def
restore_all_files
(
options
):
"""
Récupère les fichiers du serveur distant
"""
return
remote_command
(
options
,
"
restorefiles
"
)
def
get_files
(
options
,
filenames
):
"""
Récupère le contenu des fichiers distants
"""
return
remote_command
(
options
,
"
getfiles
"
,
stdin_contents
=
filenames
)
...
...
@@ -602,6 +608,16 @@ def show_files(options):
print
((
u
"
%s %s (%s)
"
%
((
access
and
'
+
'
or
'
-
'
),
fname
,
"
,
"
.
join
(
froles
))).
encode
(
"
utf-8
"
))
print
((
u
"""
--Mes roles: %s
"""
%
(
"
,
"
.
join
(
my_roles
),)).
encode
(
"
utf-8
"
))
def
restore_files
(
options
):
"""
Restore les fichiers corrompues sur le serveur distant
"""
print
(
u
"
Fichier corrompus :
"
.
encode
(
"
utf-8
"
))
files
=
restore_all_files
(
options
)
keys
=
files
.
keys
()
keys
.
sort
()
for
fname
in
keys
:
print
((
u
"
%s (%s)
"
%
(
fname
,
files
[
fname
])).
encode
(
"
utf-8
"
))
def
show_roles
(
options
):
"""
Affiche la liste des roles existants
"""
print
(
u
"
Liste des roles disponibles
"
.
encode
(
"
utf-8
"
))
...
...
@@ -985,6 +1001,9 @@ if __name__ == "__main__":
action_grp
.
add_argument
(
'
-l
'
,
'
--list
'
,
action
=
'
store_const
'
,
dest
=
'
action
'
,
default
=
show_file
,
const
=
show_files
,
help
=
"
Lister les fichiers
"
)
action_grp
.
add_argument
(
'
-r
'
,
'
--restore
'
,
action
=
'
store_const
'
,
dest
=
'
action
'
,
default
=
show_file
,
const
=
restore_files
,
help
=
"
Restorer les fichiers corrompues
"
)
action_grp
.
add_argument
(
'
--check-keys
'
,
action
=
'
store_const
'
,
dest
=
'
action
'
,
default
=
show_file
,
const
=
my_check_keys
,
help
=
"
Vérifier les clés
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment