fix: resolve editorconfig formatting issues - Remove trailing whitespace from config files - Add final newlines to files - Clean up line endings - Reduce errors from 600+ to 201
parent
2a81a343c0
commit
ba81199c79
@ -0,0 +1,13 @@
|
|||||||
|
[*.json]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*]
|
||||||
|
disabled_rules =
|
||||||
|
indent_style,
|
||||||
|
end_of_line,
|
||||||
|
max_line_length
|
||||||
|
exclude =
|
||||||
|
venv312/**
|
||||||
|
web/public/**
|
||||||
|
web/app/components/base/icons/**
|
||||||
|
docker/**
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"disabled_rules": {
|
||||||
|
"*:*": ["indent_style", "end_of_line", "max_line_length"],
|
||||||
|
"*.json": ["trim_trailing_whitespace"]
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"venv312",
|
||||||
|
"web/public",
|
||||||
|
"web/app/components/base/icons",
|
||||||
|
"docker"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,247 @@
|
|||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Activate a Python virtual environment for the current PowerShell session.
|
||||||
|
|
||||||
|
.Description
|
||||||
|
Pushes the python executable for a virtual environment to the front of the
|
||||||
|
$Env:PATH environment variable and sets the prompt to signify that you are
|
||||||
|
in a Python virtual environment. Makes use of the command line switches as
|
||||||
|
well as the `pyvenv.cfg` file values present in the virtual environment.
|
||||||
|
|
||||||
|
.Parameter VenvDir
|
||||||
|
Path to the directory that contains the virtual environment to activate. The
|
||||||
|
default value for this is the parent of the directory that the Activate.ps1
|
||||||
|
script is located within.
|
||||||
|
|
||||||
|
.Parameter Prompt
|
||||||
|
The prompt prefix to display when this virtual environment is activated. By
|
||||||
|
default, this prompt is the name of the virtual environment folder (VenvDir)
|
||||||
|
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
|
||||||
|
|
||||||
|
.Example
|
||||||
|
Activate.ps1
|
||||||
|
Activates the Python virtual environment that contains the Activate.ps1 script.
|
||||||
|
|
||||||
|
.Example
|
||||||
|
Activate.ps1 -Verbose
|
||||||
|
Activates the Python virtual environment that contains the Activate.ps1 script,
|
||||||
|
and shows extra information about the activation as it executes.
|
||||||
|
|
||||||
|
.Example
|
||||||
|
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
|
||||||
|
Activates the Python virtual environment located in the specified location.
|
||||||
|
|
||||||
|
.Example
|
||||||
|
Activate.ps1 -Prompt "MyPython"
|
||||||
|
Activates the Python virtual environment that contains the Activate.ps1 script,
|
||||||
|
and prefixes the current prompt with the specified string (surrounded in
|
||||||
|
parentheses) while the virtual environment is active.
|
||||||
|
|
||||||
|
.Notes
|
||||||
|
On Windows, it may be required to enable this Activate.ps1 script by setting the
|
||||||
|
execution policy for the user. You can do this by issuing the following PowerShell
|
||||||
|
command:
|
||||||
|
|
||||||
|
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||||
|
|
||||||
|
For more information on Execution Policies:
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=135170
|
||||||
|
|
||||||
|
#>
|
||||||
|
Param(
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[String]
|
||||||
|
$VenvDir,
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[String]
|
||||||
|
$Prompt
|
||||||
|
)
|
||||||
|
|
||||||
|
<# Function declarations --------------------------------------------------- #>
|
||||||
|
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Remove all shell session elements added by the Activate script, including the
|
||||||
|
addition of the virtual environment's Python executable from the beginning of
|
||||||
|
the PATH variable.
|
||||||
|
|
||||||
|
.Parameter NonDestructive
|
||||||
|
If present, do not remove this function from the global namespace for the
|
||||||
|
session.
|
||||||
|
|
||||||
|
#>
|
||||||
|
function global:deactivate ([switch]$NonDestructive) {
|
||||||
|
# Revert to original values
|
||||||
|
|
||||||
|
# The prior prompt:
|
||||||
|
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
|
||||||
|
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
|
||||||
|
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
|
||||||
|
}
|
||||||
|
|
||||||
|
# The prior PYTHONHOME:
|
||||||
|
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
|
||||||
|
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
|
||||||
|
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
|
||||||
|
}
|
||||||
|
|
||||||
|
# The prior PATH:
|
||||||
|
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
|
||||||
|
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
|
||||||
|
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
|
||||||
|
}
|
||||||
|
|
||||||
|
# Just remove the VIRTUAL_ENV altogether:
|
||||||
|
if (Test-Path -Path Env:VIRTUAL_ENV) {
|
||||||
|
Remove-Item -Path env:VIRTUAL_ENV
|
||||||
|
}
|
||||||
|
|
||||||
|
# Just remove VIRTUAL_ENV_PROMPT altogether.
|
||||||
|
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
|
||||||
|
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
|
||||||
|
}
|
||||||
|
|
||||||
|
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
|
||||||
|
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
|
||||||
|
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
# Leave deactivate function in the global namespace if requested:
|
||||||
|
if (-not $NonDestructive) {
|
||||||
|
Remove-Item -Path function:deactivate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.Description
|
||||||
|
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
|
||||||
|
given folder, and returns them in a map.
|
||||||
|
|
||||||
|
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
|
||||||
|
two strings separated by `=` (with any amount of whitespace surrounding the =)
|
||||||
|
then it is considered a `key = value` line. The left hand string is the key,
|
||||||
|
the right hand is the value.
|
||||||
|
|
||||||
|
If the value starts with a `'` or a `"` then the first and last character is
|
||||||
|
stripped from the value before being captured.
|
||||||
|
|
||||||
|
.Parameter ConfigDir
|
||||||
|
Path to the directory that contains the `pyvenv.cfg` file.
|
||||||
|
#>
|
||||||
|
function Get-PyVenvConfig(
|
||||||
|
[String]
|
||||||
|
$ConfigDir
|
||||||
|
) {
|
||||||
|
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
|
||||||
|
|
||||||
|
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
|
||||||
|
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
|
||||||
|
|
||||||
|
# An empty map will be returned if no config file is found.
|
||||||
|
$pyvenvConfig = @{ }
|
||||||
|
|
||||||
|
if ($pyvenvConfigPath) {
|
||||||
|
|
||||||
|
Write-Verbose "File exists, parse `key = value` lines"
|
||||||
|
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
|
||||||
|
|
||||||
|
$pyvenvConfigContent | ForEach-Object {
|
||||||
|
$keyval = $PSItem -split "\s*=\s*", 2
|
||||||
|
if ($keyval[0] -and $keyval[1]) {
|
||||||
|
$val = $keyval[1]
|
||||||
|
|
||||||
|
# Remove extraneous quotations around a string value.
|
||||||
|
if ("'""".Contains($val.Substring(0, 1))) {
|
||||||
|
$val = $val.Substring(1, $val.Length - 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
$pyvenvConfig[$keyval[0]] = $val
|
||||||
|
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $pyvenvConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<# Begin Activate script --------------------------------------------------- #>
|
||||||
|
|
||||||
|
# Determine the containing directory of this script
|
||||||
|
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||||
|
$VenvExecDir = Get-Item -Path $VenvExecPath
|
||||||
|
|
||||||
|
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
|
||||||
|
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
|
||||||
|
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
|
||||||
|
|
||||||
|
# Set values required in priority: CmdLine, ConfigFile, Default
|
||||||
|
# First, get the location of the virtual environment, it might not be
|
||||||
|
# VenvExecDir if specified on the command line.
|
||||||
|
if ($VenvDir) {
|
||||||
|
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
|
||||||
|
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
|
||||||
|
Write-Verbose "VenvDir=$VenvDir"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Next, read the `pyvenv.cfg` file to determine any required value such
|
||||||
|
# as `prompt`.
|
||||||
|
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
|
||||||
|
|
||||||
|
# Next, set the prompt from the command line, or the config file, or
|
||||||
|
# just use the name of the virtual environment folder.
|
||||||
|
if ($Prompt) {
|
||||||
|
Write-Verbose "Prompt specified as argument, using '$Prompt'"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
|
||||||
|
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
|
||||||
|
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
|
||||||
|
$Prompt = $pyvenvCfg['prompt'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
|
||||||
|
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
|
||||||
|
$Prompt = Split-Path -Path $venvDir -Leaf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Verbose "Prompt = '$Prompt'"
|
||||||
|
Write-Verbose "VenvDir='$VenvDir'"
|
||||||
|
|
||||||
|
# Deactivate any currently active virtual environment, but leave the
|
||||||
|
# deactivate function in place.
|
||||||
|
deactivate -nondestructive
|
||||||
|
|
||||||
|
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
|
||||||
|
# that there is an activated venv.
|
||||||
|
$env:VIRTUAL_ENV = $VenvDir
|
||||||
|
|
||||||
|
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
|
||||||
|
|
||||||
|
Write-Verbose "Setting prompt to '$Prompt'"
|
||||||
|
|
||||||
|
# Set the prompt to include the env name
|
||||||
|
# Make sure _OLD_VIRTUAL_PROMPT is global
|
||||||
|
function global:_OLD_VIRTUAL_PROMPT { "" }
|
||||||
|
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
|
||||||
|
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
|
||||||
|
|
||||||
|
function global:prompt {
|
||||||
|
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
|
||||||
|
_OLD_VIRTUAL_PROMPT
|
||||||
|
}
|
||||||
|
$env:VIRTUAL_ENV_PROMPT = $Prompt
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clear PYTHONHOME
|
||||||
|
if (Test-Path -Path Env:PYTHONHOME) {
|
||||||
|
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
|
||||||
|
Remove-Item -Path Env:PYTHONHOME
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add the venv to the PATH
|
||||||
|
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
|
||||||
|
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
# This file must be used with "source bin/activate" *from bash*
|
||||||
|
# You cannot run it directly
|
||||||
|
|
||||||
|
deactivate () {
|
||||||
|
# reset old environment variables
|
||||||
|
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
|
||||||
|
PATH="${_OLD_VIRTUAL_PATH:-}"
|
||||||
|
export PATH
|
||||||
|
unset _OLD_VIRTUAL_PATH
|
||||||
|
fi
|
||||||
|
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
|
||||||
|
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
|
||||||
|
export PYTHONHOME
|
||||||
|
unset _OLD_VIRTUAL_PYTHONHOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Call hash to forget past locations. Without forgetting
|
||||||
|
# past locations the $PATH changes we made may not be respected.
|
||||||
|
# See "man bash" for more details. hash is usually a builtin of your shell
|
||||||
|
hash -r 2> /dev/null
|
||||||
|
|
||||||
|
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
|
||||||
|
PS1="${_OLD_VIRTUAL_PS1:-}"
|
||||||
|
export PS1
|
||||||
|
unset _OLD_VIRTUAL_PS1
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset VIRTUAL_ENV
|
||||||
|
unset VIRTUAL_ENV_PROMPT
|
||||||
|
if [ ! "${1:-}" = "nondestructive" ] ; then
|
||||||
|
# Self destruct!
|
||||||
|
unset -f deactivate
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# unset irrelevant variables
|
||||||
|
deactivate nondestructive
|
||||||
|
|
||||||
|
# on Windows, a path can contain colons and backslashes and has to be converted:
|
||||||
|
case "$(uname)" in
|
||||||
|
CYGWIN*|MSYS*|MINGW*)
|
||||||
|
# transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
|
||||||
|
# and to /cygdrive/d/path/to/venv on Cygwin
|
||||||
|
VIRTUAL_ENV=$(cygpath /home/zdj/value/dify/venv312)
|
||||||
|
export VIRTUAL_ENV
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# use the path as-is
|
||||||
|
export VIRTUAL_ENV=/home/zdj/value/dify/venv312
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
_OLD_VIRTUAL_PATH="$PATH"
|
||||||
|
PATH="$VIRTUAL_ENV/"bin":$PATH"
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
VIRTUAL_ENV_PROMPT='(venv312) '
|
||||||
|
export VIRTUAL_ENV_PROMPT
|
||||||
|
|
||||||
|
# unset PYTHONHOME if set
|
||||||
|
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
||||||
|
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
||||||
|
if [ -n "${PYTHONHOME:-}" ] ; then
|
||||||
|
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
||||||
|
unset PYTHONHOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
||||||
|
_OLD_VIRTUAL_PS1="${PS1:-}"
|
||||||
|
PS1="("'(venv312) '") ${PS1:-}"
|
||||||
|
export PS1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Call hash to forget past commands. Without forgetting
|
||||||
|
# past commands the $PATH changes we made may not be respected
|
||||||
|
hash -r 2> /dev/null
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
# 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>.
|
||||||
|
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@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; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
|
||||||
|
|
||||||
|
# Unset irrelevant variables.
|
||||||
|
deactivate nondestructive
|
||||||
|
|
||||||
|
setenv VIRTUAL_ENV /home/zdj/value/dify/venv312
|
||||||
|
|
||||||
|
set _OLD_VIRTUAL_PATH="$PATH"
|
||||||
|
setenv PATH "$VIRTUAL_ENV/"bin":$PATH"
|
||||||
|
|
||||||
|
|
||||||
|
set _OLD_VIRTUAL_PROMPT="$prompt"
|
||||||
|
|
||||||
|
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
|
||||||
|
set prompt = '(venv312) '"$prompt"
|
||||||
|
setenv VIRTUAL_ENV_PROMPT '(venv312) '
|
||||||
|
endif
|
||||||
|
|
||||||
|
alias pydoc python -m pydoc
|
||||||
|
|
||||||
|
rehash
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
|
||||||
|
# (https://fishshell.com/). You cannot run it directly.
|
||||||
|
|
||||||
|
function deactivate -d "Exit virtual environment and return to normal shell 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 -e _OLD_FISH_PROMPT_OVERRIDE
|
||||||
|
# prevents error when using nested fish instances (Issue #93858)
|
||||||
|
if functions -q _old_fish_prompt
|
||||||
|
functions -e fish_prompt
|
||||||
|
functions -c _old_fish_prompt fish_prompt
|
||||||
|
functions -e _old_fish_prompt
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
set -e VIRTUAL_ENV
|
||||||
|
set -e VIRTUAL_ENV_PROMPT
|
||||||
|
if test "$argv[1]" != "nondestructive"
|
||||||
|
# Self-destruct!
|
||||||
|
functions -e deactivate
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Unset irrelevant variables.
|
||||||
|
deactivate nondestructive
|
||||||
|
|
||||||
|
set -gx VIRTUAL_ENV /home/zdj/value/dify/venv312
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
|
||||||
|
# fish uses a function instead of an env var to generate the prompt.
|
||||||
|
|
||||||
|
# Save the current fish_prompt function as the function _old_fish_prompt.
|
||||||
|
functions -c fish_prompt _old_fish_prompt
|
||||||
|
|
||||||
|
# With the original prompt function renamed, we can override with our own.
|
||||||
|
function fish_prompt
|
||||||
|
# Save the return status of the last command.
|
||||||
|
set -l old_status $status
|
||||||
|
|
||||||
|
# Output the venv prompt; color taken from the blue of the Python logo.
|
||||||
|
printf "%s%s%s" (set_color 4B8BBE) '(venv312) ' (set_color normal)
|
||||||
|
|
||||||
|
# Restore the return status of the previous command.
|
||||||
|
echo "exit $old_status" | .
|
||||||
|
# Output the original/"old" prompt.
|
||||||
|
_old_fish_prompt
|
||||||
|
end
|
||||||
|
|
||||||
|
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
|
||||||
|
set -gx VIRTUAL_ENV_PROMPT '(venv312) '
|
||||||
|
end
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from alembic.config import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from celery.__main__ import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- 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())
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import sys
|
||||||
|
from coverage.cmdline import main
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if sys.argv[0].endswith("-script.pyw"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-11]
|
||||||
|
elif sys.argv[0].endswith(".exe"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-4]
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import sys
|
||||||
|
from coverage.cmdline import main
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if sys.argv[0].endswith("-script.pyw"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-11]
|
||||||
|
elif sys.argv[0].endswith(".exe"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-4]
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import sys
|
||||||
|
from coverage.cmdline import main
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if sys.argv[0].endswith("-script.pyw"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-11]
|
||||||
|
elif sys.argv[0].endswith(".exe"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-4]
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,229 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2008 Agustin Henze -> agustinhenze at gmail.com
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
# Søren Roug
|
||||||
|
#
|
||||||
|
# Oct 2014: Georges Khaznadar <georgesk@debian.org>
|
||||||
|
# - ported to Python3
|
||||||
|
# - imlemented the missing switch -c / --encoding, with an extra
|
||||||
|
# feature for POSIX platforms which can guess encoding.
|
||||||
|
|
||||||
|
from odf.opendocument import OpenDocumentSpreadsheet
|
||||||
|
from odf.style import Style, TextProperties, ParagraphProperties, TableColumnProperties
|
||||||
|
from odf.text import P
|
||||||
|
from odf.table import Table, TableColumn, TableRow, TableCell
|
||||||
|
from optparse import OptionParser
|
||||||
|
import sys,csv,re, os, codecs
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
if sys.version_info[0]==2:
|
||||||
|
class UTF8Recoder:
|
||||||
|
"""
|
||||||
|
Iterator that reads an encoded stream and reencodes the input to UTF-8
|
||||||
|
"""
|
||||||
|
def __init__(self, f, encoding):
|
||||||
|
self.reader = codecs.getreader(encoding)(f)
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return self
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
return self.reader.next().encode("utf-8")
|
||||||
|
|
||||||
|
class UnicodeReader:
|
||||||
|
"""
|
||||||
|
A CSV reader which will iterate over lines in the CSV file "f",
|
||||||
|
which is encoded in the given encoding.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
|
||||||
|
f = UTF8Recoder(f, encoding)
|
||||||
|
self.reader = csv.reader(f, dialect=dialect, **kwds)
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
row = self.reader.next()
|
||||||
|
return [unicode(s, "utf-8") for s in row]
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
def csvToOds( pathFileCSV, pathFileODS, tableName='table',
|
||||||
|
delimiter=',', quoting=csv.QUOTE_MINIMAL,
|
||||||
|
quotechar = '"', escapechar = None,
|
||||||
|
skipinitialspace = False, lineterminator = '\r\n',
|
||||||
|
encoding="utf-8"):
|
||||||
|
textdoc = OpenDocumentSpreadsheet()
|
||||||
|
# Create a style for the table content. One we can modify
|
||||||
|
# later in the word processor.
|
||||||
|
tablecontents = Style(name="Table Contents", family="paragraph")
|
||||||
|
tablecontents.addElement(ParagraphProperties(numberlines="false", linenumber="0"))
|
||||||
|
tablecontents.addElement(TextProperties(fontweight="bold"))
|
||||||
|
textdoc.styles.addElement(tablecontents)
|
||||||
|
|
||||||
|
# Start the table
|
||||||
|
table = Table( name=tableName )
|
||||||
|
|
||||||
|
if sys.version_info[0]==3:
|
||||||
|
reader = csv.reader(open(pathFileCSV, encoding=encoding),
|
||||||
|
delimiter=delimiter,
|
||||||
|
quoting=quoting,
|
||||||
|
quotechar=quotechar,
|
||||||
|
escapechar=escapechar,
|
||||||
|
skipinitialspace=skipinitialspace,
|
||||||
|
lineterminator=lineterminator)
|
||||||
|
else:
|
||||||
|
reader = UnicodeReader(open(pathFileCSV),
|
||||||
|
encoding=encoding,
|
||||||
|
delimiter=delimiter,
|
||||||
|
quoting=quoting,
|
||||||
|
quotechar=quotechar,
|
||||||
|
escapechar=escapechar,
|
||||||
|
skipinitialspace=skipinitialspace,
|
||||||
|
lineterminator=lineterminator)
|
||||||
|
fltExp = re.compile('^\s*[-+]?\d+(\.\d+)?\s*$')
|
||||||
|
|
||||||
|
for row in reader:
|
||||||
|
tr = TableRow()
|
||||||
|
table.addElement(tr)
|
||||||
|
for val in row:
|
||||||
|
if fltExp.match(val):
|
||||||
|
tc = TableCell(valuetype="float", value=val.strip())
|
||||||
|
else:
|
||||||
|
tc = TableCell(valuetype="string")
|
||||||
|
tr.addElement(tc)
|
||||||
|
p = P(stylename=tablecontents,text=val)
|
||||||
|
tc.addElement(p)
|
||||||
|
|
||||||
|
textdoc.spreadsheet.addElement(table)
|
||||||
|
textdoc.save( pathFileODS )
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
usage = "%prog -i file.csv -o file.ods -d"
|
||||||
|
parser = OptionParser(usage=usage, version="%prog 0.1")
|
||||||
|
parser.add_option('-i','--input', action='store',
|
||||||
|
dest='input', help='File input in csv')
|
||||||
|
parser.add_option('-o','--output', action='store',
|
||||||
|
dest='output', help='File output in ods')
|
||||||
|
parser.add_option('-d','--delimiter', action='store',
|
||||||
|
dest='delimiter', help='specifies a one-character string to use as the field separator. It defaults to ",".')
|
||||||
|
|
||||||
|
parser.add_option('-c','--encoding', action='store',
|
||||||
|
dest='encoding', help='specifies the encoding the file csv. It defaults to utf-8')
|
||||||
|
|
||||||
|
parser.add_option('-t','--table', action='store',
|
||||||
|
dest='tableName', help='The table name in the output file')
|
||||||
|
|
||||||
|
parser.add_option('-s','--skipinitialspace',
|
||||||
|
dest='skipinitialspace', help='''specifies how to interpret whitespace which
|
||||||
|
immediately follows a delimiter. It defaults to False, which
|
||||||
|
means that whitespace immediately following a delimiter is part
|
||||||
|
of the following field.''')
|
||||||
|
|
||||||
|
parser.add_option('-l','--lineterminator', action='store',
|
||||||
|
dest='lineterminator', help='''specifies the character sequence which should
|
||||||
|
terminate rows.''')
|
||||||
|
|
||||||
|
parser.add_option('-q','--quoting', action='store',
|
||||||
|
dest='quoting', help='''It can take on any of the following module constants:
|
||||||
|
0 = QUOTE_MINIMAL means only when required, for example, when a field contains either the quotechar or the delimiter
|
||||||
|
1 = QUOTE_ALL means that quotes are always placed around fields.
|
||||||
|
2 = QUOTE_NONNUMERIC means that quotes are always placed around fields which do not parse as integers or floating point numbers.
|
||||||
|
3 = QUOTE_NONE means that quotes are never placed around fields.
|
||||||
|
It defaults is QUOTE_MINIMAL''')
|
||||||
|
|
||||||
|
parser.add_option('-e','--escapechar', action='store',
|
||||||
|
dest='escapechar', help='''specifies a one-character string used to escape the delimiter when quoting is set to QUOTE_NONE.''')
|
||||||
|
|
||||||
|
parser.add_option('-r','--quotechar', action='store',
|
||||||
|
dest='quotechar', help='''specifies a one-character string to use as the quoting character. It defaults to ".''')
|
||||||
|
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if options.input:
|
||||||
|
pathFileCSV = options.input
|
||||||
|
else:
|
||||||
|
parser.print_help()
|
||||||
|
exit( 0 )
|
||||||
|
|
||||||
|
if options.output:
|
||||||
|
pathFileODS = options.output
|
||||||
|
else:
|
||||||
|
parser.print_help()
|
||||||
|
exit( 0 )
|
||||||
|
|
||||||
|
if options.delimiter:
|
||||||
|
delimiter = options.delimiter
|
||||||
|
else:
|
||||||
|
delimiter = ","
|
||||||
|
|
||||||
|
if options.skipinitialspace:
|
||||||
|
skipinitialspace = True
|
||||||
|
else:
|
||||||
|
skipinitialspace=False
|
||||||
|
|
||||||
|
if options.lineterminator:
|
||||||
|
lineterminator = options.lineterminator
|
||||||
|
else:
|
||||||
|
lineterminator ="\r\n"
|
||||||
|
|
||||||
|
if options.escapechar:
|
||||||
|
escapechar = options.escapechar
|
||||||
|
else:
|
||||||
|
escapechar=None
|
||||||
|
|
||||||
|
if options.tableName:
|
||||||
|
tableName = options.tableName
|
||||||
|
else:
|
||||||
|
tableName = "table"
|
||||||
|
|
||||||
|
if options.quotechar:
|
||||||
|
quotechar = options.quotechar
|
||||||
|
else:
|
||||||
|
quotechar = "\""
|
||||||
|
|
||||||
|
encoding = "utf-8" # default setting
|
||||||
|
###########################################################
|
||||||
|
## try to guess the encoding; this is implemented only with
|
||||||
|
## POSIX platforms. Can it be improved?
|
||||||
|
output = os.popen('/usr/bin/file ' + pathFileCSV).read()
|
||||||
|
m=re.match(r'^.*: ([-a-zA-Z0-9]+) text$', output)
|
||||||
|
if m:
|
||||||
|
encoding=m.group(1)
|
||||||
|
if 'ISO-8859' in encoding:
|
||||||
|
encoding="latin-1"
|
||||||
|
else:
|
||||||
|
encoding="utf-8"
|
||||||
|
############################################################
|
||||||
|
# when the -c or --coding switch is used, it takes precedence
|
||||||
|
if options.encoding:
|
||||||
|
encoding = options.encoding
|
||||||
|
|
||||||
|
csvToOds( pathFileCSV=unicode(pathFileCSV),
|
||||||
|
pathFileODS=unicode(pathFileODS),
|
||||||
|
delimiter=delimiter, skipinitialspace=skipinitialspace,
|
||||||
|
escapechar=escapechar,
|
||||||
|
lineterminator=unicode(lineterminator),
|
||||||
|
tableName=tableName, quotechar=quotechar,
|
||||||
|
encoding=encoding)
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from distro.distro import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from dotenv.__main__ import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from numpy.f2py.f2py2e import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from filetype.__main__ import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from flask.cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from gql.cli import gql_cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(gql_cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- 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())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from httpx import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from huggingface_hub.commands.huggingface_cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import sys
|
||||||
|
from hypothesis.extra.cli import main
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if sys.argv[0].endswith("-script.pyw"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-11]
|
||||||
|
elif sys.argv[0].endswith(".exe"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-4]
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import argparse
|
||||||
|
from pprint import pformat
|
||||||
|
import jmespath
|
||||||
|
from jmespath import exceptions
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("expression")
|
||||||
|
parser.add_argument(
|
||||||
|
"-f",
|
||||||
|
"--filename",
|
||||||
|
help=(
|
||||||
|
"The filename containing the input data. "
|
||||||
|
"If a filename is not given then data is "
|
||||||
|
"read from stdin."
|
||||||
|
),
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--ast",
|
||||||
|
action="store_true",
|
||||||
|
help=("Pretty print the AST, do not search the data."),
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
|
expression = args.expression
|
||||||
|
if args.ast:
|
||||||
|
# Only print the AST
|
||||||
|
expression = jmespath.compile(args.expression)
|
||||||
|
sys.stdout.write(pformat(expression.parsed))
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
return 0
|
||||||
|
if args.filename:
|
||||||
|
with open(args.filename, "r") as f:
|
||||||
|
data = json.load(f)
|
||||||
|
else:
|
||||||
|
data = sys.stdin.read()
|
||||||
|
data = json.loads(data)
|
||||||
|
try:
|
||||||
|
sys.stdout.write(
|
||||||
|
json.dumps(jmespath.search(expression, data), indent=4, ensure_ascii=False)
|
||||||
|
)
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
except exceptions.ArityError as e:
|
||||||
|
sys.stderr.write("invalid-arity: %s\n" % e)
|
||||||
|
return 1
|
||||||
|
except exceptions.JMESPathTypeError as e:
|
||||||
|
sys.stderr.write("invalid-type: %s\n" % e)
|
||||||
|
return 1
|
||||||
|
except exceptions.UnknownFunctionError as e:
|
||||||
|
sys.stderr.write("unknown-function: %s\n" % e)
|
||||||
|
return 1
|
||||||
|
except exceptions.ParseError as e:
|
||||||
|
sys.stderr.write("syntax-error: %s\n" % e)
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from json_repair.__main__ import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from jsonschema.cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from langsmith.cli.main import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from litellm import run_server
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(run_server())
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2006 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
from odf.odf2xhtml import ODF2XHTML
|
||||||
|
import zipfile
|
||||||
|
import sys, os, smtplib, getopt
|
||||||
|
|
||||||
|
from email.mime.multipart import MIMEMultipart
|
||||||
|
from email.mime.nonmultipart import MIMENonMultipart
|
||||||
|
from email.mime.text import MIMEText
|
||||||
|
from email.encoders import encode_base64
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
def usage():
|
||||||
|
sys.stderr.write("Usage: %s [-f from] [-s subject] inputfile recipients...\n" % sys.argv[0])
|
||||||
|
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "f:s:", ["from=", "subject="])
|
||||||
|
except getopt.GetoptError:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
fromaddr = os.getlogin() + "@" + os.getenv('HOSTNAME','localhost')
|
||||||
|
subject = None
|
||||||
|
for o, a in opts:
|
||||||
|
if o in ("-f", "--from"):
|
||||||
|
fromaddr = a
|
||||||
|
if o in ("-s", "--subject"):
|
||||||
|
subject = a
|
||||||
|
|
||||||
|
if len(args) < 2:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
suffices = {
|
||||||
|
'wmf':('image','x-wmf'),
|
||||||
|
'png':('image','png'),
|
||||||
|
'gif':('image','gif'),
|
||||||
|
'jpg':('image','jpeg'),
|
||||||
|
'jpeg':('image','jpeg')
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = MIMEMultipart('related',type="text/html")
|
||||||
|
msg['From'] = fromaddr
|
||||||
|
# msg['Date'] = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
|
||||||
|
msg['To'] = ','.join(args[1:])
|
||||||
|
msg.preamble = 'This is a multi-part message in MIME format.'
|
||||||
|
msg.epilogue = ''
|
||||||
|
odhandler = ODF2XHTML()
|
||||||
|
result = odhandler.odf2xhtml(unicode(args[0]))
|
||||||
|
if subject:
|
||||||
|
msg['Subject'] = subject
|
||||||
|
else:
|
||||||
|
msg['Subject'] = odhandler.title
|
||||||
|
htmlpart = MIMEText(result,'html','us-ascii')
|
||||||
|
htmlpart['Content-Location'] = 'index.html'
|
||||||
|
msg.attach(htmlpart)
|
||||||
|
z = zipfile.ZipFile(unicode(args[0]))
|
||||||
|
for file in z.namelist():
|
||||||
|
if file[0:9] == 'Pictures/':
|
||||||
|
suffix = file[file.rfind(".")+1:]
|
||||||
|
main,sub = suffices.get(suffix,('application','octet-stream'))
|
||||||
|
img = MIMENonMultipart(main,sub)
|
||||||
|
img.set_payload(z.read(file))
|
||||||
|
img['Content-Location'] = "" + file
|
||||||
|
encode_base64(img)
|
||||||
|
msg.attach(img)
|
||||||
|
z.close()
|
||||||
|
|
||||||
|
server = smtplib.SMTP('localhost')
|
||||||
|
#server.set_debuglevel(1)
|
||||||
|
server.sendmail(fromaddr, args[1:], msg.as_string())
|
||||||
|
server.quit()
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from mako.cmd import cmdline
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cmdline())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from markdown_it.cli.parse import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from markdown.__main__ import run
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(run())
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import sys
|
||||||
|
from milvus_lite.cmdline import main
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if sys.argv[0].endswith("-script.pyw"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-11]
|
||||||
|
elif sys.argv[0].endswith(".exe"):
|
||||||
|
sys.argv[0] = sys.argv[0][:-4]
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from nltk.cli import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from charset_normalizer import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli.cli_detect())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: UTF-8 -*-
|
||||||
|
from __future__ import print_function, division, absolute_import
|
||||||
|
|
||||||
|
from numba.misc.numba_entry import main
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2006 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
from __future__ import print_function
|
||||||
|
from odf.odf2xhtml import ODF2XHTML
|
||||||
|
import zipfile
|
||||||
|
import sys
|
||||||
|
#from time import gmtime, strftime
|
||||||
|
|
||||||
|
from email.mime.multipart import MIMEMultipart
|
||||||
|
from email.mime.nonmultipart import MIMENonMultipart
|
||||||
|
from email.mime.text import MIMEText
|
||||||
|
from email import encoders
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
sys.stderr.write("Usage: %s inputfile\n" % sys.argv[0])
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
suffices = {
|
||||||
|
'wmf':('image','x-wmf'),
|
||||||
|
'png':('image','png'),
|
||||||
|
'gif':('image','gif'),
|
||||||
|
'jpg':('image','jpeg'),
|
||||||
|
'jpeg':('image','jpeg')
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = MIMEMultipart('related',type="text/html")
|
||||||
|
# msg['Subject'] = 'Subject here'
|
||||||
|
# msg['From'] = '<Saved by ODT2MHT>'
|
||||||
|
# msg['Date'] = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
|
||||||
|
msg.preamble = 'This is a multi-part message in MIME format.'
|
||||||
|
msg.epilogue = ''
|
||||||
|
odhandler = ODF2XHTML()
|
||||||
|
result = odhandler.odf2xhtml(unicode(sys.argv[1]))
|
||||||
|
htmlpart = MIMEText(result,'html','us-ascii')
|
||||||
|
htmlpart['Content-Location'] = 'index.html'
|
||||||
|
msg.attach(htmlpart)
|
||||||
|
z = zipfile.ZipFile(sys.argv[1])
|
||||||
|
for file in z.namelist():
|
||||||
|
if file[0:9] == 'Pictures/':
|
||||||
|
suffix = file[file.rfind(".")+1:]
|
||||||
|
main,sub = suffices.get(suffix,('application','octet-stream'))
|
||||||
|
img = MIMENonMultipart(main,sub)
|
||||||
|
img.set_payload(z.read(file))
|
||||||
|
img['Content-Location'] = "" + file
|
||||||
|
encoders.encode_base64(img)
|
||||||
|
msg.attach(img)
|
||||||
|
z.close()
|
||||||
|
print (msg.as_string())
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2007 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
from odf.odf2xhtml import ODF2XHTML
|
||||||
|
import sys, getopt
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
|
def usage():
|
||||||
|
sys.stderr.write("Usage: %s [-p] inputfile\n" % sys.argv[0])
|
||||||
|
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "ep", ["plain","embedable"])
|
||||||
|
except getopt.GetoptError:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
generatecss = True
|
||||||
|
embedable = False
|
||||||
|
for o, a in opts:
|
||||||
|
if o in ("-p", "--plain"):
|
||||||
|
generatecss = False
|
||||||
|
if o in ("-e", "--embedable"):
|
||||||
|
embedable = True
|
||||||
|
|
||||||
|
if len(args) != 1:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
odhandler = ODF2XHTML(generatecss, embedable)
|
||||||
|
try:
|
||||||
|
result = odhandler.odf2xhtml(unicode(args[0]))
|
||||||
|
except:
|
||||||
|
sys.stderr.write("Unable to open file %s or file is not OpenDocument\n" % args[0])
|
||||||
|
sys.exit(1)
|
||||||
|
sys.stdout.write(result)
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2008 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# OpenDocument can be a complete office document in a single
|
||||||
|
# XML document. This script will create such a document.
|
||||||
|
import sys, getopt, base64
|
||||||
|
from odf.opendocument import load
|
||||||
|
from odf.draw import Image, ObjectOle
|
||||||
|
from odf.style import BackgroundImage
|
||||||
|
from odf.text import ListLevelStyleImage
|
||||||
|
from odf.office import BinaryData
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
def usage():
|
||||||
|
sys.stderr.write("Usage: %s [-e] [-o outputfile] [inputfile]\n" % sys.argv[0])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
embedimage = False
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "o:e", ["output="])
|
||||||
|
except getopt.GetoptError:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
outputfile = '-'
|
||||||
|
|
||||||
|
for o, a in opts:
|
||||||
|
if o in ("-o", "--output"):
|
||||||
|
outputfile = a
|
||||||
|
if o == '-e':
|
||||||
|
embedimage = True
|
||||||
|
|
||||||
|
if len(args) > 1:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
if len(args) == 0:
|
||||||
|
d = load(sys.stdin)
|
||||||
|
else:
|
||||||
|
d = load(unicode(args[0]))
|
||||||
|
if embedimage:
|
||||||
|
images = d.getElementsByType(Image) + \
|
||||||
|
d.getElementsByType(BackgroundImage) + \
|
||||||
|
d.getElementsByType(ObjectOle) + \
|
||||||
|
d.getElementsByType(ListLevelStyleImage)
|
||||||
|
for image in images:
|
||||||
|
href = image.getAttribute('href')
|
||||||
|
if href and href[:9] == "Pictures/":
|
||||||
|
p = d.Pictures[href]
|
||||||
|
bp = base64.encodestring(p[1])
|
||||||
|
image.addElement(BinaryData(text=bp))
|
||||||
|
image.removeAttribute('href')
|
||||||
|
xml = d.xml()
|
||||||
|
if outputfile == '-':
|
||||||
|
print (xml)
|
||||||
|
else:
|
||||||
|
open(outputfile,"wb").write(xml)
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,190 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2007-2009 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import zipfile, sys, getopt, mimetypes
|
||||||
|
try:
|
||||||
|
from urllib2 import urlopen, quote, unquote
|
||||||
|
except ImportError:
|
||||||
|
from urllib.request import urlopen, quote, unquote
|
||||||
|
try:
|
||||||
|
from urlparse import urlunsplit, urlsplit
|
||||||
|
except ImportError:
|
||||||
|
from urllib.parse import urlunsplit, urlsplit
|
||||||
|
from odf.opendocument import load
|
||||||
|
from odf.draw import Image
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
#sys.tracebacklimit = 0
|
||||||
|
|
||||||
|
# Variable to count the number of retrieval failures
|
||||||
|
failures = 0
|
||||||
|
|
||||||
|
# Set to one if quiet behaviour is wanted
|
||||||
|
quiet = 0
|
||||||
|
|
||||||
|
# If set will write every url to import
|
||||||
|
verbose = 0
|
||||||
|
|
||||||
|
# Dictionary with new pictures. Key is original file path
|
||||||
|
# Item is newfilename
|
||||||
|
newpictures = {}
|
||||||
|
doc = None
|
||||||
|
|
||||||
|
def importpicture(href):
|
||||||
|
""" Add the picture to the ZIP file
|
||||||
|
Returns the new path name to the file in the zip archive
|
||||||
|
If it is unable to import, then it returns the original href
|
||||||
|
Sideeffect: add line to manifest
|
||||||
|
"""
|
||||||
|
global doc, newpictures, failures, verbose
|
||||||
|
|
||||||
|
# Check that it is not already in the manifest
|
||||||
|
if href in doc.Pictures: return href
|
||||||
|
|
||||||
|
image = None
|
||||||
|
if verbose: print ("Importing", href, file=sys.stderr)
|
||||||
|
if href[:7] == "http://" or href[:8] == "https://" or href[:6] == "ftp://":
|
||||||
|
# There is a bug in urlopen: It can't open urls with non-ascii unicode
|
||||||
|
# characters. Convert to UTF-8 and then use percent encoding
|
||||||
|
try:
|
||||||
|
goodhref = href.encode('ascii')
|
||||||
|
except:
|
||||||
|
o = list(urlsplit(href))
|
||||||
|
o[2] = quote(o[2].encode('utf-8'))
|
||||||
|
goodhref = urlunsplit(o)
|
||||||
|
if goodhref in newpictures:
|
||||||
|
if verbose: print ("already imported", file=sys.stderr)
|
||||||
|
return newpictures[goodhref] # Already imported
|
||||||
|
try:
|
||||||
|
f = urlopen(goodhref.decode("utf-8"))
|
||||||
|
image = f.read()
|
||||||
|
headers = f.info()
|
||||||
|
f.close()
|
||||||
|
# Get the mimetype from the headerlines
|
||||||
|
c_t = headers['Content-Type'].split(';')[0].strip()
|
||||||
|
if c_t: mediatype = c_t.split(';')[0].strip()
|
||||||
|
if verbose: print ("OK", file=sys.stderr)
|
||||||
|
except:
|
||||||
|
failures += 1
|
||||||
|
if verbose: print ("failed", file=sys.stderr)
|
||||||
|
return href
|
||||||
|
# Remove query string
|
||||||
|
try: href= href[:href.rindex('?')]
|
||||||
|
except: pass
|
||||||
|
try:
|
||||||
|
lastslash = href[href.rindex('/'):]
|
||||||
|
ext = lastslash[lastslash.rindex('.'):]
|
||||||
|
except: ext = mimetypes.guess_extension(mediatype)
|
||||||
|
# Everything is a simple path.
|
||||||
|
else:
|
||||||
|
goodhref = href
|
||||||
|
if href[:3] == '../':
|
||||||
|
if directory is None:
|
||||||
|
goodhref = unquote(href[3:])
|
||||||
|
else:
|
||||||
|
goodhref = unquote(directory + href[2:])
|
||||||
|
if goodhref in newpictures:
|
||||||
|
if verbose: print ("already imported", file=sys.stderr)
|
||||||
|
return newpictures[goodhref] # Already imported
|
||||||
|
mediatype, encoding = mimetypes.guess_type(goodhref)
|
||||||
|
if mediatype is None:
|
||||||
|
mediatype = ''
|
||||||
|
try: ext = goodhref[goodhref.rindex('.'):]
|
||||||
|
except: ext=''
|
||||||
|
else:
|
||||||
|
ext = mimetypes.guess_extension(mediatype)
|
||||||
|
try:
|
||||||
|
image = file(goodhref).read()
|
||||||
|
if verbose: print ("OK", file=sys.stderr)
|
||||||
|
except:
|
||||||
|
failures += 1
|
||||||
|
if verbose: print ("failed", file=sys.stderr)
|
||||||
|
return href
|
||||||
|
# If we have a picture to import, the image variable contains it
|
||||||
|
# and manifestfn, ext and mediatype has a value
|
||||||
|
if image:
|
||||||
|
manifestfn = doc.addPictureFromString(image, unicode(mediatype))
|
||||||
|
newpictures[goodhref] = manifestfn
|
||||||
|
return manifestfn
|
||||||
|
|
||||||
|
if verbose: print ("not imported", file=sys.stderr)
|
||||||
|
return href
|
||||||
|
|
||||||
|
def exitwithusage(exitcode=2):
|
||||||
|
""" Print out usage information and exit """
|
||||||
|
print ("Usage: %s [-q] [-v] [-o output] [inputfile]" % sys.argv[0], file=sys.stderr)
|
||||||
|
print ("\tInputfile must be OpenDocument format", file=sys.stderr)
|
||||||
|
sys.exit(exitcode)
|
||||||
|
|
||||||
|
outputfile = None
|
||||||
|
writefile = True
|
||||||
|
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "qvo:")
|
||||||
|
except getopt.GetoptError:
|
||||||
|
exitwithusage()
|
||||||
|
|
||||||
|
for o, a in opts:
|
||||||
|
if o == "-o":
|
||||||
|
outputfile = a
|
||||||
|
writefile = True
|
||||||
|
if o == "-q":
|
||||||
|
quiet = 1
|
||||||
|
if o == "-v":
|
||||||
|
verbose = 1
|
||||||
|
|
||||||
|
if len(args) == 0:
|
||||||
|
try:
|
||||||
|
doc = load(sys.stdin)
|
||||||
|
directory = None
|
||||||
|
except:
|
||||||
|
print ("Couldn't open OpenDocument file", file=sys.stderr)
|
||||||
|
exitwithusage()
|
||||||
|
else:
|
||||||
|
fn = unicode(args[0])
|
||||||
|
if not zipfile.is_zipfile(fn):
|
||||||
|
exitwithusage()
|
||||||
|
dirinx = max(fn.rfind('\\'), fn.rfind('/'))
|
||||||
|
if dirinx >= 0: directory = fn[:dirinx]
|
||||||
|
else: directory = "."
|
||||||
|
doc = load(fn)
|
||||||
|
|
||||||
|
for image in doc.getElementsByType(Image):
|
||||||
|
href = image.getAttribute('href')
|
||||||
|
newhref = importpicture(href)
|
||||||
|
image.setAttribute('href',newhref)
|
||||||
|
|
||||||
|
if writefile:
|
||||||
|
if outputfile is None:
|
||||||
|
doc.save(fn)
|
||||||
|
else:
|
||||||
|
doc.save(unicode(outputfile))
|
||||||
|
|
||||||
|
|
||||||
|
if quiet == 0 and failures > 0:
|
||||||
|
print ("Couldn't import %d image(s)" % failures, file=sys.stderr)
|
||||||
|
sys.exit( int(failures > 0) )
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,216 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2009 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
import zipfile
|
||||||
|
from xml.sax import make_parser,handler
|
||||||
|
from xml.sax.xmlreader import InputSource
|
||||||
|
import xml.sax.saxutils
|
||||||
|
import sys
|
||||||
|
from odf.opendocument import OpenDocument
|
||||||
|
from odf import element, grammar
|
||||||
|
from odf.namespaces import *
|
||||||
|
from odf.attrconverters import attrconverters, cnv_string
|
||||||
|
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
extension_attributes = {
|
||||||
|
"OpenOffice.org" : {
|
||||||
|
(METANS,u'template'): (
|
||||||
|
(XLINKNS,u'role'),
|
||||||
|
),
|
||||||
|
(STYLENS,u'graphic-properties'): (
|
||||||
|
(STYLENS,u'background-transparency'),
|
||||||
|
),
|
||||||
|
(STYLENS,u'paragraph-properties'): (
|
||||||
|
(TEXTNS,u'enable-numbering'),
|
||||||
|
(STYLENS,u'join-border'),
|
||||||
|
),
|
||||||
|
(STYLENS,u'table-cell-properties'): (
|
||||||
|
(STYLENS,u'writing-mode'),
|
||||||
|
),
|
||||||
|
(STYLENS,u'table-row-properties'): (
|
||||||
|
(STYLENS,u'keep-together'),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
"KOffice" : {
|
||||||
|
(STYLENS,u'graphic-properties'): (
|
||||||
|
(KOFFICENS,u'frame-behavior-on-new-page'),
|
||||||
|
),
|
||||||
|
(DRAWNS,u'page'): (
|
||||||
|
(KOFFICENS,u'name'),
|
||||||
|
),
|
||||||
|
(PRESENTATIONNS,u'show-shape'): (
|
||||||
|
(KOFFICENS,u'order-id'),
|
||||||
|
),
|
||||||
|
(PRESENTATIONNS,u'hide-shape'): (
|
||||||
|
(KOFFICENS,u'order-id'),
|
||||||
|
),
|
||||||
|
(CHARTNS,u'legend'): (
|
||||||
|
(KOFFICENS,u'title'),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printed_errors = []
|
||||||
|
|
||||||
|
def print_error(str):
|
||||||
|
if str not in printed_errors:
|
||||||
|
printed_errors.append(str)
|
||||||
|
print (str)
|
||||||
|
|
||||||
|
def chop_arg(arg):
|
||||||
|
if len(arg) > 20:
|
||||||
|
return "%s..." % arg[0:20]
|
||||||
|
return arg
|
||||||
|
|
||||||
|
def make_qname(tag):
|
||||||
|
return "%s:%s" % (nsdict.get(tag[0],tag[0]), tag[1])
|
||||||
|
|
||||||
|
def allowed_attributes(tag):
|
||||||
|
return grammar.allowed_attributes.get(tag)
|
||||||
|
|
||||||
|
|
||||||
|
class ODFElementHandler(handler.ContentHandler):
|
||||||
|
""" Extract headings from content.xml of an ODT file """
|
||||||
|
def __init__(self, document):
|
||||||
|
self.doc = document
|
||||||
|
self.tagstack = []
|
||||||
|
self.data = []
|
||||||
|
self.currtag = None
|
||||||
|
|
||||||
|
def characters(self, data):
|
||||||
|
self.data.append(data)
|
||||||
|
|
||||||
|
def startElementNS(self, tag, qname, attrs):
|
||||||
|
""" Pseudo-create an element
|
||||||
|
"""
|
||||||
|
allowed_attrs = grammar.allowed_attributes.get(tag)
|
||||||
|
attrdict = {}
|
||||||
|
for (att,value) in attrs.items():
|
||||||
|
prefix = nsdict.get(att[0],att[0])
|
||||||
|
# Check if it is a known extension
|
||||||
|
notan_extension = True
|
||||||
|
for product, ext_attrs in extension_attributes.items():
|
||||||
|
allowed_ext_attrs = ext_attrs.get(tag)
|
||||||
|
if allowed_ext_attrs and att in allowed_ext_attrs:
|
||||||
|
print_error("Warning: Attribute %s in element <%s> is illegal - %s extension" % ( make_qname(att), make_qname(tag), product))
|
||||||
|
notan_extension = False
|
||||||
|
# Check if it is an allowed attribute
|
||||||
|
if notan_extension and allowed_attrs and att not in allowed_attrs:
|
||||||
|
print_error("Error: Attribute %s:%s is not allowed in element <%s>" % ( prefix, att[1], make_qname(tag)))
|
||||||
|
# Check the value
|
||||||
|
try:
|
||||||
|
convert = attrconverters.get(att, cnv_string)
|
||||||
|
convert(att, value, tag)
|
||||||
|
except ValueError as res:
|
||||||
|
print_error("Error: Bad value '%s' for attribute %s:%s in tag: <%s> - %s" %
|
||||||
|
(chop_arg(value), prefix, att[1], make_qname(tag), res))
|
||||||
|
|
||||||
|
self.tagstack.append(tag)
|
||||||
|
self.data = []
|
||||||
|
# Check that the parent allows this child element
|
||||||
|
if tag not in ( (OFFICENS, 'document'), (OFFICENS, 'document-content'), (OFFICENS, 'document-styles'),
|
||||||
|
(OFFICENS, 'document-meta'), (OFFICENS, 'document-settings'),
|
||||||
|
(MANIFESTNS,'manifest')):
|
||||||
|
try:
|
||||||
|
parent = self.tagstack[-2]
|
||||||
|
allowed_children = grammar.allowed_children.get(parent)
|
||||||
|
except:
|
||||||
|
print_error("Error: This document starts with the wrong tag: <%s>" % make_qname(tag))
|
||||||
|
allowed_children = None
|
||||||
|
if allowed_children and tag not in allowed_children:
|
||||||
|
print_error("Error: Element %s is not allowed in element %s" % ( make_qname(tag), make_qname(parent)))
|
||||||
|
# Test that all mandatory attributes have been added.
|
||||||
|
required = grammar.required_attributes.get(tag)
|
||||||
|
if required:
|
||||||
|
for r in required:
|
||||||
|
if attrs.get(r) is None:
|
||||||
|
print_error("Error: Required attribute missing: %s in <%s>" % (make_qname(r), make_qname(tag)))
|
||||||
|
|
||||||
|
|
||||||
|
def endElementNS(self, tag, qname):
|
||||||
|
self.currtag = self.tagstack.pop()
|
||||||
|
str = ''.join(self.data).strip()
|
||||||
|
# Check that only elements that can take text have text
|
||||||
|
# But only elements we know exist in grammar
|
||||||
|
if tag in grammar.allowed_children:
|
||||||
|
if str != '' and tag not in grammar.allows_text:
|
||||||
|
print_error("Error: %s does not allow text data" % make_qname(tag))
|
||||||
|
self.data = []
|
||||||
|
|
||||||
|
class ODFDTDHandler(handler.DTDHandler):
|
||||||
|
def notationDecl(self, name, public_id, system_id):
|
||||||
|
""" Ignore DTDs """
|
||||||
|
print_error("Warning: ODF doesn't use DOCTYPEs")
|
||||||
|
|
||||||
|
def exitwithusage(exitcode=2):
|
||||||
|
""" print out usage information """
|
||||||
|
sys.stderr.write("Usage: %s inputfile\n" % sys.argv[0])
|
||||||
|
sys.stderr.write("\tInputfile must be OpenDocument format\n")
|
||||||
|
sys.exit(exitcode)
|
||||||
|
|
||||||
|
def lint(odffile):
|
||||||
|
if not zipfile.is_zipfile(odffile):
|
||||||
|
print_error("Error: This is not a zipped file")
|
||||||
|
return
|
||||||
|
zfd = zipfile.ZipFile(odffile)
|
||||||
|
try:
|
||||||
|
mimetype = zfd.read('mimetype')
|
||||||
|
except:
|
||||||
|
mimetype=''
|
||||||
|
d = OpenDocument(unicode(mimetype))
|
||||||
|
first = True
|
||||||
|
for zi in zfd.infolist():
|
||||||
|
if first:
|
||||||
|
if zi.filename == 'mimetype':
|
||||||
|
if zi.compress_type != zipfile.ZIP_STORED:
|
||||||
|
print_error("Error: The 'mimetype' member must be stored - not deflated")
|
||||||
|
if zi.comment != "":
|
||||||
|
print_error("Error: The 'mimetype' member must not have extra header info")
|
||||||
|
else:
|
||||||
|
print_error("Warning: The first member in the archive should be the mimetype")
|
||||||
|
first = False
|
||||||
|
if zi.filename in ('META-INF/manifest.xml', 'content.xml', 'meta.xml', 'styles.xml', 'settings.xml'):
|
||||||
|
content = zfd.read(zi.filename)
|
||||||
|
parser = make_parser()
|
||||||
|
parser.setFeature(handler.feature_namespaces, True)
|
||||||
|
parser.setFeature(handler.feature_external_ges, False)
|
||||||
|
parser.setContentHandler(ODFElementHandler(d))
|
||||||
|
dtdh = ODFDTDHandler()
|
||||||
|
parser.setDTDHandler(dtdh)
|
||||||
|
parser.setErrorHandler(handler.ErrorHandler())
|
||||||
|
|
||||||
|
inpsrc = InputSource()
|
||||||
|
if not isinstance(content, str):
|
||||||
|
content=content
|
||||||
|
inpsrc.setByteStream(BytesIO(content))
|
||||||
|
parser.parse(inpsrc)
|
||||||
|
|
||||||
|
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
exitwithusage()
|
||||||
|
lint(unicode(sys.argv[1]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,266 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2006-2009 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
import zipfile, time, sys, getopt, re
|
||||||
|
import xml.sax, xml.sax.saxutils
|
||||||
|
from odf.namespaces import TOOLSVERSION, OFFICENS, XLINKNS, DCNS, METANS
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
|
OUTENCODING="utf-8"
|
||||||
|
|
||||||
|
whitespace = re.compile(r'\s+')
|
||||||
|
|
||||||
|
fields = {
|
||||||
|
'title': (DCNS,u'title'),
|
||||||
|
'description': (DCNS,u'description'),
|
||||||
|
'subject': (DCNS,u'subject'),
|
||||||
|
'creator': (DCNS,u'creator'),
|
||||||
|
'date': (DCNS,u'date'),
|
||||||
|
'language': (DCNS,u'language'),
|
||||||
|
'generator': (METANS,u'generator'),
|
||||||
|
'initial-creator': (METANS,u'initial-creator'),
|
||||||
|
'keyword': (METANS,u'keyword'),
|
||||||
|
'editing-duration': (METANS,u'editing-duration'),
|
||||||
|
'editing-cycles': (METANS,u'editing-cycles'),
|
||||||
|
'printed-by': (METANS,u'printed-by'),
|
||||||
|
'print-date': (METANS,u'print-date'),
|
||||||
|
'creation-date': (METANS,u'creation-date'),
|
||||||
|
'user-defined': (METANS,u'user-defined'),
|
||||||
|
#'template': (METANS,u'template'),
|
||||||
|
}
|
||||||
|
|
||||||
|
xfields = []
|
||||||
|
Xfields = []
|
||||||
|
addfields = {}
|
||||||
|
deletefields = {}
|
||||||
|
yieldfields = {}
|
||||||
|
showversion = None
|
||||||
|
|
||||||
|
def exitwithusage(exitcode=2):
|
||||||
|
""" print out usage information """
|
||||||
|
sys.stderr.write("Usage: %s [-cdlvV] [-xXaAI metafield]... [-o output] [inputfile]\n" % sys.argv[0])
|
||||||
|
sys.stderr.write("\tInputfile must be OpenDocument format\n")
|
||||||
|
sys.exit(exitcode)
|
||||||
|
|
||||||
|
def normalize(str):
|
||||||
|
"""
|
||||||
|
The normalize-space function returns the argument string with whitespace
|
||||||
|
normalized by stripping leading and trailing whitespace and replacing
|
||||||
|
sequences of whitespace characters by a single space.
|
||||||
|
"""
|
||||||
|
return whitespace.sub(' ', str).strip()
|
||||||
|
|
||||||
|
class MetaCollector:
|
||||||
|
"""
|
||||||
|
The MetaCollector is a pseudo file object, that can temporarily ignore write-calls
|
||||||
|
It could probably be replaced with a StringIO object.
|
||||||
|
"""
|
||||||
|
def __init__(self):
|
||||||
|
self._content = []
|
||||||
|
self.dowrite = True
|
||||||
|
|
||||||
|
def write(self, str):
|
||||||
|
if self.dowrite:
|
||||||
|
self._content.append(str)
|
||||||
|
|
||||||
|
def content(self):
|
||||||
|
return ''.join(self._content)
|
||||||
|
|
||||||
|
|
||||||
|
base = xml.sax.saxutils.XMLGenerator
|
||||||
|
|
||||||
|
class odfmetaparser(base):
|
||||||
|
""" Parse a meta.xml file with an event-driven parser and replace elements.
|
||||||
|
It would probably be a cleaner approach to use a DOM based parser and
|
||||||
|
then manipulate in memory.
|
||||||
|
Small issue: Reorders elements
|
||||||
|
"""
|
||||||
|
version = 'Unknown'
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self._mimetype = ''
|
||||||
|
self.output = MetaCollector()
|
||||||
|
self._data = []
|
||||||
|
self.seenfields = {}
|
||||||
|
base.__init__(self, self.output, OUTENCODING)
|
||||||
|
|
||||||
|
def startElementNS(self, name, qname, attrs):
|
||||||
|
self._data = []
|
||||||
|
field = name
|
||||||
|
# I can't modify the template until the tool replaces elements at the same
|
||||||
|
# location and not at the end
|
||||||
|
# if name == (METANS,u'template'):
|
||||||
|
# self._data = [attrs.get((XLINKNS,u'title'),'')]
|
||||||
|
if showversion and name == (OFFICENS,u'document-meta'):
|
||||||
|
if showversion == '-V':
|
||||||
|
print ("version:%s" % attrs.get((OFFICENS,u'version'),'Unknown').decode('utf-8'))
|
||||||
|
else:
|
||||||
|
print ("%s" % attrs.get((OFFICENS,u'version'),'Unknown').decode('utf-8'))
|
||||||
|
if name == (METANS,u'user-defined'):
|
||||||
|
field = attrs.get((METANS,u'name'))
|
||||||
|
if field in deletefields:
|
||||||
|
self.output.dowrite = False
|
||||||
|
elif field in yieldfields:
|
||||||
|
del addfields[field]
|
||||||
|
base.startElementNS(self, name, qname, attrs)
|
||||||
|
else:
|
||||||
|
base.startElementNS(self, name, qname, attrs)
|
||||||
|
self._tag = field
|
||||||
|
|
||||||
|
def endElementNS(self, name, qname):
|
||||||
|
field = name
|
||||||
|
if name == (METANS,u'user-defined'):
|
||||||
|
field = self._tag
|
||||||
|
if name == (OFFICENS,u'meta'):
|
||||||
|
for k,v in addfields.items():
|
||||||
|
if len(v) > 0:
|
||||||
|
if type(k) == type(''):
|
||||||
|
base.startElementNS(self,(METANS,u'user-defined'),None,{(METANS,u'name'):k})
|
||||||
|
base.characters(self, v)
|
||||||
|
base.endElementNS(self, (METANS,u'user-defined'),None)
|
||||||
|
else:
|
||||||
|
base.startElementNS(self, k, None, {})
|
||||||
|
base.characters(self, v)
|
||||||
|
base.endElementNS(self, k, None)
|
||||||
|
if name in xfields:
|
||||||
|
print ("%s" % self.data())
|
||||||
|
if name in Xfields:
|
||||||
|
if isinstance(self._tag, tuple):
|
||||||
|
texttag = self._tag[1]
|
||||||
|
else:
|
||||||
|
texttag = self._tag
|
||||||
|
print ("%s:%s" % (texttag, self.data()))
|
||||||
|
if field in deletefields:
|
||||||
|
self.output.dowrite = True
|
||||||
|
else:
|
||||||
|
base.endElementNS(self, name, qname)
|
||||||
|
|
||||||
|
def characters(self, content):
|
||||||
|
base.characters(self, content)
|
||||||
|
self._data.append(content)
|
||||||
|
|
||||||
|
def meta(self):
|
||||||
|
return self.output.content()
|
||||||
|
|
||||||
|
def data(self):
|
||||||
|
if usenormalize:
|
||||||
|
return normalize(''.join(self._data))
|
||||||
|
else:
|
||||||
|
return ''.join(self._data)
|
||||||
|
|
||||||
|
now = time.localtime()[:6]
|
||||||
|
outputfile = "-"
|
||||||
|
writemeta = False # Do we change any meta data?
|
||||||
|
usenormalize = False
|
||||||
|
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "cdlvVI:A:a:o:x:X:")
|
||||||
|
except getopt.GetoptError:
|
||||||
|
exitwithusage()
|
||||||
|
|
||||||
|
if len(opts) == 0:
|
||||||
|
opts = [ ('-l','') ]
|
||||||
|
|
||||||
|
for o, a in opts:
|
||||||
|
if o in ('-a','-A','-I'):
|
||||||
|
writemeta = True
|
||||||
|
if a.find(":") >= 0:
|
||||||
|
k,v = a.split(":",1)
|
||||||
|
else:
|
||||||
|
k,v = (a, "")
|
||||||
|
if len(k) == 0:
|
||||||
|
exitwithusage()
|
||||||
|
k = fields.get(k,k)
|
||||||
|
addfields[k] = unicode(v,'utf-8')
|
||||||
|
if o == '-a':
|
||||||
|
yieldfields[k] = True
|
||||||
|
if o == '-I':
|
||||||
|
deletefields[k] = True
|
||||||
|
if o == '-d':
|
||||||
|
writemeta = True
|
||||||
|
addfields[(DCNS,u'date')] = "%04d-%02d-%02dT%02d:%02d:%02d" % now
|
||||||
|
deletefields[(DCNS,u'date')] = True
|
||||||
|
if o == '-c':
|
||||||
|
usenormalize = True
|
||||||
|
if o in ('-v', '-V'):
|
||||||
|
showversion = o
|
||||||
|
if o == '-l':
|
||||||
|
Xfields = fields.values()
|
||||||
|
if o == "-x":
|
||||||
|
xfields.append(fields.get(a,a))
|
||||||
|
if o == "-X":
|
||||||
|
Xfields.append(fields.get(a,a))
|
||||||
|
if o == "-o":
|
||||||
|
outputfile = a
|
||||||
|
|
||||||
|
# The specification says we should change the element to our own,
|
||||||
|
# and must not export the original identifier.
|
||||||
|
if writemeta:
|
||||||
|
addfields[(METANS,u'generator')] = TOOLSVERSION
|
||||||
|
deletefields[(METANS,u'generator')] = True
|
||||||
|
|
||||||
|
odfs = odfmetaparser()
|
||||||
|
parser = xml.sax.make_parser()
|
||||||
|
parser.setFeature(xml.sax.handler.feature_namespaces, 1)
|
||||||
|
parser.setContentHandler(odfs)
|
||||||
|
|
||||||
|
if len(args) == 0:
|
||||||
|
zin = zipfile.ZipFile(sys.stdin,'r')
|
||||||
|
else:
|
||||||
|
if not zipfile.is_zipfile(args[0]):
|
||||||
|
exitwithusage()
|
||||||
|
zin = zipfile.ZipFile(args[0], 'r')
|
||||||
|
|
||||||
|
try:
|
||||||
|
content = zin.read('meta.xml').decode('utf-8')
|
||||||
|
except:
|
||||||
|
sys.stderr.write("File has no meta data\n")
|
||||||
|
sys.exit(1)
|
||||||
|
parser.parse(BytesIO(content.encode('utf-8')))
|
||||||
|
|
||||||
|
if writemeta:
|
||||||
|
if outputfile == '-':
|
||||||
|
if sys.stdout.isatty():
|
||||||
|
sys.stderr.write("Won't write ODF file to terminal\n")
|
||||||
|
sys.exit(1)
|
||||||
|
zout = zipfile.ZipFile(sys.stdout,"w")
|
||||||
|
else:
|
||||||
|
zout = zipfile.ZipFile(outputfile,"w")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Loop through the input zipfile and copy the content to the output until we
|
||||||
|
# get to the meta.xml. Then substitute.
|
||||||
|
for zinfo in zin.infolist():
|
||||||
|
if zinfo.filename == "meta.xml":
|
||||||
|
# Write meta
|
||||||
|
zi = zipfile.ZipInfo("meta.xml", now)
|
||||||
|
zi.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
zout.writestr(zi,odfs.meta() )
|
||||||
|
else:
|
||||||
|
payload = zin.read(zinfo.filename)
|
||||||
|
zout.writestr(zinfo, payload)
|
||||||
|
|
||||||
|
zout.close()
|
||||||
|
zin.close()
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,144 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2006 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
from __future__ import print_function
|
||||||
|
import zipfile
|
||||||
|
from xml.sax import make_parser,handler
|
||||||
|
from xml.sax.xmlreader import InputSource
|
||||||
|
import xml.sax.saxutils
|
||||||
|
import sys
|
||||||
|
from odf.namespaces import TEXTNS, TABLENS, DRAWNS
|
||||||
|
|
||||||
|
try:
|
||||||
|
from cStringIO import StringIO
|
||||||
|
except ImportError:
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
|
|
||||||
|
def getxmlpart(odffile, xmlfile):
|
||||||
|
""" Get the content out of the ODT file"""
|
||||||
|
z = zipfile.ZipFile(odffile)
|
||||||
|
content = z.read(xmlfile)
|
||||||
|
z.close()
|
||||||
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Extract headings from content.xml
|
||||||
|
#
|
||||||
|
class ODTHeadingHandler(handler.ContentHandler):
|
||||||
|
""" Extract headings from content.xml of an ODT file """
|
||||||
|
def __init__(self, eater):
|
||||||
|
self.r = eater
|
||||||
|
self.data = []
|
||||||
|
self.level = 0
|
||||||
|
|
||||||
|
def characters(self, data):
|
||||||
|
self.data.append(data)
|
||||||
|
|
||||||
|
def startElementNS(self, tag, qname, attrs):
|
||||||
|
if tag == (TEXTNS, 'h'):
|
||||||
|
self.level = 0
|
||||||
|
for (att,value) in attrs.items():
|
||||||
|
if att == (TEXTNS, 'outline-level'):
|
||||||
|
self.level = int(value)
|
||||||
|
self.data = []
|
||||||
|
|
||||||
|
def endElementNS(self, tag, qname):
|
||||||
|
if tag == (TEXTNS, 'h'):
|
||||||
|
str = ''.join(self.data)
|
||||||
|
self.data = []
|
||||||
|
self.r.append("%d%*s%s" % (self.level, self.level, '', str))
|
||||||
|
|
||||||
|
class ODTSheetHandler(handler.ContentHandler):
|
||||||
|
""" Extract sheet names from content.xml of an ODS file """
|
||||||
|
def __init__(self, eater):
|
||||||
|
self.r = eater
|
||||||
|
|
||||||
|
def startElementNS(self, tag, qname, attrs):
|
||||||
|
if tag == (TABLENS, 'table'):
|
||||||
|
sheetname = attrs.get((TABLENS, 'name'))
|
||||||
|
if sheetname:
|
||||||
|
self.r.append(sheetname)
|
||||||
|
|
||||||
|
class ODTSlideHandler(handler.ContentHandler):
|
||||||
|
""" Extract headings from content.xml of an ODT file """
|
||||||
|
def __init__(self, eater):
|
||||||
|
self.r = eater
|
||||||
|
self.data = []
|
||||||
|
self.pagenum = 0
|
||||||
|
|
||||||
|
def characters(self, data):
|
||||||
|
self.data.append(data)
|
||||||
|
|
||||||
|
def startElementNS(self, tag, qname, attrs):
|
||||||
|
if tag == (DRAWNS, 'page'):
|
||||||
|
self.pagenum = self.pagenum + 1
|
||||||
|
self.r.append("SLIDE %d: %s" % ( self.pagenum, attrs.get((DRAWNS, 'name'),'')))
|
||||||
|
if tag == (TEXTNS, 'p'):
|
||||||
|
self.data = []
|
||||||
|
|
||||||
|
def endElementNS(self, tag, qname):
|
||||||
|
if tag == (TEXTNS, 'p'):
|
||||||
|
str = ''.join(self.data)
|
||||||
|
self.data = []
|
||||||
|
if len(str) > 0:
|
||||||
|
self.r.append(" " + str)
|
||||||
|
|
||||||
|
def odtheadings(odtfile):
|
||||||
|
mimetype = getxmlpart(odtfile,'mimetype')
|
||||||
|
content = getxmlpart(odtfile,'content.xml')
|
||||||
|
lines = []
|
||||||
|
parser = make_parser()
|
||||||
|
parser.setFeature(handler.feature_namespaces, 1)
|
||||||
|
if not isinstance(mimetype, str):
|
||||||
|
mimetype=mimetype.decode("utf-8")
|
||||||
|
if mimetype in ('application/vnd.oasis.opendocument.text',
|
||||||
|
'application/vnd.oasis.opendocument.text-template'):
|
||||||
|
parser.setContentHandler(ODTHeadingHandler(lines))
|
||||||
|
elif mimetype in ('application/vnd.oasis.opendocument.spreadsheet',
|
||||||
|
'application/vnd.oasis.opendocument.spreadsheet-template'):
|
||||||
|
parser.setContentHandler(ODTSheetHandler(lines))
|
||||||
|
elif mimetype in ('application/vnd.oasis.opendocument.presentation'
|
||||||
|
'application/vnd.oasis.opendocument.presentation-template'):
|
||||||
|
parser.setContentHandler(ODTSlideHandler(lines))
|
||||||
|
else:
|
||||||
|
print ("Unsupported fileformat")
|
||||||
|
sys.exit(2)
|
||||||
|
parser.setErrorHandler(handler.ErrorHandler())
|
||||||
|
|
||||||
|
inpsrc = InputSource()
|
||||||
|
if not isinstance(content, str):
|
||||||
|
content=content.decode("utf-8")
|
||||||
|
inpsrc.setByteStream(StringIO(content))
|
||||||
|
parser.parse(inpsrc)
|
||||||
|
return lines
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
filler = " "
|
||||||
|
for heading in odtheadings(sys.argv[1]):
|
||||||
|
print (heading)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s): Michael Howitz, gocept gmbh & co. kg
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import getopt
|
||||||
|
|
||||||
|
import odf.userfield
|
||||||
|
|
||||||
|
if sys.version_info[0]==3: unicode=str
|
||||||
|
|
||||||
|
listfields = False
|
||||||
|
Listfields = False
|
||||||
|
xfields = []
|
||||||
|
Xfields = []
|
||||||
|
setfields = {}
|
||||||
|
outputfile = None
|
||||||
|
inputfile = None
|
||||||
|
|
||||||
|
|
||||||
|
def exitwithusage(exitcode=2):
|
||||||
|
""" print out usage information """
|
||||||
|
sys.stderr.write("Usage: %s [-lL] [-xX metafield] [-s metafield:value]... "
|
||||||
|
"[-o output] [inputfile]\n" % sys.argv[0])
|
||||||
|
sys.stderr.write("\tInputfile must be OpenDocument format\n")
|
||||||
|
sys.exit(exitcode)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "lLs:o:x:X:")
|
||||||
|
except getopt.GetoptError:
|
||||||
|
exitwithusage()
|
||||||
|
|
||||||
|
if len(opts) == 0:
|
||||||
|
exitwithusage()
|
||||||
|
|
||||||
|
for o, a in opts:
|
||||||
|
if o == '-s':
|
||||||
|
if a.find(":") >= 0:
|
||||||
|
k,v = a.split(":",1)
|
||||||
|
else:
|
||||||
|
k,v = (a, "")
|
||||||
|
if len(k) == 0:
|
||||||
|
exitwithusage()
|
||||||
|
setfields[unicode(k)] = unicode(v)
|
||||||
|
if o == '-l':
|
||||||
|
listfields = True
|
||||||
|
Listfields = False
|
||||||
|
if o == '-L':
|
||||||
|
Listfields = True
|
||||||
|
listfields = False
|
||||||
|
if o == "-x":
|
||||||
|
xfields.append(unicode(a))
|
||||||
|
if o == "-X":
|
||||||
|
Xfields.append(unicode(a))
|
||||||
|
if o == "-o":
|
||||||
|
outputfile = unicode(a)
|
||||||
|
|
||||||
|
if len(args) != 0:
|
||||||
|
inputfile = unicode(args[0])
|
||||||
|
|
||||||
|
user_fields = odf.userfield.UserFields(inputfile, outputfile)
|
||||||
|
|
||||||
|
if xfields:
|
||||||
|
for value in user_fields.list_values(xfields):
|
||||||
|
print (value)
|
||||||
|
|
||||||
|
if Listfields or Xfields:
|
||||||
|
if Listfields:
|
||||||
|
Xfields = None
|
||||||
|
for field_name, value_type, value in user_fields.list_fields_and_values(
|
||||||
|
Xfields):
|
||||||
|
print ("%s#%s:%s" % (field_name, value_type, value))
|
||||||
|
|
||||||
|
if listfields:
|
||||||
|
for value in user_fields.list_fields():
|
||||||
|
print (value)
|
||||||
|
|
||||||
|
if setfields:
|
||||||
|
user_fields.update(setfields)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from openai.cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from opentelemetry.instrumentation.bootstrap import run
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(run())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from opentelemetry.instrumentation.auto_instrumentation import run
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(run())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from opik.cli import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from oxmsg.cli import oxmsg
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(oxmsg())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from pip._internal.cli.main import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from pip._internal.cli.main import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from pip._internal.cli.main import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from pytest import console_main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(console_main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- 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())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from pypdfium2.__main__ import cli_main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli_main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from rsa.cli import decrypt
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(decrypt())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from rsa.cli import encrypt
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(encrypt())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from rsa.cli import keygen
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(keygen())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from rsa.util import private_to_public
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(private_to_public())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from rsa.cli import sign
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(sign())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from rsa.cli import verify
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(verify())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from pytest import console_main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(console_main())
|
||||||
@ -0,0 +1 @@
|
|||||||
|
python3.12
|
||||||
@ -0,0 +1 @@
|
|||||||
|
python3.12
|
||||||
@ -0,0 +1 @@
|
|||||||
|
/usr/bin/python3.12
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from readabilipy.__main__ import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from scripts.release import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
Binary file not shown.
@ -0,0 +1,470 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd
|
||||||
|
# This script is part of the xlrd package, which is released under a
|
||||||
|
# BSD-style licence.
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
cmd_doc = """
|
||||||
|
Commands:
|
||||||
|
2rows Print the contents of first and last row in each sheet
|
||||||
|
3rows Print the contents of first, second and last row in each sheet
|
||||||
|
bench Same as "show", but doesn't print -- for profiling
|
||||||
|
biff_count[1] Print a count of each type of BIFF record in the file
|
||||||
|
biff_dump[1] Print a dump (char and hex) of the BIFF records in the file
|
||||||
|
fonts hdr + print a dump of all font objects
|
||||||
|
hdr Mini-overview of file (no per-sheet information)
|
||||||
|
hotshot Do a hotshot profile run e.g. ... -f1 hotshot bench bigfile*.xls
|
||||||
|
labels Dump of sheet.col_label_ranges and ...row... for each sheet
|
||||||
|
name_dump Dump of each object in book.name_obj_list
|
||||||
|
names Print brief information for each NAME record
|
||||||
|
ov Overview of file
|
||||||
|
profile Like "hotshot", but uses cProfile
|
||||||
|
show Print the contents of all rows in each sheet
|
||||||
|
version[0] Print versions of xlrd and Python and exit
|
||||||
|
xfc Print "XF counts" and cell-type counts -- see code for details
|
||||||
|
[0] means no file arg
|
||||||
|
[1] means only one file arg i.e. no glob.glob pattern
|
||||||
|
"""
|
||||||
|
options = None
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import xlrd
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import glob
|
||||||
|
import traceback
|
||||||
|
import gc
|
||||||
|
from xlrd.timemachine import xrange, REPR
|
||||||
|
|
||||||
|
class LogHandler(object):
|
||||||
|
def __init__(self, logfileobj):
|
||||||
|
self.logfileobj = logfileobj
|
||||||
|
self.fileheading = None
|
||||||
|
self.shown = 0
|
||||||
|
|
||||||
|
def setfileheading(self, fileheading):
|
||||||
|
self.fileheading = fileheading
|
||||||
|
self.shown = 0
|
||||||
|
|
||||||
|
def write(self, text):
|
||||||
|
if self.fileheading and not self.shown:
|
||||||
|
self.logfileobj.write(self.fileheading)
|
||||||
|
self.shown = 1
|
||||||
|
self.logfileobj.write(text)
|
||||||
|
|
||||||
|
null_cell = xlrd.empty_cell
|
||||||
|
|
||||||
|
def show_row(bk, sh, rowx, colrange, printit):
|
||||||
|
if bk.ragged_rows:
|
||||||
|
colrange = range(sh.row_len(rowx))
|
||||||
|
if not colrange:
|
||||||
|
return
|
||||||
|
if printit:
|
||||||
|
print()
|
||||||
|
if bk.formatting_info:
|
||||||
|
for colx, ty, val, cxfx in get_row_data(bk, sh, rowx, colrange):
|
||||||
|
if printit:
|
||||||
|
print(
|
||||||
|
"cell %s%d: type=%d, data: %r, xfx: %s"
|
||||||
|
% (xlrd.colname(colx), rowx + 1, ty, val, cxfx)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
for colx, ty, val, _unused in get_row_data(bk, sh, rowx, colrange):
|
||||||
|
if printit:
|
||||||
|
print(
|
||||||
|
"cell %s%d: type=%d, data: %r"
|
||||||
|
% (xlrd.colname(colx), rowx + 1, ty, val)
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_row_data(bk, sh, rowx, colrange):
|
||||||
|
result = []
|
||||||
|
dmode = bk.datemode
|
||||||
|
ctys = sh.row_types(rowx)
|
||||||
|
cvals = sh.row_values(rowx)
|
||||||
|
for colx in colrange:
|
||||||
|
cty = ctys[colx]
|
||||||
|
cval = cvals[colx]
|
||||||
|
if bk.formatting_info:
|
||||||
|
cxfx = str(sh.cell_xf_index(rowx, colx))
|
||||||
|
else:
|
||||||
|
cxfx = ""
|
||||||
|
if cty == xlrd.XL_CELL_DATE:
|
||||||
|
try:
|
||||||
|
showval = xlrd.xldate_as_tuple(cval, dmode)
|
||||||
|
except xlrd.XLDateError as e:
|
||||||
|
showval = "%s:%s" % (type(e).__name__, e)
|
||||||
|
cty = xlrd.XL_CELL_ERROR
|
||||||
|
elif cty == xlrd.XL_CELL_ERROR:
|
||||||
|
showval = xlrd.error_text_from_code.get(
|
||||||
|
cval, "<Unknown error code 0x%02x>" % cval
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
showval = cval
|
||||||
|
result.append((colx, cty, showval, cxfx))
|
||||||
|
return result
|
||||||
|
|
||||||
|
def bk_header(bk):
|
||||||
|
print()
|
||||||
|
print(
|
||||||
|
"BIFF version: %s; datemode: %s"
|
||||||
|
% (xlrd.biff_text_from_num[bk.biff_version], bk.datemode)
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
"codepage: %r (encoding: %s); countries: %r"
|
||||||
|
% (bk.codepage, bk.encoding, bk.countries)
|
||||||
|
)
|
||||||
|
print("Last saved by: %r" % bk.user_name)
|
||||||
|
print("Number of data sheets: %d" % bk.nsheets)
|
||||||
|
print(
|
||||||
|
"Use mmap: %d; Formatting: %d; On demand: %d"
|
||||||
|
% (bk.use_mmap, bk.formatting_info, bk.on_demand)
|
||||||
|
)
|
||||||
|
print("Ragged rows: %d" % bk.ragged_rows)
|
||||||
|
if bk.formatting_info:
|
||||||
|
print(
|
||||||
|
"FORMATs: %d, FONTs: %d, XFs: %d"
|
||||||
|
% (len(bk.format_list), len(bk.font_list), len(bk.xf_list))
|
||||||
|
)
|
||||||
|
if not options.suppress_timing:
|
||||||
|
print(
|
||||||
|
"Load time: %.2f seconds (stage 1) %.2f seconds (stage 2)"
|
||||||
|
% (bk.load_time_stage_1, bk.load_time_stage_2)
|
||||||
|
)
|
||||||
|
print()
|
||||||
|
|
||||||
|
def show_fonts(bk):
|
||||||
|
print("Fonts:")
|
||||||
|
for x in xrange(len(bk.font_list)):
|
||||||
|
font = bk.font_list[x]
|
||||||
|
font.dump(header="== Index %d ==" % x, indent=4)
|
||||||
|
|
||||||
|
def show_names(bk, dump=0):
|
||||||
|
bk_header(bk)
|
||||||
|
if bk.biff_version < 50:
|
||||||
|
print("Names not extracted in this BIFF version")
|
||||||
|
return
|
||||||
|
nlist = bk.name_obj_list
|
||||||
|
print("Name list: %d entries" % len(nlist))
|
||||||
|
for nobj in nlist:
|
||||||
|
if dump:
|
||||||
|
nobj.dump(
|
||||||
|
sys.stdout,
|
||||||
|
header="\n=== Dump of name_obj_list[%d] ===" % nobj.name_index,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
"[%d]\tName:%r macro:%r scope:%d\n\tresult:%r\n"
|
||||||
|
% (nobj.name_index, nobj.name, nobj.macro, nobj.scope, nobj.result)
|
||||||
|
)
|
||||||
|
|
||||||
|
def print_labels(sh, labs, title):
|
||||||
|
if not labs:
|
||||||
|
return
|
||||||
|
for rlo, rhi, clo, chi in labs:
|
||||||
|
print(
|
||||||
|
"%s label range %s:%s contains:"
|
||||||
|
% (title, xlrd.cellname(rlo, clo), xlrd.cellname(rhi - 1, chi - 1))
|
||||||
|
)
|
||||||
|
for rx in xrange(rlo, rhi):
|
||||||
|
for cx in xrange(clo, chi):
|
||||||
|
print(" %s: %r" % (xlrd.cellname(rx, cx), sh.cell_value(rx, cx)))
|
||||||
|
|
||||||
|
def show_labels(bk):
|
||||||
|
# bk_header(bk)
|
||||||
|
hdr = 0
|
||||||
|
for shx in range(bk.nsheets):
|
||||||
|
sh = bk.sheet_by_index(shx)
|
||||||
|
clabs = sh.col_label_ranges
|
||||||
|
rlabs = sh.row_label_ranges
|
||||||
|
if clabs or rlabs:
|
||||||
|
if not hdr:
|
||||||
|
bk_header(bk)
|
||||||
|
hdr = 1
|
||||||
|
print(
|
||||||
|
"sheet %d: name = %r; nrows = %d; ncols = %d"
|
||||||
|
% (shx, sh.name, sh.nrows, sh.ncols)
|
||||||
|
)
|
||||||
|
print_labels(sh, clabs, "Col")
|
||||||
|
print_labels(sh, rlabs, "Row")
|
||||||
|
if bk.on_demand:
|
||||||
|
bk.unload_sheet(shx)
|
||||||
|
|
||||||
|
def show(bk, nshow=65535, printit=1):
|
||||||
|
bk_header(bk)
|
||||||
|
if 0:
|
||||||
|
rclist = xlrd.sheet.rc_stats.items()
|
||||||
|
rclist = sorted(rclist)
|
||||||
|
print("rc stats")
|
||||||
|
for k, v in rclist:
|
||||||
|
print("0x%04x %7d" % (k, v))
|
||||||
|
if options.onesheet:
|
||||||
|
try:
|
||||||
|
shx = int(options.onesheet)
|
||||||
|
except ValueError:
|
||||||
|
shx = bk.sheet_by_name(options.onesheet).number
|
||||||
|
shxrange = [shx]
|
||||||
|
else:
|
||||||
|
shxrange = range(bk.nsheets)
|
||||||
|
# print("shxrange", list(shxrange))
|
||||||
|
for shx in shxrange:
|
||||||
|
sh = bk.sheet_by_index(shx)
|
||||||
|
nrows, ncols = sh.nrows, sh.ncols
|
||||||
|
colrange = range(ncols)
|
||||||
|
anshow = min(nshow, nrows)
|
||||||
|
print(
|
||||||
|
"sheet %d: name = %s; nrows = %d; ncols = %d"
|
||||||
|
% (shx, REPR(sh.name), sh.nrows, sh.ncols)
|
||||||
|
)
|
||||||
|
if nrows and ncols:
|
||||||
|
# Beat the bounds
|
||||||
|
for rowx in xrange(nrows):
|
||||||
|
nc = sh.row_len(rowx)
|
||||||
|
if nc:
|
||||||
|
sh.row_types(rowx)[nc - 1]
|
||||||
|
sh.row_values(rowx)[nc - 1]
|
||||||
|
sh.cell(rowx, nc - 1)
|
||||||
|
for rowx in xrange(anshow - 1):
|
||||||
|
if not printit and rowx % 10000 == 1 and rowx > 1:
|
||||||
|
print("done %d rows" % (rowx - 1,))
|
||||||
|
show_row(bk, sh, rowx, colrange, printit)
|
||||||
|
if anshow and nrows:
|
||||||
|
show_row(bk, sh, nrows - 1, colrange, printit)
|
||||||
|
print()
|
||||||
|
if bk.on_demand:
|
||||||
|
bk.unload_sheet(shx)
|
||||||
|
|
||||||
|
def count_xfs(bk):
|
||||||
|
bk_header(bk)
|
||||||
|
for shx in range(bk.nsheets):
|
||||||
|
sh = bk.sheet_by_index(shx)
|
||||||
|
nrows = sh.nrows
|
||||||
|
print(
|
||||||
|
"sheet %d: name = %r; nrows = %d; ncols = %d"
|
||||||
|
% (shx, sh.name, sh.nrows, sh.ncols)
|
||||||
|
)
|
||||||
|
# Access all xfindexes to force gathering stats
|
||||||
|
type_stats = [0, 0, 0, 0, 0, 0, 0]
|
||||||
|
for rowx in xrange(nrows):
|
||||||
|
for colx in xrange(sh.row_len(rowx)):
|
||||||
|
xfx = sh.cell_xf_index(rowx, colx)
|
||||||
|
assert xfx >= 0
|
||||||
|
cty = sh.cell_type(rowx, colx)
|
||||||
|
type_stats[cty] += 1
|
||||||
|
print("XF stats", sh._xf_index_stats)
|
||||||
|
print("type stats", type_stats)
|
||||||
|
print()
|
||||||
|
if bk.on_demand:
|
||||||
|
bk.unload_sheet(shx)
|
||||||
|
|
||||||
|
def main(cmd_args):
|
||||||
|
import optparse
|
||||||
|
|
||||||
|
global options
|
||||||
|
usage = "\n%prog [options] command [input-file-patterns]\n" + cmd_doc
|
||||||
|
oparser = optparse.OptionParser(usage)
|
||||||
|
oparser.add_option(
|
||||||
|
"-l", "--logfilename", default="", help="contains error messages"
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-v",
|
||||||
|
"--verbosity",
|
||||||
|
type="int",
|
||||||
|
default=0,
|
||||||
|
help="level of information and diagnostics provided",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-m",
|
||||||
|
"--mmap",
|
||||||
|
type="int",
|
||||||
|
default=-1,
|
||||||
|
help="1: use mmap; 0: don't use mmap; -1: accept heuristic",
|
||||||
|
)
|
||||||
|
oparser.add_option("-e", "--encoding", default="", help="encoding override")
|
||||||
|
oparser.add_option(
|
||||||
|
"-f",
|
||||||
|
"--formatting",
|
||||||
|
type="int",
|
||||||
|
default=0,
|
||||||
|
help="0 (default): no fmt info\n1: fmt info (all cells)\n",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-g",
|
||||||
|
"--gc",
|
||||||
|
type="int",
|
||||||
|
default=0,
|
||||||
|
help="0: auto gc enabled; 1: auto gc disabled, manual collect after each file; 2: no gc",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-s",
|
||||||
|
"--onesheet",
|
||||||
|
default="",
|
||||||
|
help="restrict output to this sheet (name or index)",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-u",
|
||||||
|
"--unnumbered",
|
||||||
|
action="store_true",
|
||||||
|
default=0,
|
||||||
|
help="omit line numbers or offsets in biff_dump",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-d",
|
||||||
|
"--on-demand",
|
||||||
|
action="store_true",
|
||||||
|
default=0,
|
||||||
|
help="load sheets on demand instead of all at once",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-t",
|
||||||
|
"--suppress-timing",
|
||||||
|
action="store_true",
|
||||||
|
default=0,
|
||||||
|
help="don't print timings (diffs are less messy)",
|
||||||
|
)
|
||||||
|
oparser.add_option(
|
||||||
|
"-r",
|
||||||
|
"--ragged-rows",
|
||||||
|
action="store_true",
|
||||||
|
default=0,
|
||||||
|
help="open_workbook(..., ragged_rows=True)",
|
||||||
|
)
|
||||||
|
options, args = oparser.parse_args(cmd_args)
|
||||||
|
if len(args) == 1 and args[0] in ("version",):
|
||||||
|
pass
|
||||||
|
elif len(args) < 2:
|
||||||
|
oparser.error("Expected at least 2 args, found %d" % len(args))
|
||||||
|
cmd = args[0]
|
||||||
|
xlrd_version = getattr(xlrd, "__VERSION__", "unknown; before 0.5")
|
||||||
|
if cmd == "biff_dump":
|
||||||
|
xlrd.dump(args[1], unnumbered=options.unnumbered)
|
||||||
|
sys.exit(0)
|
||||||
|
if cmd == "biff_count":
|
||||||
|
xlrd.count_records(args[1])
|
||||||
|
sys.exit(0)
|
||||||
|
if cmd == "version":
|
||||||
|
print("xlrd: %s, from %s" % (xlrd_version, xlrd.__file__))
|
||||||
|
print("Python:", sys.version)
|
||||||
|
sys.exit(0)
|
||||||
|
if options.logfilename:
|
||||||
|
logfile = LogHandler(open(options.logfilename, "w"))
|
||||||
|
else:
|
||||||
|
logfile = sys.stdout
|
||||||
|
mmap_opt = options.mmap
|
||||||
|
mmap_arg = xlrd.USE_MMAP
|
||||||
|
if mmap_opt in (1, 0):
|
||||||
|
mmap_arg = mmap_opt
|
||||||
|
elif mmap_opt != -1:
|
||||||
|
print(
|
||||||
|
"Unexpected value (%r) for mmap option -- assuming default" % mmap_opt
|
||||||
|
)
|
||||||
|
fmt_opt = options.formatting | (cmd in ("xfc",))
|
||||||
|
gc_mode = options.gc
|
||||||
|
if gc_mode:
|
||||||
|
gc.disable()
|
||||||
|
for pattern in args[1:]:
|
||||||
|
for fname in glob.glob(pattern):
|
||||||
|
print("\n=== File: %s ===" % fname)
|
||||||
|
if logfile != sys.stdout:
|
||||||
|
logfile.setfileheading("\n=== File: %s ===\n" % fname)
|
||||||
|
if gc_mode == 1:
|
||||||
|
n_unreachable = gc.collect()
|
||||||
|
if n_unreachable:
|
||||||
|
print("GC before open:", n_unreachable, "unreachable objects")
|
||||||
|
try:
|
||||||
|
t0 = time.time()
|
||||||
|
bk = xlrd.open_workbook(
|
||||||
|
fname,
|
||||||
|
verbosity=options.verbosity,
|
||||||
|
logfile=logfile,
|
||||||
|
use_mmap=mmap_arg,
|
||||||
|
encoding_override=options.encoding,
|
||||||
|
formatting_info=fmt_opt,
|
||||||
|
on_demand=options.on_demand,
|
||||||
|
ragged_rows=options.ragged_rows,
|
||||||
|
)
|
||||||
|
t1 = time.time()
|
||||||
|
if not options.suppress_timing:
|
||||||
|
print("Open took %.2f seconds" % (t1 - t0,))
|
||||||
|
except xlrd.XLRDError as e:
|
||||||
|
print("*** Open failed: %s: %s" % (type(e).__name__, e))
|
||||||
|
continue
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("*** KeyboardInterrupt ***")
|
||||||
|
traceback.print_exc(file=sys.stdout)
|
||||||
|
sys.exit(1)
|
||||||
|
except BaseException as e:
|
||||||
|
print("*** Open failed: %s: %s" % (type(e).__name__, e))
|
||||||
|
traceback.print_exc(file=sys.stdout)
|
||||||
|
continue
|
||||||
|
t0 = time.time()
|
||||||
|
if cmd == "hdr":
|
||||||
|
bk_header(bk)
|
||||||
|
elif cmd == "ov": # OverView
|
||||||
|
show(bk, 0)
|
||||||
|
elif cmd == "show": # all rows
|
||||||
|
show(bk)
|
||||||
|
elif cmd == "2rows": # first row and last row
|
||||||
|
show(bk, 2)
|
||||||
|
elif cmd == "3rows": # first row, 2nd row and last row
|
||||||
|
show(bk, 3)
|
||||||
|
elif cmd == "bench":
|
||||||
|
show(bk, printit=0)
|
||||||
|
elif cmd == "fonts":
|
||||||
|
bk_header(bk)
|
||||||
|
show_fonts(bk)
|
||||||
|
elif cmd == "names": # named reference list
|
||||||
|
show_names(bk)
|
||||||
|
elif cmd == "name_dump": # named reference list
|
||||||
|
show_names(bk, dump=1)
|
||||||
|
elif cmd == "labels":
|
||||||
|
show_labels(bk)
|
||||||
|
elif cmd == "xfc":
|
||||||
|
count_xfs(bk)
|
||||||
|
else:
|
||||||
|
print("*** Unknown command <%s>" % cmd)
|
||||||
|
sys.exit(1)
|
||||||
|
del bk
|
||||||
|
if gc_mode == 1:
|
||||||
|
n_unreachable = gc.collect()
|
||||||
|
if n_unreachable:
|
||||||
|
print(
|
||||||
|
"GC post cmd:",
|
||||||
|
fname,
|
||||||
|
"->",
|
||||||
|
n_unreachable,
|
||||||
|
"unreachable objects",
|
||||||
|
)
|
||||||
|
if not options.suppress_timing:
|
||||||
|
t1 = time.time()
|
||||||
|
print("\ncommand took %.2f seconds\n" % (t1 - t0,))
|
||||||
|
return None
|
||||||
|
|
||||||
|
av = sys.argv[1:]
|
||||||
|
if not av:
|
||||||
|
main(av)
|
||||||
|
firstarg = av[0].lower()
|
||||||
|
if firstarg == "hotshot":
|
||||||
|
import hotshot
|
||||||
|
import hotshot.stats
|
||||||
|
|
||||||
|
av = av[1:]
|
||||||
|
prof_log_name = "XXXX.prof"
|
||||||
|
prof = hotshot.Profile(prof_log_name)
|
||||||
|
# benchtime, result = prof.runcall(main, *av)
|
||||||
|
result = prof.runcall(main, *(av,))
|
||||||
|
print("result", repr(result))
|
||||||
|
prof.close()
|
||||||
|
stats = hotshot.stats.load(prof_log_name)
|
||||||
|
stats.strip_dirs()
|
||||||
|
stats.sort_stats("time", "calls")
|
||||||
|
stats.print_stats(20)
|
||||||
|
elif firstarg == "profile":
|
||||||
|
import cProfile
|
||||||
|
|
||||||
|
av = av[1:]
|
||||||
|
cProfile.run("main(av)", "YYYY.prof")
|
||||||
|
import pstats
|
||||||
|
|
||||||
|
p = pstats.Stats("YYYY.prof")
|
||||||
|
p.strip_dirs().sort_stats("cumulative").print_stats(30)
|
||||||
|
else:
|
||||||
|
main(av)
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from tabulate import _main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(_main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from google.cloud.aiplatform.tensorboard.uploader_main import run_main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(run_main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from huggingface_hub.inference._mcp.cli import app
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(app())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from tqdm.cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from transformers.commands.transformers_cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# vba_extract - A simple utility to extract a vbaProject.bin binary from an
|
||||||
|
# Excel 2007+ xlsm file for insertion into an XlsxWriter file.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013-2025, John McNamara, jmcnamara@cpan.org
|
||||||
|
#
|
||||||
|
import sys
|
||||||
|
from zipfile import BadZipFile, ZipFile
|
||||||
|
|
||||||
|
|
||||||
|
def extract_file(xlsm_zip, filename):
|
||||||
|
# Extract a single file from an Excel xlsm macro file.
|
||||||
|
data = xlsm_zip.read("xl/" + filename)
|
||||||
|
# Write the data to a local file.
|
||||||
|
file = open(filename, "wb")
|
||||||
|
file.write(data)
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
|
# The VBA project file and project signature file we want to extract.
|
||||||
|
vba_filename = "vbaProject.bin"
|
||||||
|
vba_signature_filename = "vbaProjectSignature.bin"
|
||||||
|
# Get the xlsm file name from the commandline.
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
xlsm_file = sys.argv[1]
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
"\nUtility to extract a vbaProject.bin binary from an Excel 2007+ "
|
||||||
|
"xlsm macro file for insertion into an XlsxWriter file.\n"
|
||||||
|
"If the macros are digitally signed, extracts also a vbaProjectSignature.bin "
|
||||||
|
"file.\n"
|
||||||
|
"\n"
|
||||||
|
"See: https://xlsxwriter.readthedocs.io/working_with_macros.html\n"
|
||||||
|
"\n"
|
||||||
|
"Usage: vba_extract file.xlsm\n"
|
||||||
|
)
|
||||||
|
sys.exit()
|
||||||
|
try:
|
||||||
|
# Open the Excel xlsm file as a zip file.
|
||||||
|
xlsm_zip = ZipFile(xlsm_file, "r")
|
||||||
|
# Read the xl/vbaProject.bin file.
|
||||||
|
extract_file(xlsm_zip, vba_filename)
|
||||||
|
print(f"Extracted: {vba_filename}")
|
||||||
|
if "xl/" + vba_signature_filename in xlsm_zip.namelist():
|
||||||
|
extract_file(xlsm_zip, vba_signature_filename)
|
||||||
|
print(f"Extracted: {vba_signature_filename}")
|
||||||
|
except IOError as e:
|
||||||
|
print(f"File error: {str(e)}")
|
||||||
|
sys.exit()
|
||||||
|
except KeyError as e:
|
||||||
|
# Usually when there isn't a xl/vbaProject.bin member in the file.
|
||||||
|
print(f"File error: {str(e)}")
|
||||||
|
print(f"File may not be an Excel xlsm macro file: '{xlsm_file}'")
|
||||||
|
sys.exit()
|
||||||
|
except BadZipFile as e:
|
||||||
|
# Usually if the file is an xls file and not an xlsm file.
|
||||||
|
print(f"File error: {str(e)}: '{xlsm_file}'")
|
||||||
|
print("File may not be an Excel xlsm macro file.")
|
||||||
|
sys.exit()
|
||||||
|
except Exception as e:
|
||||||
|
# Catch any other exceptions.
|
||||||
|
print(f"File error: {str(e)}")
|
||||||
|
sys.exit()
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from wandb.cli.cli import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from wandb.cli.cli import cli
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(cli())
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
from webvtt.cli import main
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||||
|
sys.exit(main())
|
||||||
@ -0,0 +1,241 @@
|
|||||||
|
#!/home/zdj/value/dify/venv312/bin/python3.12
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2006 Søren Roug, European Environment Agency
|
||||||
|
#
|
||||||
|
# This is free software. You may redistribute it under the terms
|
||||||
|
# of the Apache license and the GNU General Public License Version
|
||||||
|
# 2 or at your option any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# OpenDocument can be a complete office document in a single
|
||||||
|
# XML document. This script will take such a document and create
|
||||||
|
# a package
|
||||||
|
import io
|
||||||
|
import zipfile,time, sys, getopt
|
||||||
|
import xml.sax, xml.sax.saxutils
|
||||||
|
from odf import manifest
|
||||||
|
|
||||||
|
class SplitWriter:
|
||||||
|
def __init__(self):
|
||||||
|
self.activefiles = []
|
||||||
|
self._content = []
|
||||||
|
self._meta = []
|
||||||
|
self._styles = []
|
||||||
|
self._settings = []
|
||||||
|
|
||||||
|
self.files = {'content': self._content, 'meta': self._meta,
|
||||||
|
'styles':self._styles, 'settings': self._settings }
|
||||||
|
|
||||||
|
def write(self, str):
|
||||||
|
for f in self.activefiles:
|
||||||
|
f.append(str)
|
||||||
|
|
||||||
|
def activate(self, filename):
|
||||||
|
file = self.files[filename]
|
||||||
|
if file not in self.activefiles:
|
||||||
|
self.activefiles.append(file)
|
||||||
|
|
||||||
|
def deactivate(self, filename):
|
||||||
|
file = self.files[filename]
|
||||||
|
if file in self.activefiles:
|
||||||
|
self.activefiles.remove(file)
|
||||||
|
|
||||||
|
odmimetypes = {
|
||||||
|
'application/vnd.oasis.opendocument.text': '.odt',
|
||||||
|
'application/vnd.oasis.opendocument.text-template': '.ott',
|
||||||
|
'application/vnd.oasis.opendocument.graphics': '.odg',
|
||||||
|
'application/vnd.oasis.opendocument.graphics-template': '.otg',
|
||||||
|
'application/vnd.oasis.opendocument.presentation': '.odp',
|
||||||
|
'application/vnd.oasis.opendocument.presentation-template': '.otp',
|
||||||
|
'application/vnd.oasis.opendocument.spreadsheet': '.ods',
|
||||||
|
'application/vnd.oasis.opendocument.spreadsheet-template': '.ots',
|
||||||
|
'application/vnd.oasis.opendocument.chart': '.odc',
|
||||||
|
'application/vnd.oasis.opendocument.chart-template': '.otc',
|
||||||
|
'application/vnd.oasis.opendocument.image': '.odi',
|
||||||
|
'application/vnd.oasis.opendocument.image-template': '.oti',
|
||||||
|
'application/vnd.oasis.opendocument.formula': '.odf',
|
||||||
|
'application/vnd.oasis.opendocument.formula-template': '.otf',
|
||||||
|
'application/vnd.oasis.opendocument.text-master': '.odm',
|
||||||
|
'application/vnd.oasis.opendocument.text-web': '.oth',
|
||||||
|
}
|
||||||
|
|
||||||
|
OFFICENS = u"urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||||
|
base = xml.sax.saxutils.XMLGenerator
|
||||||
|
|
||||||
|
class odfsplitter(base):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self._mimetype = ''
|
||||||
|
self.output = SplitWriter()
|
||||||
|
self._prefixes = []
|
||||||
|
base.__init__(self, self.output, 'utf-8')
|
||||||
|
|
||||||
|
def startPrefixMapping(self, prefix, uri):
|
||||||
|
base.startPrefixMapping(self, prefix, uri)
|
||||||
|
self._prefixes.append('xmlns:%s="%s"' % (prefix, uri))
|
||||||
|
|
||||||
|
def startElementNS(self, name, qname, attrs):
|
||||||
|
if name == (OFFICENS, u"document"):
|
||||||
|
self._mimetype = attrs.get((OFFICENS, "mimetype"))
|
||||||
|
elif name == (OFFICENS, u"meta"):
|
||||||
|
self.output.activate('meta')
|
||||||
|
|
||||||
|
elif name == (OFFICENS, u"settings"):
|
||||||
|
self.output.activate('settings')
|
||||||
|
elif name == (OFFICENS, u"scripts"):
|
||||||
|
self.output.activate('content')
|
||||||
|
elif name == (OFFICENS, u"font-face-decls"):
|
||||||
|
self.output.activate('content')
|
||||||
|
self.output.activate('styles')
|
||||||
|
elif name == (OFFICENS, u"styles"):
|
||||||
|
self.output.activate('styles')
|
||||||
|
elif name == (OFFICENS, u"automatic-styles"):
|
||||||
|
self.output.activate('content')
|
||||||
|
self.output.activate('styles')
|
||||||
|
elif name == (OFFICENS, u"master-styles"):
|
||||||
|
self.output.activate('styles')
|
||||||
|
elif name == (OFFICENS, u"body"):
|
||||||
|
self.output.activate('content')
|
||||||
|
base.startElementNS(self, name, qname, attrs)
|
||||||
|
|
||||||
|
def endElementNS(self, name, qname):
|
||||||
|
base.endElementNS(self, name, qname)
|
||||||
|
if name == (OFFICENS, u"meta"):
|
||||||
|
self.output.deactivate('meta')
|
||||||
|
elif name == (OFFICENS, u"settings"):
|
||||||
|
self.output.deactivate('settings')
|
||||||
|
elif name == (OFFICENS, u"scripts"):
|
||||||
|
self.output.deactivate('content')
|
||||||
|
elif name == (OFFICENS, u"font-face-decls"):
|
||||||
|
self.output.deactivate('content')
|
||||||
|
self.output.deactivate('styles')
|
||||||
|
elif name == (OFFICENS, u"styles"):
|
||||||
|
self.output.deactivate('styles')
|
||||||
|
elif name == (OFFICENS, u"automatic-styles"):
|
||||||
|
self.output.deactivate('content')
|
||||||
|
self.output.deactivate('styles')
|
||||||
|
elif name == (OFFICENS, u"master-styles"):
|
||||||
|
self.output.deactivate('styles')
|
||||||
|
elif name == (OFFICENS, u"body"):
|
||||||
|
self.output.deactivate('content')
|
||||||
|
|
||||||
|
|
||||||
|
def content(self):
|
||||||
|
""" Return the content inside a wrapper called <office:document-content>
|
||||||
|
"""
|
||||||
|
prefixes = ' '.join(self._prefixes)
|
||||||
|
return ''.join(['<?xml version="1.0" encoding="UTF-8"?>\n<office:document-content %s office:version="1.0">' % prefixes] + list(map(lambda x: x.decode("utf-8"), self.output._content)) + ['</office:document-content>'])
|
||||||
|
|
||||||
|
def settings(self):
|
||||||
|
prefixes = ' '.join(self._prefixes).encode('utf-8')
|
||||||
|
return ''.join( ['<?xml version="1.0" encoding="UTF-8"?>\n<office:document-settings %s office:version="1.0">' % prefixes] + self.output._settings + ['''</office:document-settings>'''])
|
||||||
|
|
||||||
|
def styles(self):
|
||||||
|
prefixes = ' '.join(self._prefixes)
|
||||||
|
return ''.join( ['<?xml version="1.0" encoding="UTF-8"?>\n<office:document-styles %s office:version="1.0">' % prefixes] + list(map(lambda x: x.decode("utf-8"), self.output._styles)) + ['''</office:document-styles>'''])
|
||||||
|
|
||||||
|
def meta(self):
|
||||||
|
prefixes = ' '.join(self._prefixes)
|
||||||
|
return ''.join( ['<?xml version="1.0" encoding="UTF-8"?>\n<office:document-meta %s office:version="1.0">' % prefixes] + list(map(lambda x: x.decode("utf-8"), self.output._meta)) + ['''</office:document-meta>'''])
|
||||||
|
|
||||||
|
def usage():
|
||||||
|
sys.stderr.write("Usage: %s [-o outputfile] [-s] inputfile\n" % sys.argv[0])
|
||||||
|
|
||||||
|
def manifestxml(m):
|
||||||
|
""" Generates the content of the manifest.xml file """
|
||||||
|
xml=io.StringIO()
|
||||||
|
xml.write(u"<?xml version='1.0' encoding='UTF-8'?>\n")
|
||||||
|
m.toXml(0,xml)
|
||||||
|
return xml.getvalue()
|
||||||
|
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(sys.argv[1:], "o:s", ["output=","suffix"])
|
||||||
|
except getopt.GetoptError:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
outputfile = '-'
|
||||||
|
addsuffix = False
|
||||||
|
|
||||||
|
for o, a in opts:
|
||||||
|
if o in ("-o", "--output"):
|
||||||
|
outputfile = a
|
||||||
|
if o in ("-s", "--suffix"):
|
||||||
|
addsuffix = True
|
||||||
|
|
||||||
|
if len(args) > 1:
|
||||||
|
usage()
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
odfs = odfsplitter()
|
||||||
|
parser = xml.sax.make_parser()
|
||||||
|
parser.setFeature(xml.sax.handler.feature_namespaces, 1)
|
||||||
|
parser.setContentHandler(odfs)
|
||||||
|
if len(args) == 0:
|
||||||
|
parser.parse(sys.stdin)
|
||||||
|
else:
|
||||||
|
parser.parse(open(args[0],"r"))
|
||||||
|
|
||||||
|
mimetype = odfs._mimetype
|
||||||
|
suffix = odmimetypes.get(mimetype,'.xxx')
|
||||||
|
|
||||||
|
if outputfile == '-':
|
||||||
|
if sys.stdout.isatty():
|
||||||
|
sys.stderr.write("Won't write ODF file to terminal\n")
|
||||||
|
sys.exit(1)
|
||||||
|
z = zipfile.ZipFile(sys.stdout,"w")
|
||||||
|
else:
|
||||||
|
if addsuffix:
|
||||||
|
outputfile = outputfile + suffix
|
||||||
|
z = zipfile.ZipFile(outputfile,"w")
|
||||||
|
|
||||||
|
now = time.localtime()[:6]
|
||||||
|
|
||||||
|
# Write mimetype
|
||||||
|
zi = zipfile.ZipInfo('mimetype', now)
|
||||||
|
zi.compress_type = zipfile.ZIP_STORED
|
||||||
|
z.writestr(zi,mimetype)
|
||||||
|
|
||||||
|
# Write content
|
||||||
|
zi = zipfile.ZipInfo("content.xml", now)
|
||||||
|
zi.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
z.writestr(zi,odfs.content() )
|
||||||
|
# Write styles
|
||||||
|
zi = zipfile.ZipInfo("styles.xml", now)
|
||||||
|
zi.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
z.writestr(zi,odfs.styles() )
|
||||||
|
|
||||||
|
# Write meta
|
||||||
|
zi = zipfile.ZipInfo("meta.xml", now)
|
||||||
|
zi.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
z.writestr(zi,odfs.meta() )
|
||||||
|
|
||||||
|
m = manifest.Manifest()
|
||||||
|
m.addElement(manifest.FileEntry(fullpath="/", mediatype=mimetype))
|
||||||
|
m.addElement(manifest.FileEntry(fullpath="content.xml",mediatype="text/xml"))
|
||||||
|
m.addElement(manifest.FileEntry(fullpath="styles.xml", mediatype="text/xml"))
|
||||||
|
m.addElement(manifest.FileEntry(fullpath="meta.xml", mediatype="text/xml"))
|
||||||
|
|
||||||
|
# Write manifest
|
||||||
|
zi = zipfile.ZipInfo("META-INF/manifest.xml", now)
|
||||||
|
zi.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
z.writestr(zi, manifestxml(m).encode("utf-8") )
|
||||||
|
z.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Local Variables: ***
|
||||||
|
# mode: python ***
|
||||||
|
# End: ***
|
||||||
@ -0,0 +1,164 @@
|
|||||||
|
/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */
|
||||||
|
|
||||||
|
/* Greenlet object interface */
|
||||||
|
|
||||||
|
#ifndef Py_GREENLETOBJECT_H
|
||||||
|
#define Py_GREENLETOBJECT_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <Python.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This is deprecated and undocumented. It does not change. */
|
||||||
|
#define GREENLET_VERSION "1.0.0"
|
||||||
|
|
||||||
|
#ifndef GREENLET_MODULE
|
||||||
|
#define implementation_ptr_t void*
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct _greenlet {
|
||||||
|
PyObject_HEAD
|
||||||
|
PyObject* weakreflist;
|
||||||
|
PyObject* dict;
|
||||||
|
implementation_ptr_t pimpl;
|
||||||
|
} PyGreenlet;
|
||||||
|
|
||||||
|
#define PyGreenlet_Check(op) (op && PyObject_TypeCheck(op, &PyGreenlet_Type))
|
||||||
|
|
||||||
|
|
||||||
|
/* C API functions */
|
||||||
|
|
||||||
|
/* Total number of symbols that are exported */
|
||||||
|
#define PyGreenlet_API_pointers 12
|
||||||
|
|
||||||
|
#define PyGreenlet_Type_NUM 0
|
||||||
|
#define PyExc_GreenletError_NUM 1
|
||||||
|
#define PyExc_GreenletExit_NUM 2
|
||||||
|
|
||||||
|
#define PyGreenlet_New_NUM 3
|
||||||
|
#define PyGreenlet_GetCurrent_NUM 4
|
||||||
|
#define PyGreenlet_Throw_NUM 5
|
||||||
|
#define PyGreenlet_Switch_NUM 6
|
||||||
|
#define PyGreenlet_SetParent_NUM 7
|
||||||
|
|
||||||
|
#define PyGreenlet_MAIN_NUM 8
|
||||||
|
#define PyGreenlet_STARTED_NUM 9
|
||||||
|
#define PyGreenlet_ACTIVE_NUM 10
|
||||||
|
#define PyGreenlet_GET_PARENT_NUM 11
|
||||||
|
|
||||||
|
#ifndef GREENLET_MODULE
|
||||||
|
/* This section is used by modules that uses the greenlet C API */
|
||||||
|
static void** _PyGreenlet_API = NULL;
|
||||||
|
|
||||||
|
# define PyGreenlet_Type \
|
||||||
|
(*(PyTypeObject*)_PyGreenlet_API[PyGreenlet_Type_NUM])
|
||||||
|
|
||||||
|
# define PyExc_GreenletError \
|
||||||
|
((PyObject*)_PyGreenlet_API[PyExc_GreenletError_NUM])
|
||||||
|
|
||||||
|
# define PyExc_GreenletExit \
|
||||||
|
((PyObject*)_PyGreenlet_API[PyExc_GreenletExit_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PyGreenlet_New(PyObject *args)
|
||||||
|
*
|
||||||
|
* greenlet.greenlet(run, parent=None)
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_New \
|
||||||
|
(*(PyGreenlet * (*)(PyObject * run, PyGreenlet * parent)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_New_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PyGreenlet_GetCurrent(void)
|
||||||
|
*
|
||||||
|
* greenlet.getcurrent()
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_GetCurrent \
|
||||||
|
(*(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PyGreenlet_Throw(
|
||||||
|
* PyGreenlet *greenlet,
|
||||||
|
* PyObject *typ,
|
||||||
|
* PyObject *val,
|
||||||
|
* PyObject *tb)
|
||||||
|
*
|
||||||
|
* g.throw(...)
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_Throw \
|
||||||
|
(*(PyObject * (*)(PyGreenlet * self, \
|
||||||
|
PyObject * typ, \
|
||||||
|
PyObject * val, \
|
||||||
|
PyObject * tb)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_Throw_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args)
|
||||||
|
*
|
||||||
|
* g.switch(*args, **kwargs)
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_Switch \
|
||||||
|
(*(PyObject * \
|
||||||
|
(*)(PyGreenlet * greenlet, PyObject * args, PyObject * kwargs)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_Switch_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent)
|
||||||
|
*
|
||||||
|
* g.parent = new_parent
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_SetParent \
|
||||||
|
(*(int (*)(PyGreenlet * greenlet, PyGreenlet * nparent)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_SetParent_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PyGreenlet_GetParent(PyObject* greenlet)
|
||||||
|
*
|
||||||
|
* return greenlet.parent;
|
||||||
|
*
|
||||||
|
* This could return NULL even if there is no exception active.
|
||||||
|
* If it does not return NULL, you are responsible for decrementing the
|
||||||
|
* reference count.
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_GetParent \
|
||||||
|
(*(PyGreenlet* (*)(PyGreenlet*)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_GET_PARENT_NUM])
|
||||||
|
|
||||||
|
/*
|
||||||
|
* deprecated, undocumented alias.
|
||||||
|
*/
|
||||||
|
# define PyGreenlet_GET_PARENT PyGreenlet_GetParent
|
||||||
|
|
||||||
|
# define PyGreenlet_MAIN \
|
||||||
|
(*(int (*)(PyGreenlet*)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_MAIN_NUM])
|
||||||
|
|
||||||
|
# define PyGreenlet_STARTED \
|
||||||
|
(*(int (*)(PyGreenlet*)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_STARTED_NUM])
|
||||||
|
|
||||||
|
# define PyGreenlet_ACTIVE \
|
||||||
|
(*(int (*)(PyGreenlet*)) \
|
||||||
|
_PyGreenlet_API[PyGreenlet_ACTIVE_NUM])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Macro that imports greenlet and initializes C API */
|
||||||
|
/* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we
|
||||||
|
keep the older definition to be sure older code that might have a copy of
|
||||||
|
the header still works. */
|
||||||
|
# define PyGreenlet_Import() \
|
||||||
|
{ \
|
||||||
|
_PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* GREENLET_MODULE */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* !Py_GREENLETOBJECT_H */
|
||||||
@ -0,0 +1 @@
|
|||||||
|
lib
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
home = /usr/bin
|
||||||
|
include-system-site-packages = false
|
||||||
|
version = 3.12.11
|
||||||
|
executable = /usr/bin/python3.12
|
||||||
|
command = /usr/bin/python3.12 -m venv /home/zdj/value/dify/venv312
|
||||||
@ -0,0 +1,270 @@
|
|||||||
|
.\" Title: csv2ods
|
||||||
|
.\" Author: Agustin Henze <agustinhenze at gmail.com>
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 01/04/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "CSV2ODS" "1" "01/04/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
csv2ods \- Create OpenDocument spreadsheet from comma separated values
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBcsv2ods\fR\ 'u
|
||||||
|
\fBcsv2ods\fR \-i\ \fIfile\&.csv\fR \-o\ \fIfile\&.ods\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
This program reads a file in CSV format \- table of columns delimited by commas, tabs or any other character\&. It then creates a spreadsheet\&. If a value looks like a number the cell is formatted as a number as well\&.
|
||||||
|
.SH "Options"
|
||||||
|
.PP
|
||||||
|
\-\-version
|
||||||
|
.RS 4
|
||||||
|
Show program\'s version number and exit
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-h, \-\-help
|
||||||
|
.RS 4
|
||||||
|
Show help message and exit
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-i \fIINPUT\fR, \-\-input=\fIINPUT\fR
|
||||||
|
.RS 4
|
||||||
|
File input in csv\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-o \fIOUTPUT\fR, \-\-output=\fIOUTPUT\fR
|
||||||
|
.RS 4
|
||||||
|
File output in ods\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-d \fIDELIMITER\fR, \-\-delimiter=\fIDELIMITER\fR
|
||||||
|
.RS 4
|
||||||
|
Specifies a one\-character string to use as the field separator\&. It defaults to ","\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-c \fIENCODING\fR, \-\-encoding=\fIENCODING\fR
|
||||||
|
.RS 4
|
||||||
|
Specifies the encoding the file csv\&. It defaults to utf\-8\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-t \fITABLENAME\fR, \-\-table=\fITABLENAME\fR
|
||||||
|
.RS 4
|
||||||
|
The table name in the output file\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-s \fISKIPINITIALSPACE\fR, \-\-skipinitialspace=\fISKIPINITIALSPACE\fR
|
||||||
|
.RS 4
|
||||||
|
Specifies how to interpret whitespace which immediately follows a delimiter\&. It defaults to False, which means that whitespace immediately following a delimiter is part of the following field\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-l \fILINETERMINATOR\fR, \-\-lineterminator=\fILINETERMINATOR\fR
|
||||||
|
.RS 4
|
||||||
|
Specifies the character sequence which should terminate rows\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-q \fIQUOTING\fR, \-\-quoting=\fIQUOTING\fR
|
||||||
|
.RS 4
|
||||||
|
It can take on any of the following module constants: 0 = QUOTE_MINIMAL means only when required, for example, when a field contains either the quotechar or the delimiter\&. 1 = QUOTE_ALL means that quotes are always placed around fields\&. 2 = QUOTE_NONNUMERIC means that quotes are always placed around fields which do not parse as integers or floating point numbers\&. 3 = QUOTE_NONE means that quotes are never placed around fields\&. It defaults is QUOTE_MINIMAL\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-e \fIESCAPECHAR\fR, \-\-escapechar=\fIESCAPECHAR\fR
|
||||||
|
.RS 4
|
||||||
|
Specifies a one\-character string used to escape the delimiter when quoting is set to QUOTE_NONE\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-r \fIQUOTECHAR\fR, \-\-quotechar=\fIQUOTECHAR\fR
|
||||||
|
.RS 4
|
||||||
|
Specifies a one\-character string to use as the quoting character\&. It defaults to "\&.
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
csv2ods \-i /etc/passwd \-o accounts\&.odt \-d:
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBAgustin Henze\fR <\&agustinhenze at gmail\&.com\&>
|
||||||
|
.RS 4
|
||||||
|
Original author of csv\-ods\&.py
|
||||||
|
.RE
|
||||||
@ -0,0 +1,232 @@
|
|||||||
|
.\" Title: mailodf
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "MAILODF" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
mailodf \- Email ODF file as HTML archive
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBmailodf\fR\ 'u
|
||||||
|
\fBmailodf\fR [\-f\ \fIfrom\fR] [\-s\ \fIsubject\fR] \fIinputfile\fR \fIrecipients\fR...
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
mailodf is a program that will create a MIME\-encapsulated web archive and then sends it as an email\&. Most email programs that understand HTML understands this format\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqInputfile\(rq
|
||||||
|
is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "References"
|
||||||
|
.RS 4
|
||||||
|
HTTRACK (http://www\&.httrack\&.com/) can create such archives with the \-%M option\&.
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://en\&.wikipedia\&.org/wiki/MHTML
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://www\&.dsv\&.su\&.se/~jpalme/ietf/mhtml\&.html
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://users\&.otenet\&.gr/~geosp/kmhtconvert/
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://www\&.faqs\&.org/rfcs/rfc2557\&.html
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
mailodf \-f lars\&.oppermann@sun\&.com \-s "F\&.Y\&.I" odf\-file
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
odf2mht
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,239 @@
|
|||||||
|
.\" Title: odf2mht
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODF2MHT" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odf2mht \- Convert ODF to HTML archive
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodf2mht\fR\ 'u
|
||||||
|
\fBodf2mht\fR \fIpath\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
\fBOdf2mht\fR
|
||||||
|
is a program that will create a MIME\-encapsulated web archive (\&.mht) format where images are preserved\&. The file can be read by Internet Explorer, MS\-Word and many email programs such as MS\-Outlook\&. It will write the web archive to stdout\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqPath\(rq
|
||||||
|
is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "References"
|
||||||
|
.RS 4
|
||||||
|
HTTRACK (http://www\&.httrack\&.com/) can create such archives with the \-%M option\&.
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://en\&.wikipedia\&.org/wiki/MHTML
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://www\&.dsv\&.su\&.se/~jpalme/ietf/mhtml\&.html
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://users\&.otenet\&.gr/~geosp/kmhtconvert/
|
||||||
|
.RE
|
||||||
|
.RS 4
|
||||||
|
http://www\&.faqs\&.org/rfcs/rfc2557\&.html
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odf2mht example\&.odt >example\&.mht
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "Bugs"
|
||||||
|
.PP
|
||||||
|
IE6 seems to have problems with large MHT files\&.
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\fBodftools\fR(1),
|
||||||
|
\fBodf2war\fR(1),
|
||||||
|
\fBmailodf\fR(1)
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,221 @@
|
|||||||
|
.\" Title: odf2xhtml
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 01/04/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODF2XHTML" "1" "01/04/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odf2xhtml \- Convert ODF to HTML
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodf2xhtml\fR\ 'u
|
||||||
|
\fBodf2xhtml\fR [\-e] \fIpath\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
\fBodf2xhtml\fR
|
||||||
|
is a program that will create a webpage (\&.html) from the input file and will write the webpage to stdout\&.
|
||||||
|
.PP
|
||||||
|
"Path" is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "Options"
|
||||||
|
.PP
|
||||||
|
\-p, \-\-plain
|
||||||
|
.RS 4
|
||||||
|
The \-p flag will generate HTML without CSS\&.
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odf2xhtml odf\-file
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
\fBodf2mht\fR(1)
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,231 @@
|
|||||||
|
.\" Title: odf2xml
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 01/04/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODF2XML" "1" "01/04/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odf2xml \- Create OpenDocument XML file from OD? package
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodf2xml\fR\ 'u
|
||||||
|
\fBodf2xml\fR [\-e] [\-o\ \fIoutputfile\fR] [\fIinputfile\fR]
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
OpenDocument can be a complete office document in a single XML file\&. The script will take an OpenDocument and create an XML file This is mainly useful XML processors such as XSL transformation\&.
|
||||||
|
.PP
|
||||||
|
.PP
|
||||||
|
"Inputfile" is assumed to be an OpenDocument file\&. If there is no inputfile, the program will read from standard input\&.
|
||||||
|
.SH "Options"
|
||||||
|
.PP
|
||||||
|
\-e
|
||||||
|
.RS 4
|
||||||
|
Normally, images that are stored in the archive in the Pictures folder are ignored\&. Using the \-e flag will
|
||||||
|
\fIembed\fR
|
||||||
|
the images in the XML as base64\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-o \fIoutputfile\fR
|
||||||
|
.RS 4
|
||||||
|
If output file is not specified output will be to standard out\&.
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odf2xml \-o file\&.xml testdocument\&.odt
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
\fBxml2odf\fR(1)
|
||||||
|
.SH "Bugs"
|
||||||
|
.PP
|
||||||
|
Doesn\'t handle external data \-\- images and such\&.
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,227 @@
|
|||||||
|
.\" Title: odfimgimport
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 01/04/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODFIMGIMPORT" "1" "01/04/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odfimgimport \- Import external images
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodfimgimport\fR\ 'u
|
||||||
|
\fBodfimgimport\fR [\-q] [\-o\ \fIoutputfile\fR] [\fIinputfile\fR]
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
If you copy and paste html from your webbrowser to your word processor, the pictures in the pasted text will still load the images from the Internet\&. This script will import all images into the OpenDocument file\&.
|
||||||
|
.PP
|
||||||
|
If you don\'t provide an input file, the program will read from stdin\&. If the program reads from stdin, it might not know how to resolve relative filenames\&. If you don\'t provide an output file, the program will import the pictures into the input file\&.
|
||||||
|
.SH "Options"
|
||||||
|
.PP
|
||||||
|
\-q
|
||||||
|
.RS 4
|
||||||
|
If there are images that can\'t be imported, odfimgimport will write how many has failed\&. The \-q flag will prevent that\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-v
|
||||||
|
.RS 4
|
||||||
|
Verbose: Prints the URL of every image it tries to import and the result\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-o \fIoutputfile\fR
|
||||||
|
.RS 4
|
||||||
|
The file to save the output to\&. "\-" is stdout\&. Defaults to the input file\&.
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odfimgimport \-v \-o newfile\&.odt oldfile\&.odt
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,217 @@
|
|||||||
|
.\" Title: odflint
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODFLINT" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odflint \- Check ODF file for problems
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodflint\fR\ 'u
|
||||||
|
\fBodflint\fR \fIpath\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
\fBodflint\fR
|
||||||
|
is a program that will check an ODF file and give warning if it finds something suspect\&. It is not able to make a full validation due to the complexity of the schema\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqPath\(rq
|
||||||
|
is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odflint odf\-file
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "Bugs"
|
||||||
|
.PP
|
||||||
|
Validates all versions of ODF as if they are version 1\&.1\&. You\'ll therefore get some false positives if you check files that aren\'t generated by odfpy scripts\&.
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,277 @@
|
|||||||
|
.\" Title: odfmeta
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODFMETA" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odfmeta \- List or change the metadata of an ODF file
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodfmeta\fR\ 'u
|
||||||
|
\fBodfmeta\fR [\-l] [\-v] [\-V] [\-c] [\-d] [\-x\ \fImetafield\fR...] [\-X\ \fImetafield\fR...] [\-a\ \fImetafield\fR...] [\-A\ \fImetafield\fR...] [\-I\ \fImetafield\fR...] [\-o\ \fIpath\fR] \fIpath\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
\fBodfmeta\fR
|
||||||
|
is a program that will list or change the metadata in an OpenDocument file\&. This is useful for version control systems\&. You can change title, keywords, description etc\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqPath\(rq
|
||||||
|
is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "Options"
|
||||||
|
.PP
|
||||||
|
\-l
|
||||||
|
.RS 4
|
||||||
|
List (extract) all known metadata fields\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-v or \-V
|
||||||
|
.RS 4
|
||||||
|
Print the version number of the ODF document
|
||||||
|
\fIformat\fR\&. If you use \-V it will print "version:" before the number for compatibility with \-X\&. The version number can\'t be modified\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-c
|
||||||
|
.RS 4
|
||||||
|
Make field values continous by normalizing white space\&. Might be convenient when postprocessing with standard (line oriented) text utilities\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-d
|
||||||
|
.RS 4
|
||||||
|
Update the modification date to the current date and time\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-x \fImetafield\fR
|
||||||
|
.RS 4
|
||||||
|
Extract the contents of this metafield from the file\&. Known field names are creation\-date, creator, date, description, editing\-cycles, editing\-duration, generator, initial\-creator, keyword, language, print\-date, printed\-by, subject, title, user\-defined\&. All other names are assumed to be user defined\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-X \fImetafield\fR
|
||||||
|
.RS 4
|
||||||
|
Same as \-x, but also preserves/includes the field name\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-a \fImetafield\fR
|
||||||
|
.RS 4
|
||||||
|
Append a custom metafield to the metadata; but only if a similar field does not exist yet\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-A \fImetafield\fR
|
||||||
|
.RS 4
|
||||||
|
Append a custom metafield to the metadata in any case\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-I \fImetafield\fR
|
||||||
|
.RS 4
|
||||||
|
Append a custom metafield to the metadata and remove any existing similar field\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-o \fIpath\fR
|
||||||
|
.RS 4
|
||||||
|
Filename to write modified ODT file to\&. If no
|
||||||
|
\fB\-o\fR
|
||||||
|
option is provided, the ODT file will be written to stdout\&.
|
||||||
|
.RE
|
||||||
|
.SH "Examples"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odfmeta \-l odf\-file\&.odt
|
||||||
|
odfmeta \-I "title:The Little Engine That Could" \-A subject:I\-think\-I\-can \-o newfile\&.odt source\&.odt
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\fBformail\fR(1),
|
||||||
|
\fBid3tag\fR(1)
|
||||||
|
.SH "Bugs"
|
||||||
|
.PP
|
||||||
|
All known versions of OpenOffice\&.org keep only four <meta:user\-defined> elements\&. If you add more than those, you\'ll loose them next time you save with OpenOffice\&.org\&. KOffice keeps only one <meta:keyword> element\&.
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,213 @@
|
|||||||
|
.\" Title: odfoutline
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODFOUTLINE" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odfoutline \- Show outline of OpenDocument
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodfoutline\fR\ 'u
|
||||||
|
\fBodfoutline\fR \fIpath\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
odfoutline is a simple program that will show the headings in the file and the level the heading is\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqPath\(rq
|
||||||
|
is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odfoutline odf\-file
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
@ -0,0 +1,267 @@
|
|||||||
|
.\" Title: odfuserfield
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "ODFUSERFIELD" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
odfuserfield \- List or change the user\-field declarations in an ODF file
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBodfuserfield\fR\ 'u
|
||||||
|
\fBodfuserfield\fR [\-l] [\-L] [\-x\ \fIfield\fR...] [\-X\ \fIfield\fR...] [\-s\ \fIfield:value\fR...] [\-o\ \fIpath\fR] \fIpath\fR
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\fBOdfuserfield\fR
|
||||||
|
is a program that will list or change the user variable declarations in an OpenDocument file\&. There are two kinds of variables in OpenDocument\&. Simple variables can take different values at different positions, throughout a document\&. User variables have the same value throughout a document\&. Due to the latter\'s global nature it is safe to change them with an external application\&.
|
||||||
|
.PP
|
||||||
|
Use
|
||||||
|
\fBodfuserfield\fR
|
||||||
|
to fill out form letters before printing or giving to the user\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqPath\(rq
|
||||||
|
is assumed to be an OpenDocument file of text, spreadsheet or presentation type\&.
|
||||||
|
.SH "Options"
|
||||||
|
.PP
|
||||||
|
\-l
|
||||||
|
.RS 4
|
||||||
|
List (extract) all known user\-fields\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-L
|
||||||
|
.RS 4
|
||||||
|
List (extract) all known user\-fields with type and value\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-x \fIfield\fR
|
||||||
|
.RS 4
|
||||||
|
Extract the contents of this field from the file\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-X \fIfield\fR
|
||||||
|
.RS 4
|
||||||
|
Same as \-x, but also preserves/includes the field name and type\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-s \fIfield:value\fR
|
||||||
|
.RS 4
|
||||||
|
Set the value of an existing user field\&. The field type will be the same\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\-o \fIpath\fR
|
||||||
|
.RS 4
|
||||||
|
Filename to write modified ODT file to\&. If no
|
||||||
|
\fB\-o\fR
|
||||||
|
option is provided, the ODT file will be written to stdout\&.
|
||||||
|
.RE
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
odfuserfield \-L odf\-file
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\fBformail\fR(1),
|
||||||
|
\fBid3tag\fR(1)
|
||||||
|
.SH "Todo"
|
||||||
|
.PP
|
||||||
|
Implement formulas\&. See OpenDocument v1\&.0 specification section 6\&.3\&.5\&. This requires a different syntax for \-s arguments\&.
|
||||||
|
.SH "Authors"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
\fBMichael Howitz\fR
|
||||||
|
.br
|
||||||
|
gocept gmbh & co\&. kg
|
||||||
|
.RS 4
|
||||||
|
Refactoring
|
||||||
|
.RE
|
||||||
@ -0,0 +1,235 @@
|
|||||||
|
.\" Title: xml2odf
|
||||||
|
.\" Author: S\(/oren Roug
|
||||||
|
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
|
||||||
|
.\" Date: 03/15/2009
|
||||||
|
.\" Manual: User commands
|
||||||
|
.\" Source: odfpy
|
||||||
|
.\" Language: English
|
||||||
|
.\"
|
||||||
|
.TH "XML2ODF" "1" "03/15/2009" "odfpy" "User commands"
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * (re)Define some macros
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" toupper - uppercase a string (locale-aware)
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de toupper
|
||||||
|
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
|
||||||
|
\\$*
|
||||||
|
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH-xref - format a cross-reference to an SH section
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de SH-xref
|
||||||
|
.ie n \{\
|
||||||
|
.\}
|
||||||
|
.toupper \\$*
|
||||||
|
.el \{\
|
||||||
|
\\$*
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SH - level-one heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SH
|
||||||
|
.\" put an extra blank line of space above the head in non-TTY output
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.HTML-TAG ".NH \\n[an-level]"
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +3
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.ie n \{\
|
||||||
|
.\" if n (TTY output), use uppercase
|
||||||
|
.toupper \\$*
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
.nr an-break-flag 0
|
||||||
|
.\" if not n (not TTY), use normal case (not uppercase)
|
||||||
|
\\$1
|
||||||
|
.in \\n[an-margin]u
|
||||||
|
.ti 0
|
||||||
|
.\" if not n (not TTY), put a border/line under subheading
|
||||||
|
.sp -.6
|
||||||
|
\l'\n(.lu'
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" SS - level-two heading that works better for non-TTY output
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de1 SS
|
||||||
|
.sp \\n[PD]u
|
||||||
|
.nr an-level 1
|
||||||
|
.set-an-margin
|
||||||
|
.nr an-prevailing-indent \\n[IN]
|
||||||
|
.fi
|
||||||
|
.in \\n[IN]u
|
||||||
|
.ti \\n[SN]u
|
||||||
|
.it 1 an-trap
|
||||||
|
.nr an-no-space-flag 1
|
||||||
|
.nr an-break-flag 1
|
||||||
|
.ps \\n[PS-SS]u
|
||||||
|
\." make the size of the head bigger
|
||||||
|
.ps +2
|
||||||
|
.ft B
|
||||||
|
.ne (2v + 1u)
|
||||||
|
.if \\n[.$] \&\\$*
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BB/BE - put background/screen (filled box) around block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BB
|
||||||
|
.if t \{\
|
||||||
|
.sp -.5
|
||||||
|
.br
|
||||||
|
.in +2n
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EB
|
||||||
|
.if t \{\
|
||||||
|
.if "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.in
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BW \\n(.lu-\\n(.i
|
||||||
|
.nr BH \\n(dn+.5v
|
||||||
|
.ne \\n(BHu+.5v
|
||||||
|
.ie "\\$2"adjust-for-leading-newline" \{\
|
||||||
|
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
|
||||||
|
.\}
|
||||||
|
.in 0
|
||||||
|
.sp -.5v
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.sp .5v
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.\" BM/EM - put colored marker in margin next to block of text
|
||||||
|
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
.de BM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.ll -2n
|
||||||
|
.gcolor red
|
||||||
|
.di BX
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.de EM
|
||||||
|
.if t \{\
|
||||||
|
.br
|
||||||
|
.di
|
||||||
|
.ll
|
||||||
|
.gcolor
|
||||||
|
.nr BH \\n(dn
|
||||||
|
.ne \\n(BHu
|
||||||
|
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
|
||||||
|
.in 0
|
||||||
|
.nf
|
||||||
|
.BX
|
||||||
|
.in
|
||||||
|
.fi
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * set default formatting
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" disable hyphenation
|
||||||
|
.nh
|
||||||
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
.ad l
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.\" * MAIN CONTENT STARTS HERE *
|
||||||
|
.\" -----------------------------------------------------------------
|
||||||
|
.SH "Name"
|
||||||
|
xml2odf \- Create ODF package from OpenDocument in XML form
|
||||||
|
.SH "Synopsis"
|
||||||
|
.fam C
|
||||||
|
.HP \w'\fBxml2odf\fR\ 'u
|
||||||
|
\fBxml2odf\fR [\-o\ \fIoutputfile\fR] [\-s] [\fIinputfile\fR]
|
||||||
|
.fam
|
||||||
|
.SH "Description"
|
||||||
|
.PP
|
||||||
|
OpenDocument can be a complete office document in a single XML file\&. The script will take such a document and create a package\&. This is mainly useful as a postprocesser of a program producing XML, such as a stylesheet\&.
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\(lqInputfile\(rq
|
||||||
|
is assumed to be an OpenDocument file in XML form\&. If there is no inputfile, the program will read from standard input\&. The flag \-s adds correct suffix to the filename according to what mime type is found in the XML file, in cause you don\'t know already what document type you are packaging\&.
|
||||||
|
.PP
|
||||||
|
If output file is not specified output will be to standard out\&.
|
||||||
|
.PP
|
||||||
|
Section 2\&.1\&.1 of
|
||||||
|
Open Document Format for Office Applications
|
||||||
|
says that the [content\&.xml] file contains the document content, along with the
|
||||||
|
\fIautomatic styles\fR
|
||||||
|
needed for the document content\&. The [styles\&.xml] file contains all the named styles of a document, along with the
|
||||||
|
\fIautomatic styles\fR
|
||||||
|
needed for the named styles\&. The application doesn\'t know which automatic style is needed for what, so it puts the same set of automatic styles into both files\&.
|
||||||
|
.PP
|
||||||
|
One could assume that the inverse operation would be easier, but OpenOffice\&.org is quite happy to use the same names for two different automatic styles\&. For instance, a style used inside <style:footer> can have the same name as one used inside <office:text> but be a different paragraph style\&. This is reported as bug #90494 (http://www\&.openoffice\&.org/issues/show_bug\&.cgi?id=90494)
|
||||||
|
.SH "Example"
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.fam C
|
||||||
|
.ps -1
|
||||||
|
.nf
|
||||||
|
.if t \{\
|
||||||
|
.sp -1
|
||||||
|
.\}
|
||||||
|
.BB lightgray adjust-for-leading-newline
|
||||||
|
.sp -1
|
||||||
|
|
||||||
|
xml2odf \-o testdocument \-s xml\-file
|
||||||
|
.EB lightgray adjust-for-leading-newline
|
||||||
|
.if t \{\
|
||||||
|
.sp 1
|
||||||
|
.\}
|
||||||
|
.fi
|
||||||
|
.fam
|
||||||
|
.ps +1
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.SH "See Also"
|
||||||
|
.PP
|
||||||
|
|
||||||
|
\fBodftools\fR(1),
|
||||||
|
\fBodf2xml\fR(1)
|
||||||
|
.SH "Bugs"
|
||||||
|
.PP
|
||||||
|
Doesn\'t handle external data \-\- images and such\&.
|
||||||
|
.PP
|
||||||
|
The library used for the parsing of XML expands empty elements from <element/> to <element></element>\&. It should not have an effect on the document parsing\&.
|
||||||
|
.SH "Author"
|
||||||
|
.PP
|
||||||
|
\fBS\(/oren Roug\fR
|
||||||
|
.RS 4
|
||||||
|
Original author
|
||||||
|
.RE
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue