Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
3ec329a3
Commit
3ec329a3
authored
Apr 23, 2017
by
Okhin
Browse files
No more nnmon-env
parent
651d68dd
Pipeline
#969
failed with stage
in 9 seconds
Changes
1000
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
20 of 1000+
files are displayed.
Plain diff
Email patch
.gitignore
View file @
3ec329a3
...
...
@@ -14,3 +14,4 @@ nnmon.egg-info/
*.mo
# Settings
settings.py
nnmon-env
nnmon-env/bin/activate
deleted
100644 → 0
View file @
651d68dd
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
unset -f pydoc >/dev/null 2>&1
# reset old environment variables
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/home/maria/Documents/projets/rmn/nnmon-env"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
if [ "x" != x ] ; then
PS1="$PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
fi
export PS1
fi
# Make sure to unalias pydoc if it's already there
alias pydoc 2>/dev/null >/dev/null && unalias pydoc
pydoc () {
python -m pydoc "$@"
}
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
nnmon-env/bin/activate.csh
deleted
100644 → 0
View file @
651d68dd
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/home/maria/Documents/projets/rmn/nnmon-env"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
if ("" != "") then
set env_name = ""
else
set env_name = `basename "$VIRTUAL_ENV"`
endif
# Could be in a non-interactive environment,
# in which case, $prompt is undefined and we wouldn't
# care about the prompt anyway.
if ( $?prompt ) then
set _OLD_VIRTUAL_PROMPT="$prompt"
set prompt = "[$env_name] $prompt"
endif
unset env_name
alias pydoc python -m pydoc
rehash
nnmon-env/bin/activate.fish
deleted
100644 → 0
View file @
651d68dd
# This file must be used using `. bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
# Do not run it directly.
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
set -l fish_function_path
# Erase virtualenv's `fish_prompt` and restore the original.
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
end
set -e VIRTUAL_ENV
if test "$argv[1]" != 'nondestructive'
# Self-destruct!
functions -e pydoc
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/home/maria/Documents/projets/rmn/nnmon-env"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset `$PYTHONHOME` if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
function pydoc
python -m pydoc $argv
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# Copy the current `fish_prompt` function as `_old_fish_prompt`.
functions -c fish_prompt _old_fish_prompt
function fish_prompt
# Save the current $status, for fish_prompts that display it.
set -l old_status $status
# Prompt override provided?
# If not, just prepend the environment name.
if test -n ""
printf '%s%s' "" (set_color normal)
else
printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV")
end
# Restore the original $status
echo "exit $old_status" | source
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end
nnmon-env/bin/activate_this.py
deleted
100644 → 0
View file @
651d68dd
"""By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try
:
__file__
except
NameError
:
raise
AssertionError
(
"You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))"
)
import
sys
import
os
old_os_path
=
os
.
environ
.
get
(
'PATH'
,
''
)
os
.
environ
[
'PATH'
]
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
+
os
.
pathsep
+
old_os_path
base
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
if
sys
.
platform
==
'win32'
:
site_packages
=
os
.
path
.
join
(
base
,
'Lib'
,
'site-packages'
)
else
:
site_packages
=
os
.
path
.
join
(
base
,
'lib'
,
'python%s'
%
sys
.
version
[:
3
],
'site-packages'
)
prev_sys_path
=
list
(
sys
.
path
)
import
site
site
.
addsitedir
(
site_packages
)
sys
.
real_prefix
=
sys
.
prefix
sys
.
prefix
=
base
# Move the added items to the front of the path:
new_sys_path
=
[]
for
item
in
list
(
sys
.
path
):
if
item
not
in
prev_sys_path
:
new_sys_path
.
append
(
item
)
sys
.
path
.
remove
(
item
)
sys
.
path
[:
0
]
=
new_sys_path
nnmon-env/bin/createfontdatachunk.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
from
__future__
import
print_function
import
base64
import
os
import
sys
if
__name__
==
"__main__"
:
# create font data chunk for embedding
font
=
"Tests/images/courB08"
print
(
" f._load_pilfont_data("
)
print
(
" # %s"
%
os
.
path
.
basename
(
font
))
print
(
" BytesIO(base64.decodestring(b'''"
)
base64
.
encode
(
open
(
font
+
".pil"
,
"rb"
),
sys
.
stdout
)
print
(
"''')), Image.open(BytesIO(base64.decodestring(b'''"
)
base64
.
encode
(
open
(
font
+
".pbm"
,
"rb"
),
sys
.
stdout
)
print
(
"'''))))"
)
nnmon-env/bin/django-admin
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
# -*- coding: utf-8 -*-
import
re
import
sys
from
django.core.management
import
execute_from_command_line
if
__name__
==
'__main__'
:
sys
.
argv
[
0
]
=
re
.
sub
(
r
'(-script\.pyw?|\.exe)?$'
,
''
,
sys
.
argv
[
0
])
sys
.
exit
(
execute_from_command_line
())
nnmon-env/bin/django-admin.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
from
django.core
import
management
if
__name__
==
"__main__"
:
management
.
execute_from_command_line
()
nnmon-env/bin/easy_install
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
# -*- coding: utf-8 -*-
import
re
import
sys
from
setuptools.command.easy_install
import
main
if
__name__
==
'__main__'
:
sys
.
argv
[
0
]
=
re
.
sub
(
r
'(-script\.pyw?|\.exe)?$'
,
''
,
sys
.
argv
[
0
])
sys
.
exit
(
main
())
nnmon-env/bin/easy_install-2.7
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
# -*- coding: utf-8 -*-
import
re
import
sys
from
setuptools.command.easy_install
import
main
if
__name__
==
'__main__'
:
sys
.
argv
[
0
]
=
re
.
sub
(
r
'(-script\.pyw?|\.exe)?$'
,
''
,
sys
.
argv
[
0
])
sys
.
exit
(
main
())
nnmon-env/bin/enhancer.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
import
sys
if
sys
.
version_info
[
0
]
>
2
:
import
tkinter
else
:
import
Tkinter
as
tkinter
from
PIL
import
Image
,
ImageTk
,
ImageEnhance
#
# enhancer widget
class
Enhance
(
tkinter
.
Frame
):
def
__init__
(
self
,
master
,
image
,
name
,
enhancer
,
lo
,
hi
):
tkinter
.
Frame
.
__init__
(
self
,
master
)
# set up the image
self
.
tkim
=
ImageTk
.
PhotoImage
(
image
.
mode
,
image
.
size
)
self
.
enhancer
=
enhancer
(
image
)
self
.
update
(
"1.0"
)
# normalize
# image window
tkinter
.
Label
(
self
,
image
=
self
.
tkim
).
pack
()
# scale
s
=
tkinter
.
Scale
(
self
,
label
=
name
,
orient
=
tkinter
.
HORIZONTAL
,
from_
=
lo
,
to
=
hi
,
resolution
=
0.01
,
command
=
self
.
update
)
s
.
set
(
self
.
value
)
s
.
pack
()
def
update
(
self
,
value
):
self
.
value
=
float
(
value
)
self
.
tkim
.
paste
(
self
.
enhancer
.
enhance
(
self
.
value
))
#
# main
if
len
(
sys
.
argv
)
!=
2
:
print
(
"Usage: enhancer file"
)
sys
.
exit
(
1
)
root
=
tkinter
.
Tk
()
im
=
Image
.
open
(
sys
.
argv
[
1
])
im
.
thumbnail
((
200
,
200
))
Enhance
(
root
,
im
,
"Color"
,
ImageEnhance
.
Color
,
0.0
,
4.0
).
pack
()
Enhance
(
tkinter
.
Toplevel
(),
im
,
"Sharpness"
,
ImageEnhance
.
Sharpness
,
-
2.0
,
2.0
).
pack
()
Enhance
(
tkinter
.
Toplevel
(),
im
,
"Brightness"
,
ImageEnhance
.
Brightness
,
-
1.0
,
3.0
).
pack
()
Enhance
(
tkinter
.
Toplevel
(),
im
,
"Contrast"
,
ImageEnhance
.
Contrast
,
-
1.0
,
3.0
).
pack
()
root
.
mainloop
()
nnmon-env/bin/explode.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
#
# The Python Imaging Library
# $Id$
#
# split an animation into a number of frame files
#
from
__future__
import
print_function
from
PIL
import
Image
import
os
import
sys
class
Interval
(
object
):
def
__init__
(
self
,
interval
=
"0"
):
self
.
setinterval
(
interval
)
def
setinterval
(
self
,
interval
):
self
.
hilo
=
[]
for
s
in
interval
.
split
(
","
):
if
not
s
.
strip
():
continue
try
:
v
=
int
(
s
)
if
v
<
0
:
lo
,
hi
=
0
,
-
v
else
:
lo
=
hi
=
v
except
ValueError
:
i
=
s
.
find
(
"-"
)
lo
,
hi
=
int
(
s
[:
i
]),
int
(
s
[
i
+
1
:])
self
.
hilo
.
append
((
hi
,
lo
))
if
not
self
.
hilo
:
self
.
hilo
=
[(
sys
.
maxsize
,
0
)]
def
__getitem__
(
self
,
index
):
for
hi
,
lo
in
self
.
hilo
:
if
hi
>=
index
>=
lo
:
return
1
return
0
# --------------------------------------------------------------------
# main program
html
=
0
if
sys
.
argv
[
1
:
2
]
==
[
"-h"
]:
html
=
1
del
sys
.
argv
[
1
]
if
not
sys
.
argv
[
2
:]:
print
()
print
(
"Syntax: python explode.py infile template [range]"
)
print
()
print
(
"The template argument is used to construct the names of the"
)
print
(
"individual frame files. The frames are numbered file001.ext,"
)
print
(
"file002.ext, etc. You can insert %d to control the placement"
)
print
(
"and syntax of the frame number."
)
print
()
print
(
"The optional range argument specifies which frames to extract."
)
print
(
"You can give one or more ranges like 1-10, 5, -15 etc. If"
)
print
(
"omitted, all frames are extracted."
)
sys
.
exit
(
1
)
infile
=
sys
.
argv
[
1
]
outfile
=
sys
.
argv
[
2
]
frames
=
Interval
(
","
.
join
(
sys
.
argv
[
3
:]))
try
:
# check if outfile contains a placeholder
outfile
%
1
except
TypeError
:
file
,
ext
=
os
.
path
.
splitext
(
outfile
)
outfile
=
file
+
"%03d"
+
ext
ix
=
1
im
=
Image
.
open
(
infile
)
if
html
:
file
,
ext
=
os
.
path
.
splitext
(
outfile
)
html
=
open
(
file
+
".html"
,
"w"
)
html
.
write
(
"<html>
\n
<body>
\n
"
)
while
True
:
if
frames
[
ix
]:
im
.
save
(
outfile
%
ix
)
print
(
outfile
%
ix
)
if
html
:
html
.
write
(
"<img src='%s'><br>
\n
"
%
outfile
%
ix
)
try
:
im
.
seek
(
ix
)
except
EOFError
:
break
ix
+=
1
if
html
:
html
.
write
(
"</body>
\n
</html>
\n
"
)
nnmon-env/bin/futurize
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
# -*- coding: utf-8 -*-
import
re
import
sys
from
libfuturize.main
import
main
if
__name__
==
'__main__'
:
sys
.
argv
[
0
]
=
re
.
sub
(
r
'(-script\.pyw?|\.exe)?$'
,
''
,
sys
.
argv
[
0
])
sys
.
exit
(
main
())
nnmon-env/bin/gifmaker.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
#
# The Python Imaging Library
# $Id$
#
# convert sequence format to GIF animation
#
# history:
# 97-01-03 fl created
#
# Copyright (c) Secret Labs AB 1997. All rights reserved.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and redistribution.
#
from
__future__
import
print_function
from
PIL
import
Image
if
__name__
==
"__main__"
:
import
sys
if
len
(
sys
.
argv
)
<
3
:
print
(
"GIFMAKER -- create GIF animations"
)
print
(
"Usage: gifmaker infile outfile"
)
sys
.
exit
(
1
)
im
=
Image
.
open
(
sys
.
argv
[
1
])
im
.
save
(
sys
.
argv
[
2
],
save_all
=
True
)
nnmon-env/bin/painter.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste, so to get decent performance, we split
# the image into a set of tiles.
#
import
sys
if
sys
.
version_info
[
0
]
>
2
:
import
tkinter
else
:
import
Tkinter
as
tkinter
from
PIL
import
Image
,
ImageTk
#
# painter widget
class
PaintCanvas
(
tkinter
.
Canvas
):
def
__init__
(
self
,
master
,
image
):
tkinter
.
Canvas
.
__init__
(
self
,
master
,
width
=
image
.
size
[
0
],
height
=
image
.
size
[
1
])
# fill the canvas
self
.
tile
=
{}
self
.
tilesize
=
tilesize
=
32
xsize
,
ysize
=
image
.
size
for
x
in
range
(
0
,
xsize
,
tilesize
):
for
y
in
range
(
0
,
ysize
,
tilesize
):
box
=
x
,
y
,
min
(
xsize
,
x
+
tilesize
),
min
(
ysize
,
y
+
tilesize
)
tile
=
ImageTk
.
PhotoImage
(
image
.
crop
(
box
))
self
.
create_image
(
x
,
y
,
image
=
tile
,
anchor
=
tkinter
.
NW
)
self
.
tile
[(
x
,
y
)]
=
box
,
tile
self
.
image
=
image
self
.
bind
(
"<B1-Motion>"
,
self
.
paint
)
def
paint
(
self
,
event
):
xy
=
event
.
x
-
10
,
event
.
y
-
10
,
event
.
x
+
10
,
event
.
y
+
10
im
=
self
.
image
.
crop
(
xy
)
# process the image in some fashion
im
=
im
.
convert
(
"L"
)
self
.
image
.
paste
(
im
,
xy
)
self
.
repair
(
xy
)
def
repair
(
self
,
box
):
# update canvas
dx
=
box
[
0
]
%
self
.
tilesize
dy
=
box
[
1
]
%
self
.
tilesize
for
x
in
range
(
box
[
0
]
-
dx
,
box
[
2
]
+
1
,
self
.
tilesize
):
for
y
in
range
(
box
[
1
]
-
dy
,
box
[
3
]
+
1
,
self
.
tilesize
):
try
:
xy
,
tile
=
self
.
tile
[(
x
,
y
)]
tile
.
paste
(
self
.
image
.
crop
(
xy
))
except
KeyError
:
pass
# outside the image
self
.
update_idletasks
()
#
# main
if
len
(
sys
.
argv
)
!=
2
:
print
(
"Usage: painter file"
)
sys
.
exit
(
1
)
root
=
tkinter
.
Tk
()
im
=
Image
.
open
(
sys
.
argv
[
1
])
if
im
.
mode
!=
"RGB"
:
im
=
im
.
convert
(
"RGB"
)
PaintCanvas
(
root
,
im
).
pack
()
root
.
mainloop
()
nnmon-env/bin/pasteurize
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2
# -*- coding: utf-8 -*-
import
re
import
sys
from
libpasteurize.main
import
main
if
__name__
==
'__main__'
:
sys
.
argv
[
0
]
=
re
.
sub
(
r
'(-script\.pyw?|\.exe)?$'
,
''
,
sys
.
argv
[
0
])
sys
.
exit
(
main
())
nnmon-env/bin/pilconvert.py
deleted
100755 → 0
View file @
651d68dd
#!/home/maria/Documents/projets/rmn/nnmon-env/bin/python2