mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-12-25 11:20:02 +00:00
Final docker setup
This commit is contained in:
parent
ac89a5d001
commit
dec96057c3
78
frappe-bench/env/bin/activate
vendored
78
frappe-bench/env/bin/activate
vendored
@ -1,78 +0,0 @@
|
|||||||
# 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/frappe/frappe-bench/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
|
|
36
frappe-bench/env/bin/activate.csh
vendored
36
frappe-bench/env/bin/activate.csh
vendored
@ -1,36 +0,0 @@
|
|||||||
# 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/frappe/frappe-bench/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
|
|
||||||
|
|
76
frappe-bench/env/bin/activate.fish
vendored
76
frappe-bench/env/bin/activate.fish
vendored
@ -1,76 +0,0 @@
|
|||||||
# 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/frappe/frappe-bench/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
|
|
34
frappe-bench/env/bin/activate_this.py
vendored
34
frappe-bench/env/bin/activate_this.py
vendored
@ -1,34 +0,0 @@
|
|||||||
"""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
|
|
11
frappe-bench/env/bin/chardetect
vendored
11
frappe-bench/env/bin/chardetect
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from chardet.cli.chardetect import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
16
frappe-bench/env/bin/createfontdatachunk.py
vendored
16
frappe-bench/env/bin/createfontdatachunk.py
vendored
@ -1,16 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
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("'''))))")
|
|
BIN
frappe-bench/env/bin/createfontdatachunk.pyc
vendored
BIN
frappe-bench/env/bin/createfontdatachunk.pyc
vendored
Binary file not shown.
12
frappe-bench/env/bin/csscapture
vendored
12
frappe-bench/env/bin/csscapture
vendored
@ -1,12 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
# EASY-INSTALL-ENTRY-SCRIPT: 'cssutils==1.0.2','console_scripts','csscapture'
|
|
||||||
__requires__ = 'cssutils==1.0.2'
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pkg_resources import load_entry_point
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(
|
|
||||||
load_entry_point('cssutils==1.0.2', 'console_scripts', 'csscapture')()
|
|
||||||
)
|
|
12
frappe-bench/env/bin/csscombine
vendored
12
frappe-bench/env/bin/csscombine
vendored
@ -1,12 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
# EASY-INSTALL-ENTRY-SCRIPT: 'cssutils==1.0.2','console_scripts','csscombine'
|
|
||||||
__requires__ = 'cssutils==1.0.2'
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pkg_resources import load_entry_point
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(
|
|
||||||
load_entry_point('cssutils==1.0.2', 'console_scripts', 'csscombine')()
|
|
||||||
)
|
|
12
frappe-bench/env/bin/cssmin
vendored
12
frappe-bench/env/bin/cssmin
vendored
@ -1,12 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
# EASY-INSTALL-ENTRY-SCRIPT: 'cssmin==0.2.0','console_scripts','cssmin'
|
|
||||||
__requires__ = 'cssmin==0.2.0'
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pkg_resources import load_entry_point
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(
|
|
||||||
load_entry_point('cssmin==0.2.0', 'console_scripts', 'cssmin')()
|
|
||||||
)
|
|
12
frappe-bench/env/bin/cssparse
vendored
12
frappe-bench/env/bin/cssparse
vendored
@ -1,12 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
# EASY-INSTALL-ENTRY-SCRIPT: 'cssutils==1.0.2','console_scripts','cssparse'
|
|
||||||
__requires__ = 'cssutils==1.0.2'
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pkg_resources import load_entry_point
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(
|
|
||||||
load_entry_point('cssutils==1.0.2', 'console_scripts', 'cssparse')()
|
|
||||||
)
|
|
11
frappe-bench/env/bin/easy_install
vendored
11
frappe-bench/env/bin/easy_install
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- 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())
|
|
11
frappe-bench/env/bin/easy_install-2.7
vendored
11
frappe-bench/env/bin/easy_install-2.7
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- 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())
|
|
64
frappe-bench/env/bin/enhancer.py
vendored
64
frappe-bench/env/bin/enhancer.py
vendored
@ -1,64 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# 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()
|
|
BIN
frappe-bench/env/bin/enhancer.pyc
vendored
BIN
frappe-bench/env/bin/enhancer.pyc
vendored
Binary file not shown.
112
frappe-bench/env/bin/explode.py
vendored
112
frappe-bench/env/bin/explode.py
vendored
@ -1,112 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# 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")
|
|
BIN
frappe-bench/env/bin/explode.pyc
vendored
BIN
frappe-bench/env/bin/explode.pyc
vendored
Binary file not shown.
31
frappe-bench/env/bin/gifmaker.py
vendored
31
frappe-bench/env/bin/gifmaker.py
vendored
@ -1,31 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# 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)
|
|
BIN
frappe-bench/env/bin/gifmaker.pyc
vendored
BIN
frappe-bench/env/bin/gifmaker.pyc
vendored
Binary file not shown.
11
frappe-bench/env/bin/gunicorn
vendored
11
frappe-bench/env/bin/gunicorn
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from gunicorn.app.wsgiapp import run
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(run())
|
|
11
frappe-bench/env/bin/gunicorn_paster
vendored
11
frappe-bench/env/bin/gunicorn_paster
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from gunicorn.app.pasterapp import run
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(run())
|
|
11
frappe-bench/env/bin/honcho
vendored
11
frappe-bench/env/bin/honcho
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from honcho.command import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
12
frappe-bench/env/bin/html2text
vendored
12
frappe-bench/env/bin/html2text
vendored
@ -1,12 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
# EASY-INSTALL-ENTRY-SCRIPT: 'html2text==2016.9.19','console_scripts','html2text'
|
|
||||||
__requires__ = 'html2text==2016.9.19'
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pkg_resources import load_entry_point
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(
|
|
||||||
load_entry_point('html2text==2016.9.19', 'console_scripts', 'html2text')()
|
|
||||||
)
|
|
11
frappe-bench/env/bin/iptest
vendored
11
frappe-bench/env/bin/iptest
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from IPython.testing.iptestcontroller import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/iptest2
vendored
11
frappe-bench/env/bin/iptest2
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from IPython.testing.iptestcontroller import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/ipython
vendored
11
frappe-bench/env/bin/ipython
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from IPython import start_ipython
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(start_ipython())
|
|
11
frappe-bench/env/bin/ipython2
vendored
11
frappe-bench/env/bin/ipython2
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from IPython import start_ipython
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(start_ipython())
|
|
18
frappe-bench/env/bin/markdown2
vendored
18
frappe-bench/env/bin/markdown2
vendored
@ -1,18 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
from os.path import join, dirname, exists
|
|
||||||
|
|
||||||
# Use the local markdown2.py if we are in the source tree.
|
|
||||||
source_tree_markdown2 = join(dirname(__file__), "..", "lib", "markdown2.py")
|
|
||||||
if exists(source_tree_markdown2):
|
|
||||||
sys.path.insert(0, dirname(source_tree_markdown2))
|
|
||||||
try:
|
|
||||||
from markdown2 import main
|
|
||||||
finally:
|
|
||||||
del sys.path[0]
|
|
||||||
else:
|
|
||||||
from markdown2 import main
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
sys.exit( main(sys.argv) )
|
|
84
frappe-bench/env/bin/painter.py
vendored
84
frappe-bench/env/bin/painter.py
vendored
@ -1,84 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# 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()
|
|
BIN
frappe-bench/env/bin/painter.pyc
vendored
BIN
frappe-bench/env/bin/painter.pyc
vendored
Binary file not shown.
99
frappe-bench/env/bin/pilconvert.py
vendored
99
frappe-bench/env/bin/pilconvert.py
vendored
@ -1,99 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library.
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# convert image files
|
|
||||||
#
|
|
||||||
# History:
|
|
||||||
# 0.1 96-04-20 fl Created
|
|
||||||
# 0.2 96-10-04 fl Use draft mode when converting images
|
|
||||||
# 0.3 96-12-30 fl Optimize output (PNG, JPEG)
|
|
||||||
# 0.4 97-01-18 fl Made optimize an option (PNG, JPEG)
|
|
||||||
# 0.5 98-12-30 fl Fixed -f option (from Anthony Baxter)
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import getopt
|
|
||||||
import string
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
|
|
||||||
def usage():
|
|
||||||
print("PIL Convert 0.5/1998-12-30 -- convert image files")
|
|
||||||
print("Usage: pilconvert [option] infile outfile")
|
|
||||||
print()
|
|
||||||
print("Options:")
|
|
||||||
print()
|
|
||||||
print(" -c <format> convert to format (default is given by extension)")
|
|
||||||
print()
|
|
||||||
print(" -g convert to greyscale")
|
|
||||||
print(" -p convert to palette image (using standard palette)")
|
|
||||||
print(" -r convert to rgb")
|
|
||||||
print()
|
|
||||||
print(" -o optimize output (trade speed for size)")
|
|
||||||
print(" -q <value> set compression quality (0-100, JPEG only)")
|
|
||||||
print()
|
|
||||||
print(" -f list supported file formats")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if len(sys.argv) == 1:
|
|
||||||
usage()
|
|
||||||
|
|
||||||
try:
|
|
||||||
opt, argv = getopt.getopt(sys.argv[1:], "c:dfgopq:r")
|
|
||||||
except getopt.error as v:
|
|
||||||
print(v)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
output_format = None
|
|
||||||
convert = None
|
|
||||||
|
|
||||||
options = {}
|
|
||||||
|
|
||||||
for o, a in opt:
|
|
||||||
|
|
||||||
if o == "-f":
|
|
||||||
Image.init()
|
|
||||||
id = sorted(Image.ID)
|
|
||||||
print("Supported formats (* indicates output format):")
|
|
||||||
for i in id:
|
|
||||||
if i in Image.SAVE:
|
|
||||||
print(i+"*", end=' ')
|
|
||||||
else:
|
|
||||||
print(i, end=' ')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
elif o == "-c":
|
|
||||||
output_format = a
|
|
||||||
|
|
||||||
if o == "-g":
|
|
||||||
convert = "L"
|
|
||||||
elif o == "-p":
|
|
||||||
convert = "P"
|
|
||||||
elif o == "-r":
|
|
||||||
convert = "RGB"
|
|
||||||
|
|
||||||
elif o == "-o":
|
|
||||||
options["optimize"] = 1
|
|
||||||
elif o == "-q":
|
|
||||||
options["quality"] = string.atoi(a)
|
|
||||||
|
|
||||||
if len(argv) != 2:
|
|
||||||
usage()
|
|
||||||
|
|
||||||
try:
|
|
||||||
im = Image.open(argv[0])
|
|
||||||
if convert and im.mode != convert:
|
|
||||||
im.draft(convert, im.size)
|
|
||||||
im = im.convert(convert)
|
|
||||||
if output_format:
|
|
||||||
im.save(argv[1], output_format, **options)
|
|
||||||
else:
|
|
||||||
im.save(argv[1], **options)
|
|
||||||
except:
|
|
||||||
print("cannot convert image", end=' ')
|
|
||||||
print("(%s:%s)" % (sys.exc_info()[0], sys.exc_info()[1]))
|
|
BIN
frappe-bench/env/bin/pilconvert.pyc
vendored
BIN
frappe-bench/env/bin/pilconvert.pyc
vendored
Binary file not shown.
526
frappe-bench/env/bin/pildriver.py
vendored
526
frappe-bench/env/bin/pildriver.py
vendored
@ -1,526 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
"""PILdriver, an image-processing calculator using PIL.
|
|
||||||
|
|
||||||
An instance of class PILDriver is essentially a software stack machine
|
|
||||||
(Polish-notation interpreter) for sequencing PIL image
|
|
||||||
transformations. The state of the instance is the interpreter stack.
|
|
||||||
|
|
||||||
The only method one will normally invoke after initialization is the
|
|
||||||
`execute' method. This takes an argument list of tokens, pushes them
|
|
||||||
onto the instance's stack, and then tries to clear the stack by
|
|
||||||
successive evaluation of PILdriver operators. Any part of the stack
|
|
||||||
not cleaned off persists and is part of the evaluation context for
|
|
||||||
the next call of the execute method.
|
|
||||||
|
|
||||||
PILDriver doesn't catch any exceptions, on the theory that these
|
|
||||||
are actually diagnostic information that should be interpreted by
|
|
||||||
the calling code.
|
|
||||||
|
|
||||||
When called as a script, the command-line arguments are passed to
|
|
||||||
a PILDriver instance. If there are no command-line arguments, the
|
|
||||||
module runs an interactive interpreter, each line of which is split into
|
|
||||||
space-separated tokens and passed to the execute method.
|
|
||||||
|
|
||||||
In the method descriptions below, a first line beginning with the string
|
|
||||||
`usage:' means this method can be invoked with the token that follows
|
|
||||||
it. Following <>-enclosed arguments describe how the method interprets
|
|
||||||
the entries on the stack. Each argument specification begins with a
|
|
||||||
type specification: either `int', `float', `string', or `image'.
|
|
||||||
|
|
||||||
All operations consume their arguments off the stack (use `dup' to
|
|
||||||
keep copies around). Use `verbose 1' to see the stack state displayed
|
|
||||||
before each operation.
|
|
||||||
|
|
||||||
Usage examples:
|
|
||||||
|
|
||||||
`show crop 0 0 200 300 open test.png' loads test.png, crops out a portion
|
|
||||||
of its upper-left-hand corner and displays the cropped portion.
|
|
||||||
|
|
||||||
`save rotated.png rotate 30 open test.tiff' loads test.tiff, rotates it
|
|
||||||
30 degrees, and saves the result as rotated.png (in PNG format).
|
|
||||||
"""
|
|
||||||
# by Eric S. Raymond <esr@thyrsus.com>
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
# TO DO:
|
|
||||||
# 1. Add PILFont capabilities, once that's documented.
|
|
||||||
# 2. Add PILDraw operations.
|
|
||||||
# 3. Add support for composing and decomposing multiple-image files.
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
|
|
||||||
class PILDriver(object):
|
|
||||||
|
|
||||||
verbose = 0
|
|
||||||
|
|
||||||
def do_verbose(self):
|
|
||||||
"""usage: verbose <int:num>
|
|
||||||
|
|
||||||
Set verbosity flag from top of stack.
|
|
||||||
"""
|
|
||||||
self.verbose = int(self.do_pop())
|
|
||||||
|
|
||||||
# The evaluation stack (internal only)
|
|
||||||
|
|
||||||
stack = [] # Stack of pending operations
|
|
||||||
|
|
||||||
def push(self, item):
|
|
||||||
"Push an argument onto the evaluation stack."
|
|
||||||
self.stack.insert(0, item)
|
|
||||||
|
|
||||||
def top(self):
|
|
||||||
"Return the top-of-stack element."
|
|
||||||
return self.stack[0]
|
|
||||||
|
|
||||||
# Stack manipulation (callable)
|
|
||||||
|
|
||||||
def do_clear(self):
|
|
||||||
"""usage: clear
|
|
||||||
|
|
||||||
Clear the stack.
|
|
||||||
"""
|
|
||||||
self.stack = []
|
|
||||||
|
|
||||||
def do_pop(self):
|
|
||||||
"""usage: pop
|
|
||||||
|
|
||||||
Discard the top element on the stack.
|
|
||||||
"""
|
|
||||||
return self.stack.pop(0)
|
|
||||||
|
|
||||||
def do_dup(self):
|
|
||||||
"""usage: dup
|
|
||||||
|
|
||||||
Duplicate the top-of-stack item.
|
|
||||||
"""
|
|
||||||
if hasattr(self, 'format'): # If it's an image, do a real copy
|
|
||||||
dup = self.stack[0].copy()
|
|
||||||
else:
|
|
||||||
dup = self.stack[0]
|
|
||||||
self.push(dup)
|
|
||||||
|
|
||||||
def do_swap(self):
|
|
||||||
"""usage: swap
|
|
||||||
|
|
||||||
Swap the top-of-stack item with the next one down.
|
|
||||||
"""
|
|
||||||
self.stack = [self.stack[1], self.stack[0]] + self.stack[2:]
|
|
||||||
|
|
||||||
# Image module functions (callable)
|
|
||||||
|
|
||||||
def do_new(self):
|
|
||||||
"""usage: new <int:xsize> <int:ysize> <int:color>:
|
|
||||||
|
|
||||||
Create and push a greyscale image of given size and color.
|
|
||||||
"""
|
|
||||||
xsize = int(self.do_pop())
|
|
||||||
ysize = int(self.do_pop())
|
|
||||||
color = int(self.do_pop())
|
|
||||||
self.push(Image.new("L", (xsize, ysize), color))
|
|
||||||
|
|
||||||
def do_open(self):
|
|
||||||
"""usage: open <string:filename>
|
|
||||||
|
|
||||||
Open the indicated image, read it, push the image on the stack.
|
|
||||||
"""
|
|
||||||
self.push(Image.open(self.do_pop()))
|
|
||||||
|
|
||||||
def do_blend(self):
|
|
||||||
"""usage: blend <image:pic1> <image:pic2> <float:alpha>
|
|
||||||
|
|
||||||
Replace two images and an alpha with the blended image.
|
|
||||||
"""
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
alpha = float(self.do_pop())
|
|
||||||
self.push(Image.blend(image1, image2, alpha))
|
|
||||||
|
|
||||||
def do_composite(self):
|
|
||||||
"""usage: composite <image:pic1> <image:pic2> <image:mask>
|
|
||||||
|
|
||||||
Replace two images and a mask with their composite.
|
|
||||||
"""
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
mask = self.do_pop()
|
|
||||||
self.push(Image.composite(image1, image2, mask))
|
|
||||||
|
|
||||||
def do_merge(self):
|
|
||||||
"""usage: merge <string:mode> <image:pic1>
|
|
||||||
[<image:pic2> [<image:pic3> [<image:pic4>]]]
|
|
||||||
|
|
||||||
Merge top-of stack images in a way described by the mode.
|
|
||||||
"""
|
|
||||||
mode = self.do_pop()
|
|
||||||
bandlist = []
|
|
||||||
for band in mode:
|
|
||||||
bandlist.append(self.do_pop())
|
|
||||||
self.push(Image.merge(mode, bandlist))
|
|
||||||
|
|
||||||
# Image class methods
|
|
||||||
|
|
||||||
def do_convert(self):
|
|
||||||
"""usage: convert <string:mode> <image:pic1>
|
|
||||||
|
|
||||||
Convert the top image to the given mode.
|
|
||||||
"""
|
|
||||||
mode = self.do_pop()
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.convert(mode))
|
|
||||||
|
|
||||||
def do_copy(self):
|
|
||||||
"""usage: copy <image:pic1>
|
|
||||||
|
|
||||||
Make and push a true copy of the top image.
|
|
||||||
"""
|
|
||||||
self.dup()
|
|
||||||
|
|
||||||
def do_crop(self):
|
|
||||||
"""usage: crop <int:left> <int:upper> <int:right> <int:lower>
|
|
||||||
<image:pic1>
|
|
||||||
|
|
||||||
Crop and push a rectangular region from the current image.
|
|
||||||
"""
|
|
||||||
left = int(self.do_pop())
|
|
||||||
upper = int(self.do_pop())
|
|
||||||
right = int(self.do_pop())
|
|
||||||
lower = int(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.crop((left, upper, right, lower)))
|
|
||||||
|
|
||||||
def do_draft(self):
|
|
||||||
"""usage: draft <string:mode> <int:xsize> <int:ysize>
|
|
||||||
|
|
||||||
Configure the loader for a given mode and size.
|
|
||||||
"""
|
|
||||||
mode = self.do_pop()
|
|
||||||
xsize = int(self.do_pop())
|
|
||||||
ysize = int(self.do_pop())
|
|
||||||
self.push(self.draft(mode, (xsize, ysize)))
|
|
||||||
|
|
||||||
def do_filter(self):
|
|
||||||
"""usage: filter <string:filtername> <image:pic1>
|
|
||||||
|
|
||||||
Process the top image with the given filter.
|
|
||||||
"""
|
|
||||||
from PIL import ImageFilter
|
|
||||||
imageFilter = getattr(ImageFilter, self.do_pop().upper())
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.filter(imageFilter))
|
|
||||||
|
|
||||||
def do_getbbox(self):
|
|
||||||
"""usage: getbbox
|
|
||||||
|
|
||||||
Push left, upper, right, and lower pixel coordinates of the top image.
|
|
||||||
"""
|
|
||||||
bounding_box = self.do_pop().getbbox()
|
|
||||||
self.push(bounding_box[3])
|
|
||||||
self.push(bounding_box[2])
|
|
||||||
self.push(bounding_box[1])
|
|
||||||
self.push(bounding_box[0])
|
|
||||||
|
|
||||||
def do_getextrema(self):
|
|
||||||
"""usage: extrema
|
|
||||||
|
|
||||||
Push minimum and maximum pixel values of the top image.
|
|
||||||
"""
|
|
||||||
extrema = self.do_pop().extrema()
|
|
||||||
self.push(extrema[1])
|
|
||||||
self.push(extrema[0])
|
|
||||||
|
|
||||||
def do_offset(self):
|
|
||||||
"""usage: offset <int:xoffset> <int:yoffset> <image:pic1>
|
|
||||||
|
|
||||||
Offset the pixels in the top image.
|
|
||||||
"""
|
|
||||||
xoff = int(self.do_pop())
|
|
||||||
yoff = int(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.offset(xoff, yoff))
|
|
||||||
|
|
||||||
def do_paste(self):
|
|
||||||
"""usage: paste <image:figure> <int:xoffset> <int:yoffset>
|
|
||||||
<image:ground>
|
|
||||||
|
|
||||||
Paste figure image into ground with upper left at given offsets.
|
|
||||||
"""
|
|
||||||
figure = self.do_pop()
|
|
||||||
xoff = int(self.do_pop())
|
|
||||||
yoff = int(self.do_pop())
|
|
||||||
ground = self.do_pop()
|
|
||||||
if figure.mode == "RGBA":
|
|
||||||
ground.paste(figure, (xoff, yoff), figure)
|
|
||||||
else:
|
|
||||||
ground.paste(figure, (xoff, yoff))
|
|
||||||
self.push(ground)
|
|
||||||
|
|
||||||
def do_resize(self):
|
|
||||||
"""usage: resize <int:xsize> <int:ysize> <image:pic1>
|
|
||||||
|
|
||||||
Resize the top image.
|
|
||||||
"""
|
|
||||||
ysize = int(self.do_pop())
|
|
||||||
xsize = int(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.resize((xsize, ysize)))
|
|
||||||
|
|
||||||
def do_rotate(self):
|
|
||||||
"""usage: rotate <int:angle> <image:pic1>
|
|
||||||
|
|
||||||
Rotate image through a given angle
|
|
||||||
"""
|
|
||||||
angle = int(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.rotate(angle))
|
|
||||||
|
|
||||||
def do_save(self):
|
|
||||||
"""usage: save <string:filename> <image:pic1>
|
|
||||||
|
|
||||||
Save image with default options.
|
|
||||||
"""
|
|
||||||
filename = self.do_pop()
|
|
||||||
image = self.do_pop()
|
|
||||||
image.save(filename)
|
|
||||||
|
|
||||||
def do_save2(self):
|
|
||||||
"""usage: save2 <string:filename> <string:options> <image:pic1>
|
|
||||||
|
|
||||||
Save image with specified options.
|
|
||||||
"""
|
|
||||||
filename = self.do_pop()
|
|
||||||
options = self.do_pop()
|
|
||||||
image = self.do_pop()
|
|
||||||
image.save(filename, None, options)
|
|
||||||
|
|
||||||
def do_show(self):
|
|
||||||
"""usage: show <image:pic1>
|
|
||||||
|
|
||||||
Display and pop the top image.
|
|
||||||
"""
|
|
||||||
self.do_pop().show()
|
|
||||||
|
|
||||||
def do_thumbnail(self):
|
|
||||||
"""usage: thumbnail <int:xsize> <int:ysize> <image:pic1>
|
|
||||||
|
|
||||||
Modify the top image in the stack to contain a thumbnail of itself.
|
|
||||||
"""
|
|
||||||
ysize = int(self.do_pop())
|
|
||||||
xsize = int(self.do_pop())
|
|
||||||
self.top().thumbnail((xsize, ysize))
|
|
||||||
|
|
||||||
def do_transpose(self):
|
|
||||||
"""usage: transpose <string:operator> <image:pic1>
|
|
||||||
|
|
||||||
Transpose the top image.
|
|
||||||
"""
|
|
||||||
transpose = self.do_pop().upper()
|
|
||||||
image = self.do_pop()
|
|
||||||
self.push(image.transpose(transpose))
|
|
||||||
|
|
||||||
# Image attributes
|
|
||||||
|
|
||||||
def do_format(self):
|
|
||||||
"""usage: format <image:pic1>
|
|
||||||
|
|
||||||
Push the format of the top image onto the stack.
|
|
||||||
"""
|
|
||||||
self.push(self.do_pop().format)
|
|
||||||
|
|
||||||
def do_mode(self):
|
|
||||||
"""usage: mode <image:pic1>
|
|
||||||
|
|
||||||
Push the mode of the top image onto the stack.
|
|
||||||
"""
|
|
||||||
self.push(self.do_pop().mode)
|
|
||||||
|
|
||||||
def do_size(self):
|
|
||||||
"""usage: size <image:pic1>
|
|
||||||
|
|
||||||
Push the image size on the stack as (y, x).
|
|
||||||
"""
|
|
||||||
size = self.do_pop().size
|
|
||||||
self.push(size[0])
|
|
||||||
self.push(size[1])
|
|
||||||
|
|
||||||
# ImageChops operations
|
|
||||||
|
|
||||||
def do_invert(self):
|
|
||||||
"""usage: invert <image:pic1>
|
|
||||||
|
|
||||||
Invert the top image.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
self.push(ImageChops.invert(self.do_pop()))
|
|
||||||
|
|
||||||
def do_lighter(self):
|
|
||||||
"""usage: lighter <image:pic1> <image:pic2>
|
|
||||||
|
|
||||||
Pop the two top images, push an image of the lighter pixels of both.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
self.push(ImageChops.lighter(image1, image2))
|
|
||||||
|
|
||||||
def do_darker(self):
|
|
||||||
"""usage: darker <image:pic1> <image:pic2>
|
|
||||||
|
|
||||||
Pop the two top images, push an image of the darker pixels of both.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
self.push(ImageChops.darker(image1, image2))
|
|
||||||
|
|
||||||
def do_difference(self):
|
|
||||||
"""usage: difference <image:pic1> <image:pic2>
|
|
||||||
|
|
||||||
Pop the two top images, push the difference image
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
self.push(ImageChops.difference(image1, image2))
|
|
||||||
|
|
||||||
def do_multiply(self):
|
|
||||||
"""usage: multiply <image:pic1> <image:pic2>
|
|
||||||
|
|
||||||
Pop the two top images, push the multiplication image.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
self.push(ImageChops.multiply(image1, image2))
|
|
||||||
|
|
||||||
def do_screen(self):
|
|
||||||
"""usage: screen <image:pic1> <image:pic2>
|
|
||||||
|
|
||||||
Pop the two top images, superimpose their inverted versions.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image2 = self.do_pop()
|
|
||||||
image1 = self.do_pop()
|
|
||||||
self.push(ImageChops.screen(image1, image2))
|
|
||||||
|
|
||||||
def do_add(self):
|
|
||||||
"""usage: add <image:pic1> <image:pic2> <int:offset> <float:scale>
|
|
||||||
|
|
||||||
Pop the two top images, produce the scaled sum with offset.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
scale = float(self.do_pop())
|
|
||||||
offset = int(self.do_pop())
|
|
||||||
self.push(ImageChops.add(image1, image2, scale, offset))
|
|
||||||
|
|
||||||
def do_subtract(self):
|
|
||||||
"""usage: subtract <image:pic1> <image:pic2> <int:offset> <float:scale>
|
|
||||||
|
|
||||||
Pop the two top images, produce the scaled difference with offset.
|
|
||||||
"""
|
|
||||||
from PIL import ImageChops
|
|
||||||
image1 = self.do_pop()
|
|
||||||
image2 = self.do_pop()
|
|
||||||
scale = float(self.do_pop())
|
|
||||||
offset = int(self.do_pop())
|
|
||||||
self.push(ImageChops.subtract(image1, image2, scale, offset))
|
|
||||||
|
|
||||||
# ImageEnhance classes
|
|
||||||
|
|
||||||
def do_color(self):
|
|
||||||
"""usage: color <image:pic1>
|
|
||||||
|
|
||||||
Enhance color in the top image.
|
|
||||||
"""
|
|
||||||
from PIL import ImageEnhance
|
|
||||||
factor = float(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
enhancer = ImageEnhance.Color(image)
|
|
||||||
self.push(enhancer.enhance(factor))
|
|
||||||
|
|
||||||
def do_contrast(self):
|
|
||||||
"""usage: contrast <image:pic1>
|
|
||||||
|
|
||||||
Enhance contrast in the top image.
|
|
||||||
"""
|
|
||||||
from PIL import ImageEnhance
|
|
||||||
factor = float(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
enhancer = ImageEnhance.Contrast(image)
|
|
||||||
self.push(enhancer.enhance(factor))
|
|
||||||
|
|
||||||
def do_brightness(self):
|
|
||||||
"""usage: brightness <image:pic1>
|
|
||||||
|
|
||||||
Enhance brightness in the top image.
|
|
||||||
"""
|
|
||||||
from PIL import ImageEnhance
|
|
||||||
factor = float(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
enhancer = ImageEnhance.Brightness(image)
|
|
||||||
self.push(enhancer.enhance(factor))
|
|
||||||
|
|
||||||
def do_sharpness(self):
|
|
||||||
"""usage: sharpness <image:pic1>
|
|
||||||
|
|
||||||
Enhance sharpness in the top image.
|
|
||||||
"""
|
|
||||||
from PIL import ImageEnhance
|
|
||||||
factor = float(self.do_pop())
|
|
||||||
image = self.do_pop()
|
|
||||||
enhancer = ImageEnhance.Sharpness(image)
|
|
||||||
self.push(enhancer.enhance(factor))
|
|
||||||
|
|
||||||
# The interpreter loop
|
|
||||||
|
|
||||||
def execute(self, list):
|
|
||||||
"Interpret a list of PILDriver commands."
|
|
||||||
list.reverse()
|
|
||||||
while len(list) > 0:
|
|
||||||
self.push(list[0])
|
|
||||||
list = list[1:]
|
|
||||||
if self.verbose:
|
|
||||||
print("Stack: " + repr(self.stack))
|
|
||||||
top = self.top()
|
|
||||||
if not isinstance(top, str):
|
|
||||||
continue
|
|
||||||
funcname = "do_" + top
|
|
||||||
if not hasattr(self, funcname):
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
self.do_pop()
|
|
||||||
func = getattr(self, funcname)
|
|
||||||
func()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# If we see command-line arguments, interpret them as a stack state
|
|
||||||
# and execute. Otherwise go interactive.
|
|
||||||
|
|
||||||
driver = PILDriver()
|
|
||||||
if len(sys.argv[1:]) > 0:
|
|
||||||
driver.execute(sys.argv[1:])
|
|
||||||
else:
|
|
||||||
print("PILDriver says hello.")
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
if sys.version_info[0] >= 3:
|
|
||||||
line = input('pildriver> ')
|
|
||||||
else:
|
|
||||||
line = raw_input('pildriver> ')
|
|
||||||
except EOFError:
|
|
||||||
print("\nPILDriver says goodbye.")
|
|
||||||
break
|
|
||||||
driver.execute(line.split())
|
|
||||||
print(driver.stack)
|
|
||||||
|
|
||||||
# The following sets edit modes for GNU EMACS
|
|
||||||
# Local Variables:
|
|
||||||
# mode:python
|
|
||||||
# End:
|
|
BIN
frappe-bench/env/bin/pildriver.pyc
vendored
BIN
frappe-bench/env/bin/pildriver.pyc
vendored
Binary file not shown.
101
frappe-bench/env/bin/pilfile.py
vendored
101
frappe-bench/env/bin/pilfile.py
vendored
@ -1,101 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library.
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# a utility to identify image files
|
|
||||||
#
|
|
||||||
# this script identifies image files, extracting size and
|
|
||||||
# pixel mode information for known file formats. Note that
|
|
||||||
# you don't need the PIL C extension to use this module.
|
|
||||||
#
|
|
||||||
# History:
|
|
||||||
# 0.0 1995-09-01 fl Created
|
|
||||||
# 0.1 1996-05-18 fl Modified options, added debugging mode
|
|
||||||
# 0.2 1996-12-29 fl Added verify mode
|
|
||||||
# 0.3 1999-06-05 fl Don't mess up on class exceptions (1.5.2 and later)
|
|
||||||
# 0.4 2003-09-30 fl Expand wildcards on Windows; robustness tweaks
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import getopt
|
|
||||||
import glob
|
|
||||||
import logging
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
if len(sys.argv) == 1:
|
|
||||||
print("PIL File 0.4/2003-09-30 -- identify image files")
|
|
||||||
print("Usage: pilfile [option] files...")
|
|
||||||
print("Options:")
|
|
||||||
print(" -f list supported file formats")
|
|
||||||
print(" -i show associated info and tile data")
|
|
||||||
print(" -v verify file headers")
|
|
||||||
print(" -q quiet, don't warn for unidentified/missing/broken files")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
|
||||||
opt, args = getopt.getopt(sys.argv[1:], "fqivD")
|
|
||||||
except getopt.error as v:
|
|
||||||
print(v)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
verbose = quiet = verify = 0
|
|
||||||
logging_level = "WARNING"
|
|
||||||
|
|
||||||
for o, a in opt:
|
|
||||||
if o == "-f":
|
|
||||||
Image.init()
|
|
||||||
id = sorted(Image.ID)
|
|
||||||
print("Supported formats:")
|
|
||||||
for i in id:
|
|
||||||
print(i, end=' ')
|
|
||||||
sys.exit(1)
|
|
||||||
elif o == "-i":
|
|
||||||
verbose = 1
|
|
||||||
elif o == "-q":
|
|
||||||
quiet = 1
|
|
||||||
elif o == "-v":
|
|
||||||
verify = 1
|
|
||||||
elif o == "-D":
|
|
||||||
logging_level = "DEBUG"
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging_level)
|
|
||||||
|
|
||||||
|
|
||||||
def globfix(files):
|
|
||||||
# expand wildcards where necessary
|
|
||||||
if sys.platform == "win32":
|
|
||||||
out = []
|
|
||||||
for file in files:
|
|
||||||
if glob.has_magic(file):
|
|
||||||
out.extend(glob.glob(file))
|
|
||||||
else:
|
|
||||||
out.append(file)
|
|
||||||
return out
|
|
||||||
return files
|
|
||||||
|
|
||||||
for file in globfix(args):
|
|
||||||
try:
|
|
||||||
im = Image.open(file)
|
|
||||||
print("%s:" % file, im.format, "%dx%d" % im.size, im.mode, end=' ')
|
|
||||||
if verbose:
|
|
||||||
print(im.info, im.tile, end=' ')
|
|
||||||
print()
|
|
||||||
if verify:
|
|
||||||
try:
|
|
||||||
im.verify()
|
|
||||||
except:
|
|
||||||
if not quiet:
|
|
||||||
print("failed to verify image", end=' ')
|
|
||||||
print("(%s:%s)" % (sys.exc_info()[0], sys.exc_info()[1]))
|
|
||||||
except IOError as v:
|
|
||||||
if not quiet:
|
|
||||||
print(file, "failed:", v)
|
|
||||||
except:
|
|
||||||
import traceback
|
|
||||||
if not quiet:
|
|
||||||
print(file, "failed:", "unexpected error")
|
|
||||||
traceback.print_exc(file=sys.stdout)
|
|
BIN
frappe-bench/env/bin/pilfile.pyc
vendored
BIN
frappe-bench/env/bin/pilfile.pyc
vendored
Binary file not shown.
57
frappe-bench/env/bin/pilfont.py
vendored
57
frappe-bench/env/bin/pilfont.py
vendored
@ -1,57 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# PIL raster font compiler
|
|
||||||
#
|
|
||||||
# history:
|
|
||||||
# 1997-08-25 fl created
|
|
||||||
# 2002-03-10 fl use "from PIL import"
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import glob
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# drivers
|
|
||||||
from PIL import BdfFontFile
|
|
||||||
from PIL import PcfFontFile
|
|
||||||
|
|
||||||
VERSION = "0.4"
|
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
|
||||||
print("PILFONT", VERSION, "-- PIL font compiler.")
|
|
||||||
print()
|
|
||||||
print("Usage: pilfont fontfiles...")
|
|
||||||
print()
|
|
||||||
print("Convert given font files to the PIL raster font format.")
|
|
||||||
print("This version of pilfont supports X BDF and PCF fonts.")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
files = []
|
|
||||||
for f in sys.argv[1:]:
|
|
||||||
files = files + glob.glob(f)
|
|
||||||
|
|
||||||
for f in files:
|
|
||||||
|
|
||||||
print(f + "...", end=' ')
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
fp = open(f, "rb")
|
|
||||||
|
|
||||||
try:
|
|
||||||
p = PcfFontFile.PcfFontFile(fp)
|
|
||||||
except SyntaxError:
|
|
||||||
fp.seek(0)
|
|
||||||
p = BdfFontFile.BdfFontFile(fp)
|
|
||||||
|
|
||||||
p.save(f)
|
|
||||||
|
|
||||||
except (SyntaxError, IOError):
|
|
||||||
print("failed")
|
|
||||||
|
|
||||||
else:
|
|
||||||
print("OK")
|
|
BIN
frappe-bench/env/bin/pilfont.pyc
vendored
BIN
frappe-bench/env/bin/pilfont.pyc
vendored
Binary file not shown.
102
frappe-bench/env/bin/pilprint.py
vendored
102
frappe-bench/env/bin/pilprint.py
vendored
@ -1,102 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library.
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# print image files to postscript printer
|
|
||||||
#
|
|
||||||
# History:
|
|
||||||
# 0.1 1996-04-20 fl Created
|
|
||||||
# 0.2 1996-10-04 fl Use draft mode when converting.
|
|
||||||
# 0.3 2003-05-06 fl Fixed a typo or two.
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
import getopt
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
VERSION = "pilprint 0.3/2003-05-05"
|
|
||||||
|
|
||||||
from PIL import Image
|
|
||||||
from PIL import PSDraw
|
|
||||||
|
|
||||||
letter = (1.0*72, 1.0*72, 7.5*72, 10.0*72)
|
|
||||||
|
|
||||||
|
|
||||||
def description(filepath, image):
|
|
||||||
title = os.path.splitext(os.path.split(filepath)[1])[0]
|
|
||||||
format = " (%dx%d "
|
|
||||||
if image.format:
|
|
||||||
format = " (" + image.format + " %dx%d "
|
|
||||||
return title + format % image.size + image.mode + ")"
|
|
||||||
|
|
||||||
if len(sys.argv) == 1:
|
|
||||||
print("PIL Print 0.3/2003-05-05 -- print image files")
|
|
||||||
print("Usage: pilprint files...")
|
|
||||||
print("Options:")
|
|
||||||
print(" -c colour printer (default is monochrome)")
|
|
||||||
print(" -d debug (show available drivers)")
|
|
||||||
print(" -p print via lpr (default is stdout)")
|
|
||||||
print(" -P <printer> same as -p but use given printer")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
|
||||||
opt, argv = getopt.getopt(sys.argv[1:], "cdpP:")
|
|
||||||
except getopt.error as v:
|
|
||||||
print(v)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
printerArgs = [] # print to stdout
|
|
||||||
monochrome = 1 # reduce file size for most common case
|
|
||||||
|
|
||||||
for o, a in opt:
|
|
||||||
if o == "-d":
|
|
||||||
# debug: show available drivers
|
|
||||||
Image.init()
|
|
||||||
print(Image.ID)
|
|
||||||
sys.exit(1)
|
|
||||||
elif o == "-c":
|
|
||||||
# colour printer
|
|
||||||
monochrome = 0
|
|
||||||
elif o == "-p":
|
|
||||||
# default printer channel
|
|
||||||
printerArgs = ["lpr"]
|
|
||||||
elif o == "-P":
|
|
||||||
# printer channel
|
|
||||||
printerArgs = ["lpr", "-P%s" % a]
|
|
||||||
|
|
||||||
for filepath in argv:
|
|
||||||
try:
|
|
||||||
|
|
||||||
im = Image.open(filepath)
|
|
||||||
|
|
||||||
title = description(filepath, im)
|
|
||||||
|
|
||||||
if monochrome and im.mode not in ["1", "L"]:
|
|
||||||
im.draft("L", im.size)
|
|
||||||
im = im.convert("L")
|
|
||||||
|
|
||||||
if printerArgs:
|
|
||||||
p = subprocess.Popen(printerArgs, stdin=subprocess.PIPE)
|
|
||||||
fp = p.stdin
|
|
||||||
else:
|
|
||||||
fp = sys.stdout
|
|
||||||
|
|
||||||
ps = PSDraw.PSDraw(fp)
|
|
||||||
|
|
||||||
ps.begin_document()
|
|
||||||
ps.setfont("Helvetica-Narrow-Bold", 18)
|
|
||||||
ps.text((letter[0], letter[3]+24), title)
|
|
||||||
ps.setfont("Helvetica-Narrow-Bold", 8)
|
|
||||||
ps.text((letter[0], letter[1]-30), VERSION)
|
|
||||||
ps.image(letter, im)
|
|
||||||
ps.end_document()
|
|
||||||
|
|
||||||
if printerArgs:
|
|
||||||
fp.close()
|
|
||||||
|
|
||||||
except:
|
|
||||||
print("cannot print image", end=' ')
|
|
||||||
print("(%s:%s)" % (sys.exc_info()[0], sys.exc_info()[1]))
|
|
BIN
frappe-bench/env/bin/pilprint.pyc
vendored
BIN
frappe-bench/env/bin/pilprint.pyc
vendored
Binary file not shown.
11
frappe-bench/env/bin/pip
vendored
11
frappe-bench/env/bin/pip
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pip import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/pip2
vendored
11
frappe-bench/env/bin/pip2
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pip import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/pip2.7
vendored
11
frappe-bench/env/bin/pip2.7
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pip import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
97
frappe-bench/env/bin/player.py
vendored
97
frappe-bench/env/bin/player.py
vendored
@ -1,97 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if sys.version_info[0] > 2:
|
|
||||||
import tkinter
|
|
||||||
else:
|
|
||||||
import Tkinter as tkinter
|
|
||||||
|
|
||||||
from PIL import Image, ImageTk
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
# an image animation player
|
|
||||||
|
|
||||||
class UI(tkinter.Label):
|
|
||||||
|
|
||||||
def __init__(self, master, im):
|
|
||||||
if isinstance(im, list):
|
|
||||||
# list of images
|
|
||||||
self.im = im[1:]
|
|
||||||
im = self.im[0]
|
|
||||||
else:
|
|
||||||
# sequence
|
|
||||||
self.im = im
|
|
||||||
|
|
||||||
if im.mode == "1":
|
|
||||||
self.image = ImageTk.BitmapImage(im, foreground="white")
|
|
||||||
else:
|
|
||||||
self.image = ImageTk.PhotoImage(im)
|
|
||||||
|
|
||||||
tkinter.Label.__init__(self, master, image=self.image, bg="black", bd=0)
|
|
||||||
|
|
||||||
self.update()
|
|
||||||
|
|
||||||
duration = im.info.get("duration", 100)
|
|
||||||
self.after(duration, self.next)
|
|
||||||
|
|
||||||
def next(self):
|
|
||||||
|
|
||||||
if isinstance(self.im, list):
|
|
||||||
|
|
||||||
try:
|
|
||||||
im = self.im[0]
|
|
||||||
del self.im[0]
|
|
||||||
self.image.paste(im)
|
|
||||||
except IndexError:
|
|
||||||
return # end of list
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
try:
|
|
||||||
im = self.im
|
|
||||||
im.seek(im.tell() + 1)
|
|
||||||
self.image.paste(im)
|
|
||||||
except EOFError:
|
|
||||||
return # end of file
|
|
||||||
|
|
||||||
duration = im.info.get("duration", 100)
|
|
||||||
self.after(duration, self.next)
|
|
||||||
|
|
||||||
self.update_idletasks()
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
# script interface
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
if not sys.argv[1:]:
|
|
||||||
print("Syntax: python player.py imagefile(s)")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
filename = sys.argv[1]
|
|
||||||
|
|
||||||
root = tkinter.Tk()
|
|
||||||
root.title(filename)
|
|
||||||
|
|
||||||
if len(sys.argv) > 2:
|
|
||||||
# list of images
|
|
||||||
print("loading...")
|
|
||||||
im = []
|
|
||||||
for filename in sys.argv[1:]:
|
|
||||||
im.append(Image.open(filename))
|
|
||||||
else:
|
|
||||||
# sequence
|
|
||||||
im = Image.open(filename)
|
|
||||||
|
|
||||||
UI(root, im).pack()
|
|
||||||
|
|
||||||
root.mainloop()
|
|
BIN
frappe-bench/env/bin/player.pyc
vendored
BIN
frappe-bench/env/bin/player.pyc
vendored
Binary file not shown.
11
frappe-bench/env/bin/pybabel
vendored
11
frappe-bench/env/bin/pybabel
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from babel.messages.frontend import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/pygmentize
vendored
11
frappe-bench/env/bin/pygmentize
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pygments.cmdline import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/pyjwt
vendored
11
frappe-bench/env/bin/pyjwt
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from jwt.__main__ import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
BIN
frappe-bench/env/bin/python
vendored
BIN
frappe-bench/env/bin/python
vendored
Binary file not shown.
78
frappe-bench/env/bin/python-config
vendored
78
frappe-bench/env/bin/python-config
vendored
@ -1,78 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import getopt
|
|
||||||
import sysconfig
|
|
||||||
|
|
||||||
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
|
|
||||||
'ldflags', 'help']
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 2):
|
|
||||||
valid_opts.insert(-1, 'extension-suffix')
|
|
||||||
valid_opts.append('abiflags')
|
|
||||||
if sys.version_info >= (3, 3):
|
|
||||||
valid_opts.append('configdir')
|
|
||||||
|
|
||||||
|
|
||||||
def exit_with_usage(code=1):
|
|
||||||
sys.stderr.write("Usage: {0} [{1}]\n".format(
|
|
||||||
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)))
|
|
||||||
sys.exit(code)
|
|
||||||
|
|
||||||
try:
|
|
||||||
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
|
|
||||||
except getopt.error:
|
|
||||||
exit_with_usage()
|
|
||||||
|
|
||||||
if not opts:
|
|
||||||
exit_with_usage()
|
|
||||||
|
|
||||||
pyver = sysconfig.get_config_var('VERSION')
|
|
||||||
getvar = sysconfig.get_config_var
|
|
||||||
|
|
||||||
opt_flags = [flag for (flag, val) in opts]
|
|
||||||
|
|
||||||
if '--help' in opt_flags:
|
|
||||||
exit_with_usage(code=0)
|
|
||||||
|
|
||||||
for opt in opt_flags:
|
|
||||||
if opt == '--prefix':
|
|
||||||
print(sysconfig.get_config_var('prefix'))
|
|
||||||
|
|
||||||
elif opt == '--exec-prefix':
|
|
||||||
print(sysconfig.get_config_var('exec_prefix'))
|
|
||||||
|
|
||||||
elif opt in ('--includes', '--cflags'):
|
|
||||||
flags = ['-I' + sysconfig.get_path('include'),
|
|
||||||
'-I' + sysconfig.get_path('platinclude')]
|
|
||||||
if opt == '--cflags':
|
|
||||||
flags.extend(getvar('CFLAGS').split())
|
|
||||||
print(' '.join(flags))
|
|
||||||
|
|
||||||
elif opt in ('--libs', '--ldflags'):
|
|
||||||
abiflags = getattr(sys, 'abiflags', '')
|
|
||||||
libs = ['-lpython' + pyver + abiflags]
|
|
||||||
libs += getvar('LIBS').split()
|
|
||||||
libs += getvar('SYSLIBS').split()
|
|
||||||
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
|
||||||
# shared library in prefix/lib/.
|
|
||||||
if opt == '--ldflags':
|
|
||||||
if not getvar('Py_ENABLE_SHARED'):
|
|
||||||
libs.insert(0, '-L' + getvar('LIBPL'))
|
|
||||||
if not getvar('PYTHONFRAMEWORK'):
|
|
||||||
libs.extend(getvar('LINKFORSHARED').split())
|
|
||||||
print(' '.join(libs))
|
|
||||||
|
|
||||||
elif opt == '--extension-suffix':
|
|
||||||
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
|
||||||
if ext_suffix is None:
|
|
||||||
ext_suffix = sysconfig.get_config_var('SO')
|
|
||||||
print(ext_suffix)
|
|
||||||
|
|
||||||
elif opt == '--abiflags':
|
|
||||||
if not getattr(sys, 'abiflags', None):
|
|
||||||
exit_with_usage()
|
|
||||||
print(sys.abiflags)
|
|
||||||
|
|
||||||
elif opt == '--configdir':
|
|
||||||
print(sysconfig.get_config_var('LIBPL'))
|
|
1
frappe-bench/env/bin/python2
vendored
1
frappe-bench/env/bin/python2
vendored
@ -1 +0,0 @@
|
|||||||
python
|
|
1
frappe-bench/env/bin/python2.7
vendored
1
frappe-bench/env/bin/python2.7
vendored
@ -1 +0,0 @@
|
|||||||
python
|
|
11
frappe-bench/env/bin/rq
vendored
11
frappe-bench/env/bin/rq
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from rq.cli import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
11
frappe-bench/env/bin/rqinfo
vendored
11
frappe-bench/env/bin/rqinfo
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from rq.cli import info
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(info())
|
|
11
frappe-bench/env/bin/rqworker
vendored
11
frappe-bench/env/bin/rqworker
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from rq.cli import worker
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(worker())
|
|
80
frappe-bench/env/bin/thresholder.py
vendored
80
frappe-bench/env/bin/thresholder.py
vendored
@ -1,80 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# this demo script illustrates how a 1-bit BitmapImage can be used
|
|
||||||
# as a dynamically updated overlay
|
|
||||||
#
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if sys.version_info[0] > 2:
|
|
||||||
import tkinter
|
|
||||||
else:
|
|
||||||
import Tkinter as tkinter
|
|
||||||
|
|
||||||
from PIL import Image, ImageTk
|
|
||||||
|
|
||||||
#
|
|
||||||
# an image viewer
|
|
||||||
|
|
||||||
|
|
||||||
class UI(tkinter.Frame):
|
|
||||||
def __init__(self, master, im, value=128):
|
|
||||||
tkinter.Frame.__init__(self, master)
|
|
||||||
|
|
||||||
self.image = im
|
|
||||||
self.value = value
|
|
||||||
|
|
||||||
self.canvas = tkinter.Canvas(self, width=im.size[0], height=im.size[1])
|
|
||||||
self.backdrop = ImageTk.PhotoImage(im)
|
|
||||||
self.canvas.create_image(0, 0, image=self.backdrop, anchor=tkinter.NW)
|
|
||||||
self.canvas.pack()
|
|
||||||
|
|
||||||
scale = tkinter.Scale(self, orient=tkinter.HORIZONTAL, from_=0, to=255,
|
|
||||||
resolution=1, command=self.update_scale,
|
|
||||||
length=256)
|
|
||||||
scale.set(value)
|
|
||||||
scale.bind("<ButtonRelease-1>", self.redraw)
|
|
||||||
scale.pack()
|
|
||||||
|
|
||||||
# uncomment the following line for instant feedback (might
|
|
||||||
# be too slow on some platforms)
|
|
||||||
# self.redraw()
|
|
||||||
|
|
||||||
def update_scale(self, value):
|
|
||||||
self.value = float(value)
|
|
||||||
|
|
||||||
self.redraw()
|
|
||||||
|
|
||||||
def redraw(self, event=None):
|
|
||||||
|
|
||||||
# create overlay (note the explicit conversion to mode "1")
|
|
||||||
im = self.image.point(lambda v, t=self.value: v >= t, "1")
|
|
||||||
self.overlay = ImageTk.BitmapImage(im, foreground="green")
|
|
||||||
|
|
||||||
# update canvas
|
|
||||||
self.canvas.delete("overlay")
|
|
||||||
self.canvas.create_image(0, 0, image=self.overlay, anchor=tkinter.NW,
|
|
||||||
tags="overlay")
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
|
||||||
# main
|
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
|
||||||
print("Usage: thresholder file")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
root = tkinter.Tk()
|
|
||||||
|
|
||||||
im = Image.open(sys.argv[1])
|
|
||||||
|
|
||||||
if im.mode != "L":
|
|
||||||
im = im.convert("L")
|
|
||||||
|
|
||||||
# im.thumbnail((320,200))
|
|
||||||
|
|
||||||
UI(root, im).pack()
|
|
||||||
|
|
||||||
root.mainloop()
|
|
BIN
frappe-bench/env/bin/thresholder.pyc
vendored
BIN
frappe-bench/env/bin/thresholder.pyc
vendored
Binary file not shown.
11
frappe-bench/env/bin/unidecode
vendored
11
frappe-bench/env/bin/unidecode
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from unidecode.util import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
55
frappe-bench/env/bin/viewer.py
vendored
55
frappe-bench/env/bin/viewer.py
vendored
@ -1,55 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
#
|
|
||||||
# The Python Imaging Library
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if sys.version_info[0] > 2:
|
|
||||||
import tkinter
|
|
||||||
else:
|
|
||||||
import Tkinter as tkinter
|
|
||||||
|
|
||||||
from PIL import Image, ImageTk
|
|
||||||
|
|
||||||
#
|
|
||||||
# an image viewer
|
|
||||||
|
|
||||||
|
|
||||||
class UI(tkinter.Label):
|
|
||||||
|
|
||||||
def __init__(self, master, im):
|
|
||||||
|
|
||||||
if im.mode == "1":
|
|
||||||
# bitmap image
|
|
||||||
self.image = ImageTk.BitmapImage(im, foreground="white")
|
|
||||||
tkinter.Label.__init__(self, master, image=self.image, bd=0,
|
|
||||||
bg="black")
|
|
||||||
|
|
||||||
else:
|
|
||||||
# photo image
|
|
||||||
self.image = ImageTk.PhotoImage(im)
|
|
||||||
tkinter.Label.__init__(self, master, image=self.image, bd=0)
|
|
||||||
|
|
||||||
#
|
|
||||||
# script interface
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
if not sys.argv[1:]:
|
|
||||||
print("Syntax: python viewer.py imagefile")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
filename = sys.argv[1]
|
|
||||||
|
|
||||||
root = tkinter.Tk()
|
|
||||||
root.title(filename)
|
|
||||||
|
|
||||||
im = Image.open(filename)
|
|
||||||
|
|
||||||
UI(root, im).pack()
|
|
||||||
|
|
||||||
root.mainloop()
|
|
BIN
frappe-bench/env/bin/viewer.pyc
vendored
BIN
frappe-bench/env/bin/viewer.pyc
vendored
Binary file not shown.
11
frappe-bench/env/bin/virtualenv
vendored
11
frappe-bench/env/bin/virtualenv
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from virtualenv import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
12
frappe-bench/env/bin/watchmedo
vendored
12
frappe-bench/env/bin/watchmedo
vendored
@ -1,12 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
# EASY-INSTALL-ENTRY-SCRIPT: 'watchdog==0.8.0','console_scripts','watchmedo'
|
|
||||||
__requires__ = 'watchdog==0.8.0'
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pkg_resources import load_entry_point
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(
|
|
||||||
load_entry_point('watchdog==0.8.0', 'console_scripts', 'watchmedo')()
|
|
||||||
)
|
|
11
frappe-bench/env/bin/wheel
vendored
11
frappe-bench/env/bin/wheel
vendored
@ -1,11 +0,0 @@
|
|||||||
#!/home/frappe/frappe-bench/env/bin/python
|
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from wheel.tool import main
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
|
||||||
sys.exit(main())
|
|
1
frappe-bench/env/include/python2.7
vendored
1
frappe-bench/env/include/python2.7
vendored
@ -1 +0,0 @@
|
|||||||
/usr/include/python2.7
|
|
1
frappe-bench/env/lib/python2.7/UserDict.py
vendored
1
frappe-bench/env/lib/python2.7/UserDict.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/UserDict.py
|
|
BIN
frappe-bench/env/lib/python2.7/UserDict.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/UserDict.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/_abcoll.py
vendored
1
frappe-bench/env/lib/python2.7/_abcoll.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/_abcoll.py
|
|
BIN
frappe-bench/env/lib/python2.7/_abcoll.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/_abcoll.pyc
vendored
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/_weakrefset.py
|
|
BIN
frappe-bench/env/lib/python2.7/_weakrefset.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/_weakrefset.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/abc.py
vendored
1
frappe-bench/env/lib/python2.7/abc.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/abc.py
|
|
BIN
frappe-bench/env/lib/python2.7/abc.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/abc.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/codecs.py
vendored
1
frappe-bench/env/lib/python2.7/codecs.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/codecs.py
|
|
BIN
frappe-bench/env/lib/python2.7/codecs.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/codecs.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/copy_reg.py
vendored
1
frappe-bench/env/lib/python2.7/copy_reg.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/copy_reg.py
|
|
BIN
frappe-bench/env/lib/python2.7/copy_reg.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/copy_reg.pyc
vendored
Binary file not shown.
101
frappe-bench/env/lib/python2.7/distutils/__init__.py
vendored
101
frappe-bench/env/lib/python2.7/distutils/__init__.py
vendored
@ -1,101 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
import warnings
|
|
||||||
import imp
|
|
||||||
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
|
|
||||||
# Important! To work on pypy, this must be a module that resides in the
|
|
||||||
# lib-python/modified-x.y.z directory
|
|
||||||
|
|
||||||
dirname = os.path.dirname
|
|
||||||
|
|
||||||
distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils')
|
|
||||||
if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)):
|
|
||||||
warnings.warn(
|
|
||||||
"The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
|
|
||||||
else:
|
|
||||||
__path__.insert(0, distutils_path)
|
|
||||||
real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY))
|
|
||||||
# Copy the relevant attributes
|
|
||||||
try:
|
|
||||||
__revision__ = real_distutils.__revision__
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
__version__ = real_distutils.__version__
|
|
||||||
|
|
||||||
from distutils import dist, sysconfig
|
|
||||||
|
|
||||||
try:
|
|
||||||
basestring
|
|
||||||
except NameError:
|
|
||||||
basestring = str
|
|
||||||
|
|
||||||
## patch build_ext (distutils doesn't know how to get the libs directory
|
|
||||||
## path on windows - it hardcodes the paths around the patched sys.prefix)
|
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
from distutils.command.build_ext import build_ext as old_build_ext
|
|
||||||
class build_ext(old_build_ext):
|
|
||||||
def finalize_options (self):
|
|
||||||
if self.library_dirs is None:
|
|
||||||
self.library_dirs = []
|
|
||||||
elif isinstance(self.library_dirs, basestring):
|
|
||||||
self.library_dirs = self.library_dirs.split(os.pathsep)
|
|
||||||
|
|
||||||
self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs"))
|
|
||||||
old_build_ext.finalize_options(self)
|
|
||||||
|
|
||||||
from distutils.command import build_ext as build_ext_module
|
|
||||||
build_ext_module.build_ext = build_ext
|
|
||||||
|
|
||||||
## distutils.dist patches:
|
|
||||||
|
|
||||||
old_find_config_files = dist.Distribution.find_config_files
|
|
||||||
def find_config_files(self):
|
|
||||||
found = old_find_config_files(self)
|
|
||||||
system_distutils = os.path.join(distutils_path, 'distutils.cfg')
|
|
||||||
#if os.path.exists(system_distutils):
|
|
||||||
# found.insert(0, system_distutils)
|
|
||||||
# What to call the per-user config file
|
|
||||||
if os.name == 'posix':
|
|
||||||
user_filename = ".pydistutils.cfg"
|
|
||||||
else:
|
|
||||||
user_filename = "pydistutils.cfg"
|
|
||||||
user_filename = os.path.join(sys.prefix, user_filename)
|
|
||||||
if os.path.isfile(user_filename):
|
|
||||||
for item in list(found):
|
|
||||||
if item.endswith('pydistutils.cfg'):
|
|
||||||
found.remove(item)
|
|
||||||
found.append(user_filename)
|
|
||||||
return found
|
|
||||||
dist.Distribution.find_config_files = find_config_files
|
|
||||||
|
|
||||||
## distutils.sysconfig patches:
|
|
||||||
|
|
||||||
old_get_python_inc = sysconfig.get_python_inc
|
|
||||||
def sysconfig_get_python_inc(plat_specific=0, prefix=None):
|
|
||||||
if prefix is None:
|
|
||||||
prefix = sys.real_prefix
|
|
||||||
return old_get_python_inc(plat_specific, prefix)
|
|
||||||
sysconfig_get_python_inc.__doc__ = old_get_python_inc.__doc__
|
|
||||||
sysconfig.get_python_inc = sysconfig_get_python_inc
|
|
||||||
|
|
||||||
old_get_python_lib = sysconfig.get_python_lib
|
|
||||||
def sysconfig_get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
|
|
||||||
if standard_lib and prefix is None:
|
|
||||||
prefix = sys.real_prefix
|
|
||||||
return old_get_python_lib(plat_specific, standard_lib, prefix)
|
|
||||||
sysconfig_get_python_lib.__doc__ = old_get_python_lib.__doc__
|
|
||||||
sysconfig.get_python_lib = sysconfig_get_python_lib
|
|
||||||
|
|
||||||
old_get_config_vars = sysconfig.get_config_vars
|
|
||||||
def sysconfig_get_config_vars(*args):
|
|
||||||
real_vars = old_get_config_vars(*args)
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
lib_dir = os.path.join(sys.real_prefix, "libs")
|
|
||||||
if isinstance(real_vars, dict) and 'LIBDIR' not in real_vars:
|
|
||||||
real_vars['LIBDIR'] = lib_dir # asked for all
|
|
||||||
elif isinstance(real_vars, list) and 'LIBDIR' in args:
|
|
||||||
real_vars = real_vars + [lib_dir] # asked for list
|
|
||||||
return real_vars
|
|
||||||
sysconfig_get_config_vars.__doc__ = old_get_config_vars.__doc__
|
|
||||||
sysconfig.get_config_vars = sysconfig_get_config_vars
|
|
Binary file not shown.
@ -1,6 +0,0 @@
|
|||||||
# This is a config file local to this virtualenv installation
|
|
||||||
# You may include options that will be used by all distutils commands,
|
|
||||||
# and by easy_install. For instance:
|
|
||||||
#
|
|
||||||
# [easy_install]
|
|
||||||
# find_links = http://mylocalsite
|
|
1
frappe-bench/env/lib/python2.7/encodings
vendored
1
frappe-bench/env/lib/python2.7/encodings
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/encodings
|
|
1
frappe-bench/env/lib/python2.7/fnmatch.py
vendored
1
frappe-bench/env/lib/python2.7/fnmatch.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/fnmatch.py
|
|
BIN
frappe-bench/env/lib/python2.7/fnmatch.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/fnmatch.pyc
vendored
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/genericpath.py
|
|
BIN
frappe-bench/env/lib/python2.7/genericpath.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/genericpath.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/lib-dynload
vendored
1
frappe-bench/env/lib/python2.7/lib-dynload
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/lib-dynload
|
|
1
frappe-bench/env/lib/python2.7/linecache.py
vendored
1
frappe-bench/env/lib/python2.7/linecache.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/linecache.py
|
|
BIN
frappe-bench/env/lib/python2.7/linecache.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/linecache.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/locale.py
vendored
1
frappe-bench/env/lib/python2.7/locale.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/locale.py
|
|
BIN
frappe-bench/env/lib/python2.7/locale.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/locale.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/ntpath.py
vendored
1
frappe-bench/env/lib/python2.7/ntpath.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/ntpath.py
|
|
@ -1 +0,0 @@
|
|||||||
/usr
|
|
1
frappe-bench/env/lib/python2.7/os.py
vendored
1
frappe-bench/env/lib/python2.7/os.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/os.py
|
|
BIN
frappe-bench/env/lib/python2.7/os.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/os.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/posixpath.py
vendored
1
frappe-bench/env/lib/python2.7/posixpath.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/posixpath.py
|
|
BIN
frappe-bench/env/lib/python2.7/posixpath.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/posixpath.pyc
vendored
Binary file not shown.
1
frappe-bench/env/lib/python2.7/re.py
vendored
1
frappe-bench/env/lib/python2.7/re.py
vendored
@ -1 +0,0 @@
|
|||||||
/usr/lib/python2.7/re.py
|
|
BIN
frappe-bench/env/lib/python2.7/re.pyc
vendored
BIN
frappe-bench/env/lib/python2.7/re.pyc
vendored
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
A collection of tools for internationalizing Python applications.
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user