Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cranspasswords
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Benjamin Graillot
Cranspasswords
Commits
a8c467de
Commit
a8c467de
authored
12 years ago
by
root
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of /home/dstan/cranspasswords
parents
e52ada6c
6a9d14b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cranspasswords.py
+19
-0
19 additions, 0 deletions
cranspasswords.py
with
19 additions
and
0 deletions
cranspasswords.py
+
19
−
0
View file @
a8c467de
...
...
@@ -220,7 +220,24 @@ def show_roles():
if
role
.
endswith
(
'
-w
'
):
continue
print
"
*
"
+
role
old_clipboard
=
None
def
saveclipboard
(
restore
=
False
):
global
old_clipboard
if
restore
and
old_clipboard
==
None
:
return
act
=
'
-in
'
if
restore
else
'
-out
'
proc
=
subprocess
.
Popen
([
'
xclip
'
,
act
,
'
-selection
'
,
'
clipboard
'
],
\
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
sys
.
stderr
)
if
not
restore
:
old_clipboard
=
proc
.
stdout
.
read
()
else
:
raw_input
(
"
Appuyez sur une touche pour récupérer le contenu précédent du presse papier.
"
)
proc
.
stdin
.
write
(
old_clipboard
)
proc
.
stdin
.
close
()
proc
.
stdout
.
close
()
def
clipboard
(
texte
):
saveclipboard
()
proc
=
subprocess
.
Popen
([
'
xclip
'
,
'
-selection
'
,
'
clipboard
'
],
\
stdin
=
subprocess
.
PIPE
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
proc
.
stdin
.
write
(
texte
)
...
...
@@ -409,4 +426,6 @@ if __name__ == "__main__":
parser
.
print_help
()
else
:
parsed
.
action
(
parsed
.
fname
)
saveclipboard
(
restore
=
True
)
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