diff --git a/.ecrc b/.ecrc new file mode 100644 index 0000000000..29035d920b --- /dev/null +++ b/.ecrc @@ -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/** diff --git a/.editorconfig-checker.json b/.editorconfig-checker.json new file mode 100644 index 0000000000..e222a48dc5 --- /dev/null +++ b/.editorconfig-checker.json @@ -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" + ] +} diff --git a/api/core/workflow/nodes/agent/agent_node.py b/api/core/workflow/nodes/agent/agent_node.py index 00bbb37752..80d5a1d471 100644 --- a/api/core/workflow/nodes/agent/agent_node.py +++ b/api/core/workflow/nodes/agent/agent_node.py @@ -106,7 +106,7 @@ class AgentNode(ToolNode): agent_thoughts = [] from core.tools.entities.tool_entities import ToolInvokeMessage - + thought_log_message = ToolInvokeMessage( type=ToolInvokeMessage.MessageType.LOG, message=ToolInvokeMessage.LogMessage( @@ -128,11 +128,11 @@ class AgentNode(ToolNode): ) from core.tools.entities.tool_entities import ToolInvokeMessage - + def enhanced_message_stream(): - + yield thought_log_message - + yield from message_stream yield from self._transform_message( diff --git a/api/core/workflow/nodes/tool/tool_node.py b/api/core/workflow/nodes/tool/tool_node.py index 795a16663e..c52419c427 100644 --- a/api/core/workflow/nodes/tool/tool_node.py +++ b/api/core/workflow/nodes/tool/tool_node.py @@ -381,11 +381,11 @@ class ToolNode(BaseNode[ToolNodeData]): elif isinstance(json_output, list): # If json is a list with multiple elements, create a dictionary containing all data json_output = {"data": json_output} - + # Ensure json_output is a dictionary type if not isinstance(json_output, dict): json_output = {"data": json_output} - + # Add agent_logs to json output json_output["agent_logs"] = [ { diff --git a/core/prompt/entities/advanced_prompt_entities.py b/core/prompt/entities/advanced_prompt_entities.py index 2c56b82465..1f7b43f053 100644 --- a/core/prompt/entities/advanced_prompt_entities.py +++ b/core/prompt/entities/advanced_prompt_entities.py @@ -16,4 +16,4 @@ class MemoryConfig(BaseModel): values["role_prefix"] = {} if "window" not in values: values["window"] = {} - return values \ No newline at end of file + return values diff --git a/venv312/.lock b/venv312/.lock new file mode 100755 index 0000000000..e69de29bb2 diff --git a/venv312/bin/Activate.ps1 b/venv312/bin/Activate.ps1 new file mode 100644 index 0000000000..b49d77ba44 --- /dev/null +++ b/venv312/bin/Activate.ps1 @@ -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" diff --git a/venv312/bin/activate b/venv312/bin/activate new file mode 100644 index 0000000000..ff8ae39838 --- /dev/null +++ b/venv312/bin/activate @@ -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 diff --git a/venv312/bin/activate.csh b/venv312/bin/activate.csh new file mode 100644 index 0000000000..5447b26b44 --- /dev/null +++ b/venv312/bin/activate.csh @@ -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 . +# Ported to Python 3.3 venv by Andrew Svetlov + +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 diff --git a/venv312/bin/activate.fish b/venv312/bin/activate.fish new file mode 100644 index 0000000000..9e87966de5 --- /dev/null +++ b/venv312/bin/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source /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 diff --git a/venv312/bin/alembic b/venv312/bin/alembic new file mode 100755 index 0000000000..01e0e6d248 --- /dev/null +++ b/venv312/bin/alembic @@ -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()) diff --git a/venv312/bin/celery b/venv312/bin/celery new file mode 100755 index 0000000000..ac5ab35e9a --- /dev/null +++ b/venv312/bin/celery @@ -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()) diff --git a/venv312/bin/chardetect b/venv312/bin/chardetect new file mode 100755 index 0000000000..93834bc2a3 --- /dev/null +++ b/venv312/bin/chardetect @@ -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()) diff --git a/venv312/bin/coverage b/venv312/bin/coverage new file mode 100755 index 0000000000..d6b869dee0 --- /dev/null +++ b/venv312/bin/coverage @@ -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()) diff --git a/venv312/bin/coverage-3.12 b/venv312/bin/coverage-3.12 new file mode 100755 index 0000000000..d6b869dee0 --- /dev/null +++ b/venv312/bin/coverage-3.12 @@ -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()) diff --git a/venv312/bin/coverage3 b/venv312/bin/coverage3 new file mode 100755 index 0000000000..d6b869dee0 --- /dev/null +++ b/venv312/bin/coverage3 @@ -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()) diff --git a/venv312/bin/csv2ods b/venv312/bin/csv2ods new file mode 100755 index 0000000000..7426221547 --- /dev/null +++ b/venv312/bin/csv2ods @@ -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 +# - 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: *** diff --git a/venv312/bin/distro b/venv312/bin/distro new file mode 100755 index 0000000000..2e7e6c2352 --- /dev/null +++ b/venv312/bin/distro @@ -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()) diff --git a/venv312/bin/dotenv b/venv312/bin/dotenv new file mode 100755 index 0000000000..27d60a0014 --- /dev/null +++ b/venv312/bin/dotenv @@ -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()) diff --git a/venv312/bin/f2py b/venv312/bin/f2py new file mode 100755 index 0000000000..d3fe8acc59 --- /dev/null +++ b/venv312/bin/f2py @@ -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()) diff --git a/venv312/bin/filetype b/venv312/bin/filetype new file mode 100755 index 0000000000..5cd6419229 --- /dev/null +++ b/venv312/bin/filetype @@ -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()) diff --git a/venv312/bin/flask b/venv312/bin/flask new file mode 100755 index 0000000000..1cce5d1dad --- /dev/null +++ b/venv312/bin/flask @@ -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()) diff --git a/venv312/bin/gql-cli b/venv312/bin/gql-cli new file mode 100755 index 0000000000..7ecda5ef82 --- /dev/null +++ b/venv312/bin/gql-cli @@ -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()) diff --git a/venv312/bin/gunicorn b/venv312/bin/gunicorn new file mode 100755 index 0000000000..f5b7f87b57 --- /dev/null +++ b/venv312/bin/gunicorn @@ -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()) diff --git a/venv312/bin/httpx b/venv312/bin/httpx new file mode 100755 index 0000000000..dd043d0801 --- /dev/null +++ b/venv312/bin/httpx @@ -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()) diff --git a/venv312/bin/huggingface-cli b/venv312/bin/huggingface-cli new file mode 100755 index 0000000000..f11995c9dd --- /dev/null +++ b/venv312/bin/huggingface-cli @@ -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()) diff --git a/venv312/bin/hypothesis b/venv312/bin/hypothesis new file mode 100755 index 0000000000..83ebfd5c18 --- /dev/null +++ b/venv312/bin/hypothesis @@ -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()) diff --git a/venv312/bin/jp.py b/venv312/bin/jp.py new file mode 100755 index 0000000000..42b3f3561a --- /dev/null +++ b/venv312/bin/jp.py @@ -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()) diff --git a/venv312/bin/json_repair b/venv312/bin/json_repair new file mode 100755 index 0000000000..980b6e98a6 --- /dev/null +++ b/venv312/bin/json_repair @@ -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()) diff --git a/venv312/bin/jsonschema b/venv312/bin/jsonschema new file mode 100755 index 0000000000..3a5f1a10af --- /dev/null +++ b/venv312/bin/jsonschema @@ -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()) diff --git a/venv312/bin/langsmith b/venv312/bin/langsmith new file mode 100755 index 0000000000..c57a7aa92d --- /dev/null +++ b/venv312/bin/langsmith @@ -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()) diff --git a/venv312/bin/litellm b/venv312/bin/litellm new file mode 100755 index 0000000000..3323a8e331 --- /dev/null +++ b/venv312/bin/litellm @@ -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()) diff --git a/venv312/bin/mailodf b/venv312/bin/mailodf new file mode 100755 index 0000000000..13a7103786 --- /dev/null +++ b/venv312/bin/mailodf @@ -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: *** diff --git a/venv312/bin/mako-render b/venv312/bin/mako-render new file mode 100755 index 0000000000..c6137b2589 --- /dev/null +++ b/venv312/bin/mako-render @@ -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()) diff --git a/venv312/bin/markdown-it b/venv312/bin/markdown-it new file mode 100755 index 0000000000..8f675758a7 --- /dev/null +++ b/venv312/bin/markdown-it @@ -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()) diff --git a/venv312/bin/markdown_py b/venv312/bin/markdown_py new file mode 100755 index 0000000000..50ede06f12 --- /dev/null +++ b/venv312/bin/markdown_py @@ -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()) diff --git a/venv312/bin/milvus-lite b/venv312/bin/milvus-lite new file mode 100755 index 0000000000..47a0ff45b6 --- /dev/null +++ b/venv312/bin/milvus-lite @@ -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()) diff --git a/venv312/bin/nltk b/venv312/bin/nltk new file mode 100755 index 0000000000..f87afc0d08 --- /dev/null +++ b/venv312/bin/nltk @@ -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()) diff --git a/venv312/bin/normalizer b/venv312/bin/normalizer new file mode 100755 index 0000000000..993348cf2a --- /dev/null +++ b/venv312/bin/normalizer @@ -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()) diff --git a/venv312/bin/numba b/venv312/bin/numba new file mode 100755 index 0000000000..e5cf5110b3 --- /dev/null +++ b/venv312/bin/numba @@ -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() diff --git a/venv312/bin/odf2mht b/venv312/bin/odf2mht new file mode 100755 index 0000000000..54afca121c --- /dev/null +++ b/venv312/bin/odf2mht @@ -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'] = '' +# 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: *** diff --git a/venv312/bin/odf2xhtml b/venv312/bin/odf2xhtml new file mode 100755 index 0000000000..c5ed722d51 --- /dev/null +++ b/venv312/bin/odf2xhtml @@ -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: *** diff --git a/venv312/bin/odf2xml b/venv312/bin/odf2xml new file mode 100755 index 0000000000..a4a17828c3 --- /dev/null +++ b/venv312/bin/odf2xml @@ -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: *** diff --git a/venv312/bin/odfimgimport b/venv312/bin/odfimgimport new file mode 100755 index 0000000000..45f4a7f2bd --- /dev/null +++ b/venv312/bin/odfimgimport @@ -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: *** diff --git a/venv312/bin/odflint b/venv312/bin/odflint new file mode 100755 index 0000000000..4cff9f71db --- /dev/null +++ b/venv312/bin/odflint @@ -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: *** diff --git a/venv312/bin/odfmeta b/venv312/bin/odfmeta new file mode 100755 index 0000000000..bb2d3e1a7b --- /dev/null +++ b/venv312/bin/odfmeta @@ -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: *** diff --git a/venv312/bin/odfoutline b/venv312/bin/odfoutline new file mode 100755 index 0000000000..f9ac21baf1 --- /dev/null +++ b/venv312/bin/odfoutline @@ -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: *** diff --git a/venv312/bin/odfuserfield b/venv312/bin/odfuserfield new file mode 100755 index 0000000000..ee21abead9 --- /dev/null +++ b/venv312/bin/odfuserfield @@ -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: *** diff --git a/venv312/bin/openai b/venv312/bin/openai new file mode 100755 index 0000000000..c4fb5f39cc --- /dev/null +++ b/venv312/bin/openai @@ -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()) diff --git a/venv312/bin/opentelemetry-bootstrap b/venv312/bin/opentelemetry-bootstrap new file mode 100755 index 0000000000..69dd116c01 --- /dev/null +++ b/venv312/bin/opentelemetry-bootstrap @@ -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()) diff --git a/venv312/bin/opentelemetry-instrument b/venv312/bin/opentelemetry-instrument new file mode 100755 index 0000000000..43388ca8eb --- /dev/null +++ b/venv312/bin/opentelemetry-instrument @@ -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()) diff --git a/venv312/bin/opik b/venv312/bin/opik new file mode 100755 index 0000000000..8e17d24e1e --- /dev/null +++ b/venv312/bin/opik @@ -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()) diff --git a/venv312/bin/oxmsg b/venv312/bin/oxmsg new file mode 100755 index 0000000000..3362010f70 --- /dev/null +++ b/venv312/bin/oxmsg @@ -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()) diff --git a/venv312/bin/pip b/venv312/bin/pip new file mode 100755 index 0000000000..c957af3d7c --- /dev/null +++ b/venv312/bin/pip @@ -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()) diff --git a/venv312/bin/pip3 b/venv312/bin/pip3 new file mode 100755 index 0000000000..c957af3d7c --- /dev/null +++ b/venv312/bin/pip3 @@ -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()) diff --git a/venv312/bin/pip3.12 b/venv312/bin/pip3.12 new file mode 100755 index 0000000000..c957af3d7c --- /dev/null +++ b/venv312/bin/pip3.12 @@ -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()) diff --git a/venv312/bin/py.test b/venv312/bin/py.test new file mode 100755 index 0000000000..d824250a42 --- /dev/null +++ b/venv312/bin/py.test @@ -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()) diff --git a/venv312/bin/pygmentize b/venv312/bin/pygmentize new file mode 100755 index 0000000000..465434ae1c --- /dev/null +++ b/venv312/bin/pygmentize @@ -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()) diff --git a/venv312/bin/pypdfium2 b/venv312/bin/pypdfium2 new file mode 100755 index 0000000000..de959a49c0 --- /dev/null +++ b/venv312/bin/pypdfium2 @@ -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()) diff --git a/venv312/bin/pyrsa-decrypt b/venv312/bin/pyrsa-decrypt new file mode 100755 index 0000000000..5f6b690bd9 --- /dev/null +++ b/venv312/bin/pyrsa-decrypt @@ -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()) diff --git a/venv312/bin/pyrsa-encrypt b/venv312/bin/pyrsa-encrypt new file mode 100755 index 0000000000..8b062e6ddf --- /dev/null +++ b/venv312/bin/pyrsa-encrypt @@ -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()) diff --git a/venv312/bin/pyrsa-keygen b/venv312/bin/pyrsa-keygen new file mode 100755 index 0000000000..6251a0d03d --- /dev/null +++ b/venv312/bin/pyrsa-keygen @@ -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()) diff --git a/venv312/bin/pyrsa-priv2pub b/venv312/bin/pyrsa-priv2pub new file mode 100755 index 0000000000..c3a8ac0923 --- /dev/null +++ b/venv312/bin/pyrsa-priv2pub @@ -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()) diff --git a/venv312/bin/pyrsa-sign b/venv312/bin/pyrsa-sign new file mode 100755 index 0000000000..a69d0b7bb3 --- /dev/null +++ b/venv312/bin/pyrsa-sign @@ -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()) diff --git a/venv312/bin/pyrsa-verify b/venv312/bin/pyrsa-verify new file mode 100755 index 0000000000..62884763e9 --- /dev/null +++ b/venv312/bin/pyrsa-verify @@ -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()) diff --git a/venv312/bin/pytest b/venv312/bin/pytest new file mode 100755 index 0000000000..d824250a42 --- /dev/null +++ b/venv312/bin/pytest @@ -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()) diff --git a/venv312/bin/python b/venv312/bin/python new file mode 120000 index 0000000000..11b9d88531 --- /dev/null +++ b/venv312/bin/python @@ -0,0 +1 @@ +python3.12 \ No newline at end of file diff --git a/venv312/bin/python3 b/venv312/bin/python3 new file mode 120000 index 0000000000..11b9d88531 --- /dev/null +++ b/venv312/bin/python3 @@ -0,0 +1 @@ +python3.12 \ No newline at end of file diff --git a/venv312/bin/python3.12 b/venv312/bin/python3.12 new file mode 120000 index 0000000000..dc92e127ca --- /dev/null +++ b/venv312/bin/python3.12 @@ -0,0 +1 @@ +/usr/bin/python3.12 \ No newline at end of file diff --git a/venv312/bin/readabilipy b/venv312/bin/readabilipy new file mode 100755 index 0000000000..a68bd22f22 --- /dev/null +++ b/venv312/bin/readabilipy @@ -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()) diff --git a/venv312/bin/release b/venv312/bin/release new file mode 100755 index 0000000000..69ab7c4cef --- /dev/null +++ b/venv312/bin/release @@ -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()) diff --git a/venv312/bin/ruff b/venv312/bin/ruff new file mode 100755 index 0000000000..b6c89c3053 Binary files /dev/null and b/venv312/bin/ruff differ diff --git a/venv312/bin/runxlrd.py b/venv312/bin/runxlrd.py new file mode 100755 index 0000000000..623e409a3f --- /dev/null +++ b/venv312/bin/runxlrd.py @@ -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, "" % 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) diff --git a/venv312/bin/tabulate b/venv312/bin/tabulate new file mode 100755 index 0000000000..71e9716e8c --- /dev/null +++ b/venv312/bin/tabulate @@ -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()) diff --git a/venv312/bin/tb-gcp-uploader b/venv312/bin/tb-gcp-uploader new file mode 100755 index 0000000000..d275b70ef8 --- /dev/null +++ b/venv312/bin/tb-gcp-uploader @@ -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()) diff --git a/venv312/bin/tiny-agents b/venv312/bin/tiny-agents new file mode 100755 index 0000000000..6b17415ffe --- /dev/null +++ b/venv312/bin/tiny-agents @@ -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()) diff --git a/venv312/bin/tqdm b/venv312/bin/tqdm new file mode 100755 index 0000000000..e5a846d974 --- /dev/null +++ b/venv312/bin/tqdm @@ -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()) diff --git a/venv312/bin/transformers-cli b/venv312/bin/transformers-cli new file mode 100755 index 0000000000..f8c7fb8e5d --- /dev/null +++ b/venv312/bin/transformers-cli @@ -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()) diff --git a/venv312/bin/vba_extract.py b/venv312/bin/vba_extract.py new file mode 100755 index 0000000000..34909ae6bd --- /dev/null +++ b/venv312/bin/vba_extract.py @@ -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() diff --git a/venv312/bin/wandb b/venv312/bin/wandb new file mode 100755 index 0000000000..970644f51d --- /dev/null +++ b/venv312/bin/wandb @@ -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()) diff --git a/venv312/bin/wb b/venv312/bin/wb new file mode 100755 index 0000000000..970644f51d --- /dev/null +++ b/venv312/bin/wb @@ -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()) diff --git a/venv312/bin/webvtt b/venv312/bin/webvtt new file mode 100755 index 0000000000..7d5327a582 --- /dev/null +++ b/venv312/bin/webvtt @@ -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()) diff --git a/venv312/bin/xml2odf b/venv312/bin/xml2odf new file mode 100755 index 0000000000..31b6ae51c9 --- /dev/null +++ b/venv312/bin/xml2odf @@ -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 + """ + prefixes = ' '.join(self._prefixes) + return ''.join(['\n' % prefixes] + list(map(lambda x: x.decode("utf-8"), self.output._content)) + ['']) + + def settings(self): + prefixes = ' '.join(self._prefixes).encode('utf-8') + return ''.join( ['\n' % prefixes] + self.output._settings + ['''''']) + + def styles(self): + prefixes = ' '.join(self._prefixes) + return ''.join( ['\n' % prefixes] + list(map(lambda x: x.decode("utf-8"), self.output._styles)) + ['''''']) + + def meta(self): + prefixes = ' '.join(self._prefixes) + return ''.join( ['\n' % prefixes] + list(map(lambda x: x.decode("utf-8"), self.output._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"\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: *** diff --git a/venv312/include/site/python3.12/greenlet/greenlet.h b/venv312/include/site/python3.12/greenlet/greenlet.h new file mode 100644 index 0000000000..d02a16e434 --- /dev/null +++ b/venv312/include/site/python3.12/greenlet/greenlet.h @@ -0,0 +1,164 @@ +/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */ + +/* Greenlet object interface */ + +#ifndef Py_GREENLETOBJECT_H +#define Py_GREENLETOBJECT_H + + +#include + +#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 */ diff --git a/venv312/lib64 b/venv312/lib64 new file mode 120000 index 0000000000..7951405f85 --- /dev/null +++ b/venv312/lib64 @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/venv312/pyvenv.cfg b/venv312/pyvenv.cfg new file mode 100644 index 0000000000..e806f81b6b --- /dev/null +++ b/venv312/pyvenv.cfg @@ -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 diff --git a/venv312/share/man/man1/csv2ods.1 b/venv312/share/man/man1/csv2ods.1 new file mode 100644 index 0000000000..e73e9b0aa3 --- /dev/null +++ b/venv312/share/man/man1/csv2ods.1 @@ -0,0 +1,270 @@ +.\" Title: csv2ods +.\" Author: Agustin Henze +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/mailodf.1 b/venv312/share/man/man1/mailodf.1 new file mode 100644 index 0000000000..1dcf836016 --- /dev/null +++ b/venv312/share/man/man1/mailodf.1 @@ -0,0 +1,232 @@ +.\" Title: mailodf +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odf2mht.1 b/venv312/share/man/man1/odf2mht.1 new file mode 100644 index 0000000000..a59c013db9 --- /dev/null +++ b/venv312/share/man/man1/odf2mht.1 @@ -0,0 +1,239 @@ +.\" Title: odf2mht +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odf2xhtml.1 b/venv312/share/man/man1/odf2xhtml.1 new file mode 100644 index 0000000000..902de0081b --- /dev/null +++ b/venv312/share/man/man1/odf2xhtml.1 @@ -0,0 +1,221 @@ +.\" Title: odf2xhtml +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odf2xml.1 b/venv312/share/man/man1/odf2xml.1 new file mode 100644 index 0000000000..26737fd613 --- /dev/null +++ b/venv312/share/man/man1/odf2xml.1 @@ -0,0 +1,231 @@ +.\" Title: odf2xml +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odfimgimport.1 b/venv312/share/man/man1/odfimgimport.1 new file mode 100644 index 0000000000..4193b7bf3d --- /dev/null +++ b/venv312/share/man/man1/odfimgimport.1 @@ -0,0 +1,227 @@ +.\" Title: odfimgimport +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odflint.1 b/venv312/share/man/man1/odflint.1 new file mode 100644 index 0000000000..a15a97b58e --- /dev/null +++ b/venv312/share/man/man1/odflint.1 @@ -0,0 +1,217 @@ +.\" Title: odflint +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odfmeta.1 b/venv312/share/man/man1/odfmeta.1 new file mode 100644 index 0000000000..b802527056 --- /dev/null +++ b/venv312/share/man/man1/odfmeta.1 @@ -0,0 +1,277 @@ +.\" Title: odfmeta +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 elements\&. If you add more than those, you\'ll loose them next time you save with OpenOffice\&.org\&. KOffice keeps only one element\&. +.SH "Author" +.PP +\fBS\(/oren Roug\fR +.RS 4 +Original author +.RE diff --git a/venv312/share/man/man1/odfoutline.1 b/venv312/share/man/man1/odfoutline.1 new file mode 100644 index 0000000000..169e662dea --- /dev/null +++ b/venv312/share/man/man1/odfoutline.1 @@ -0,0 +1,213 @@ +.\" Title: odfoutline +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/odfuserfield.1 b/venv312/share/man/man1/odfuserfield.1 new file mode 100644 index 0000000000..76cff7f754 --- /dev/null +++ b/venv312/share/man/man1/odfuserfield.1 @@ -0,0 +1,267 @@ +.\" Title: odfuserfield +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 diff --git a/venv312/share/man/man1/xml2odf.1 b/venv312/share/man/man1/xml2odf.1 new file mode 100644 index 0000000000..e204dd9c13 --- /dev/null +++ b/venv312/share/man/man1/xml2odf.1 @@ -0,0 +1,235 @@ +.\" Title: xml2odf +.\" Author: S\(/oren Roug +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" 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 can have the same name as one used inside 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 to \&. It should not have an effect on the document parsing\&. +.SH "Author" +.PP +\fBS\(/oren Roug\fR +.RS 4 +Original author +.RE diff --git a/web/app/(shareLayout)/layout.tsx b/web/app/(shareLayout)/layout.tsx index d057ba7599..f9c8d815bd 100644 --- a/web/app/(shareLayout)/layout.tsx +++ b/web/app/(shareLayout)/layout.tsx @@ -8,10 +8,12 @@ import { AccessMode } from '@/models/access-control' import { getAppAccessModeByAppCode } from '@/service/share' const Layout: FC<{ - children: React.ReactNode + children: React.ReactNode; }> = ({ children }) => { const isGlobalPending = useGlobalPublicStore(s => s.isGlobalPending) - const setWebAppAccessMode = useGlobalPublicStore(s => s.setWebAppAccessMode) + const setWebAppAccessMode = useGlobalPublicStore( + s => s.setWebAppAccessMode, + ) const systemFeatures = useGlobalPublicStore(s => s.systemFeatures) const pathname = usePathname() const searchParams = useSearchParams() @@ -26,25 +28,34 @@ const Layout: FC<{ let appCode: string | null = null if (redirectUrl) { - const url = new URL(`${window.location.origin}${decodeURIComponent(redirectUrl)}`) + const url = new URL( + `${window.location.origin}${decodeURIComponent(redirectUrl)}`, + ) appCode = url.pathname.split('/').pop() || null } - else { + else { appCode = pathname.split('/').pop() || null } - if (!appCode) - return + if (!appCode) return setIsLoading(true) const ret = await getAppAccessModeByAppCode(appCode) setWebAppAccessMode(ret?.accessMode || AccessMode.PUBLIC) setIsLoading(false) })() - }, [pathname, redirectUrl, setWebAppAccessMode, isGlobalPending, systemFeatures.webapp_auth.enabled]) + }, [ + pathname, + redirectUrl, + setWebAppAccessMode, + isGlobalPending, + systemFeatures.webapp_auth.enabled, + ]) if (isLoading || isGlobalPending) { - return
- -
+ return ( +
+ +
+ ) } return (
diff --git a/web/app/account/avatar.tsx b/web/app/account/avatar.tsx index ea897e639f..b3d6ba8198 100644 --- a/web/app/account/avatar.tsx +++ b/web/app/account/avatar.tsx @@ -2,10 +2,14 @@ import { useTranslation } from 'react-i18next' import { Fragment } from 'react' import { useRouter } from 'next/navigation' +import { RiGraduationCapFill } from '@remixicon/react' import { - RiGraduationCapFill, -} from '@remixicon/react' -import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' + Menu, + MenuButton, + MenuItem, + MenuItems, + Transition, +} from '@headlessui/react' import Avatar from '@/app/components/base/avatar' import { logout } from '@/service/common' import { useAppContext } from '@/context/app-context' @@ -14,7 +18,7 @@ import { LogOut01 } from '@/app/components/base/icons/src/vender/line/general' import PremiumBadge from '@/app/components/base/premium-badge' export type IAppSelector = { - isMobile: boolean + isMobile: boolean; } export default function AppSelector() { @@ -38,72 +42,84 @@ export default function AppSelector() { return ( - { - ({ open }) => ( - <> -
- ( + <> +
+ - - -
- - + - -
-
-
-
- {userProfile.name} - {isEducationAccount && ( - - - EDU - - )} -
-
{userProfile.email}
+ > + +
+
+
+
+ {userProfile.name} + {isEducationAccount && ( + + + EDU + + )} +
+
+ {userProfile.email}
-
+
- - -
handleLogout()}> -
- -
{t('common.userProfile.logout')}
+
+ + +
handleLogout()}> +
+ +
+ {t('common.userProfile.logout')}
- - - - - ) - } +
+
+ + + + )}
) } diff --git a/web/app/account/header.tsx b/web/app/account/header.tsx index d033bfab61..e219893421 100644 --- a/web/app/account/header.tsx +++ b/web/app/account/header.tsx @@ -18,27 +18,32 @@ const Header = () => { }, [router]) return ( -
-
-
- {systemFeatures.branding.enabled && systemFeatures.branding.login_page_logo - ? +
+
+ {systemFeatures.branding.enabled + && systemFeatures.branding.login_page_logo ? ( + Dify logo - : } + ) : ( + + )}
-
-

{t('common.account.account')}

+
+

+ {t('common.account.account')} +

-
- -
+
diff --git a/web/app/account/layout.tsx b/web/app/account/layout.tsx index e74716fb3b..3eae8ae1c7 100644 --- a/web/app/account/layout.tsx +++ b/web/app/account/layout.tsx @@ -21,7 +21,7 @@ const Layout = ({ children }: { children: ReactNode }) => {
-
+
{children}
diff --git a/web/app/account/page.tsx b/web/app/account/page.tsx index e4896cdeb6..52ab4706d2 100644 --- a/web/app/account/page.tsx +++ b/web/app/account/page.tsx @@ -6,7 +6,9 @@ import useDocumentTitle from '@/hooks/use-document-title' export default function Account() { const { t } = useTranslation() useDocumentTitle(t('common.menus.account')) - return
- -
+ return ( +
+ +
+ ) } diff --git a/web/app/activate/activateForm.tsx b/web/app/activate/activateForm.tsx index d9d07cbfa1..9ab25c5a83 100644 --- a/web/app/activate/activateForm.tsx +++ b/web/app/activate/activateForm.tsx @@ -21,8 +21,8 @@ const ActivateForm = () => { const checkParams = { url: '/activate/check', params: { - ...workspaceID && { workspace_id: workspaceID }, - ...email && { email }, + ...(workspaceID && { workspace_id: workspaceID }), + ...(email && { email }), token, }, } @@ -41,22 +41,26 @@ const ActivateForm = () => { }) return ( -
+ )} + > {!checkRes && } {checkRes && !checkRes.is_valid && (
-
🤷‍♂️
-

{t('login.invalid')}

+
+ 🤷‍♂️ +
+

+ {t('login.invalid')} +

diff --git a/web/app/activate/page.tsx b/web/app/activate/page.tsx index cfb1e6b149..bac5709ad3 100644 --- a/web/app/activate/page.tsx +++ b/web/app/activate/page.tsx @@ -8,13 +8,23 @@ import { useGlobalPublicStore } from '@/context/global-public-context' const Activate = () => { const { systemFeatures } = useGlobalPublicStore() return ( -
-
+
+
- {!systemFeatures.branding.enabled &&
- © {new Date().getFullYear()} LangGenius, Inc. All rights reserved. -
} + {!systemFeatures.branding.enabled && ( +
+ © {new Date().getFullYear()} LangGenius, Inc. All rights reserved. +
+ )}
) diff --git a/web/app/components/browser-initor.tsx b/web/app/components/browser-initor.tsx index f2f4b02dc0..82e2dc1e0d 100644 --- a/web/app/components/browser-initor.tsx +++ b/web/app/components/browser-initor.tsx @@ -30,7 +30,7 @@ try { localStorage = globalThis.localStorage sessionStorage = globalThis.sessionStorage } -catch { + catch { localStorage = new StorageMock() sessionStorage = new StorageMock() } @@ -43,9 +43,7 @@ Object.defineProperty(globalThis, 'sessionStorage', { value: sessionStorage, }) -const BrowserInitor = ({ - children, -}: { children: React.ReactNode }) => { +const BrowserInitor = ({ children }: { children: React.ReactNode }) => { return children } diff --git a/web/app/components/i18n-server.tsx b/web/app/components/i18n-server.tsx index 78d5ca4861..944e5f48d0 100644 --- a/web/app/components/i18n-server.tsx +++ b/web/app/components/i18n-server.tsx @@ -4,12 +4,10 @@ import { ToastProvider } from './base/toast' import { getLocaleOnServer } from '@/i18n/server' export type II18NServerProps = { - children: React.ReactNode + children: React.ReactNode; } -const I18NServer = async ({ - children, -}: II18NServerProps) => { +const I18NServer = async ({ children }: II18NServerProps) => { const locale = await getLocaleOnServer() return ( diff --git a/web/app/components/i18n.tsx b/web/app/components/i18n.tsx index f04f8d6cbe..367b7da6e8 100644 --- a/web/app/components/i18n.tsx +++ b/web/app/components/i18n.tsx @@ -7,23 +7,22 @@ import type { Locale } from '@/i18n' import { setLocaleOnClient } from '@/i18n' export type II18nProps = { - locale: Locale - children: React.ReactNode + locale: Locale; + children: React.ReactNode; } -const I18n: FC = ({ - locale, - children, -}) => { +const I18n: FC = ({ locale, children }) => { useEffect(() => { setLocaleOnClient(locale, false) }, [locale]) return ( - + {children} ) diff --git a/web/app/components/sentry-initor.tsx b/web/app/components/sentry-initor.tsx index 457a1cf7c7..3e1013c42c 100644 --- a/web/app/components/sentry-initor.tsx +++ b/web/app/components/sentry-initor.tsx @@ -5,9 +5,7 @@ import * as Sentry from '@sentry/react' const isDevelopment = process.env.NODE_ENV === 'development' -const SentryInit = ({ - children, -}: { children: React.ReactNode }) => { +const SentryInit = ({ children }: { children: React.ReactNode }) => { useEffect(() => { const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn') if (!isDevelopment && SENTRY_DSN) { diff --git a/web/app/components/swr-initor.tsx b/web/app/components/swr-initor.tsx index 8f9c5b4e05..9e0e4f98c9 100644 --- a/web/app/components/swr-initor.tsx +++ b/web/app/components/swr-initor.tsx @@ -11,15 +11,17 @@ import { } from '@/app/education-apply/constants' type SwrInitorProps = { - children: ReactNode + children: ReactNode; } -const SwrInitor = ({ - children, -}: SwrInitorProps) => { +const SwrInitor = ({ children }: SwrInitorProps) => { const router = useRouter() const searchParams = useSearchParams() - const consoleToken = decodeURIComponent(searchParams.get('access_token') || '') - const refreshToken = decodeURIComponent(searchParams.get('refresh_token') || '') + const consoleToken = decodeURIComponent( + searchParams.get('access_token') || '', + ) + const refreshToken = decodeURIComponent( + searchParams.get('refresh_token') || '', + ) const consoleTokenFromLocalStorage = localStorage?.getItem('console_token') const refreshTokenFromLocalStorage = localStorage?.getItem('refresh_token') const pathname = usePathname() @@ -27,8 +29,7 @@ const SwrInitor = ({ const isSetupFinished = useCallback(async () => { try { - if (localStorage.getItem('setup_status') === 'finished') - return true + if (localStorage.getItem('setup_status') === 'finished') return true const setUpStatus = await fetchSetupStatus() if (setUpStatus.step !== 'finished') { localStorage.removeItem('setup_status') @@ -37,7 +38,7 @@ const SwrInitor = ({ localStorage.setItem('setup_status', 'finished') return true } - catch (error) { + catch (error) { console.error(error) return false } @@ -56,11 +57,19 @@ const SwrInitor = ({ router.replace('/install') return } - if (!((consoleToken && refreshToken) || (consoleTokenFromLocalStorage && refreshTokenFromLocalStorage))) { + if ( + !( + (consoleToken && refreshToken) + || (consoleTokenFromLocalStorage && refreshTokenFromLocalStorage) + ) + ) { router.replace('/signin') return } - if (searchParams.has('access_token') || searchParams.has('refresh_token')) { + if ( + searchParams.has('access_token') + || searchParams.has('refresh_token') + ) { consoleToken && localStorage.setItem('console_token', consoleToken) refreshToken && localStorage.setItem('refresh_token', refreshToken) router.replace(pathname) @@ -68,22 +77,31 @@ const SwrInitor = ({ setInit(true) } - catch { + catch { router.replace('/signin') } })() - }, [isSetupFinished, router, pathname, searchParams, consoleToken, refreshToken, consoleTokenFromLocalStorage, refreshTokenFromLocalStorage]) + }, [ + isSetupFinished, + router, + pathname, + searchParams, + consoleToken, + refreshToken, + consoleTokenFromLocalStorage, + refreshTokenFromLocalStorage, + ]) - return init - ? ( - - {children} - - ) - : null + }} + > + {children} + + ) : null } export default SwrInitor diff --git a/web/app/components/with-i18n.tsx b/web/app/components/with-i18n.tsx index b06024d51c..12cd152789 100644 --- a/web/app/components/with-i18n.tsx +++ b/web/app/components/with-i18n.tsx @@ -5,15 +5,13 @@ import { useContext } from 'use-context-selector' import I18NContext from '@/context/i18n' export type II18NHocProps = { - children: ReactNode + children: ReactNode; } const withI18N = (Component: any) => { return (props: any) => { const { i18n } = useContext(I18NContext) - return ( - - ) + return } } diff --git a/web/app/dev-only/layout.tsx b/web/app/dev-only/layout.tsx index d8bcc5e679..336644d79e 100644 --- a/web/app/dev-only/layout.tsx +++ b/web/app/dev-only/layout.tsx @@ -2,8 +2,7 @@ import type React from 'react' import { notFound } from 'next/navigation' export default async function Layout({ children }: React.PropsWithChildren) { - if (process.env.NODE_ENV !== 'development') - notFound() + if (process.env.NODE_ENV !== 'development') notFound() return children } diff --git a/web/app/dev-preview/page.tsx b/web/app/dev-preview/page.tsx index 69464d612a..f1f701fedc 100644 --- a/web/app/dev-preview/page.tsx +++ b/web/app/dev-preview/page.tsx @@ -4,7 +4,7 @@ import DemoForm from '../components/base/form/form-scenarios/demo' export default function Page() { return ( -
+
) diff --git a/web/app/education-apply/education-apply-page.tsx b/web/app/education-apply/education-apply-page.tsx index 3925695895..4604598c33 100644 --- a/web/app/education-apply/education-apply-page.tsx +++ b/web/app/education-apply/education-apply-page.tsx @@ -1,14 +1,9 @@ 'use client' -import { - useState, -} from 'react' +import { useState } from 'react' import { useTranslation } from 'react-i18next' import { RiExternalLinkLine } from '@remixicon/react' -import { - useRouter, - useSearchParams, -} from 'next/navigation' +import { useRouter, useSearchParams } from 'next/navigation' import UserInfo from './user-info' import SearchInput from './search-input' import RoleSelector from './role-selector' @@ -31,11 +26,12 @@ const EducationApplyAge = () => { const [role, setRole] = useState('Student') const [ageChecked, setAgeChecked] = useState(false) const [inSchoolChecked, setInSchoolChecked] = useState(false) - const { - isPending, - mutateAsync: educationAdd, - } = useEducationAdd({ onSuccess: noop }) - const [modalShow, setShowModal] = useState void }>(undefined) + const { isPending, mutateAsync: educationAdd } = useEducationAdd({ + onSuccess: noop, + }) + const [modalShow, setShowModal] = useState< + undefined | { title: string; desc: string; onConfirm?: () => void } + >(undefined) const { onPlanInfoChanged } = useProviderContext() const updateEducationStatus = useInvalidateEducationStatus() const { notify } = useToastContext() @@ -65,7 +61,7 @@ const EducationApplyAge = () => { onConfirm: handleModalConfirm, }) } - else { + else { notify({ type: 'error', message: t('education.submitError'), @@ -75,71 +71,82 @@ const EducationApplyAge = () => { } return ( -
-
+
+
+ >
+
+
-
- -
-
-
-
{t('education.toVerified')}
-
+
+
+
+ {t('education.toVerified')} +
+
{t('education.toVerifiedTip.front')}  - {t('education.toVerifiedTip.coupon')}  + + {t('education.toVerifiedTip.coupon')} + +   {t('education.toVerifiedTip.end')}
-
+
-
-
+
+
{t('education.form.schoolName.title')}
- +
-
-
+
+
{t('education.form.schoolRole.title')}
- +
-
-
+
+
{t('education.form.terms.title')}
-
+
{t('education.form.terms.desc.front')}  - {t('education.form.terms.desc.termsOfService')}  + + {t('education.form.terms.desc.termsOfService')} + +   {t('education.form.terms.desc.and')}  - {t('education.form.terms.desc.privacyPolicy')} + + {t('education.form.terms.desc.privacyPolicy')} + {t('education.form.terms.desc.end')}
-
-
+
+
setAgeChecked(!ageChecked)} /> {t('education.form.terms.option.age')}
-
+
setInSchoolChecked(!inSchoolChecked)} /> @@ -148,20 +155,26 @@ const EducationApplyAge = () => {
-
+
{t('education.learn')} - +
diff --git a/web/app/education-apply/role-selector.tsx b/web/app/education-apply/role-selector.tsx index b8448a0052..34fe41ed80 100644 --- a/web/app/education-apply/role-selector.tsx +++ b/web/app/education-apply/role-selector.tsx @@ -2,14 +2,11 @@ import { useTranslation } from 'react-i18next' import cn from '@/utils/classnames' type RoleSelectorProps = { - onChange: (value: string) => void - value: string + onChange: (value: string) => void; + value: string; } -const RoleSelector = ({ - onChange, - value, -}: RoleSelectorProps) => { +const RoleSelector = ({ onChange, value }: RoleSelectorProps) => { const { t } = useTranslation() const options = [ { @@ -27,25 +24,23 @@ const RoleSelector = ({ ] return ( -
- { - options.map(option => ( +
+ {options.map(option => ( +
onChange(option.key)} + >
onChange(option.key)} - > -
-
- {option.value} -
- )) - } + className={cn( + 'mr-2 h-4 w-4 rounded-full border border-components-radio-border bg-components-radio-bg shadow-xs', + option.key === value + && 'border-[5px] border-components-radio-border-checked ', + )} + >
+ {option.value} +
+ ))}
) } diff --git a/web/app/education-apply/search-input.tsx b/web/app/education-apply/search-input.tsx index 63a393b326..aeeaa0f65a 100644 --- a/web/app/education-apply/search-input.tsx +++ b/web/app/education-apply/search-input.tsx @@ -1,9 +1,5 @@ import type { ChangeEventHandler } from 'react' -import { - useCallback, - useRef, - useState, -} from 'react' +import { useCallback, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { useEducation } from './hooks' import Input from '@/app/components/base/input' @@ -14,13 +10,10 @@ import { } from '@/app/components/base/portal-to-follow-elem' type SearchInputProps = { - value?: string - onChange: (value: string) => void + value?: string; + onChange: (value: string) => void; } -const SearchInput = ({ - value, - onChange, -}: SearchInputProps) => { +const SearchInput = ({ value, onChange }: SearchInputProps) => { const { t } = useTranslation() const [open, setOpen] = useState(false) const { @@ -33,87 +26,92 @@ const SearchInput = ({ const pageRef = useRef(0) const valueRef = useRef(value) - const handleSearch = useCallback((debounced?: boolean) => { - const keywords = valueRef.current - const page = pageRef.current - if (debounced) { - querySchoolsWithDebounced({ + const handleSearch = useCallback( + (debounced?: boolean) => { + const keywords = valueRef.current + const page = pageRef.current + if (debounced) { + querySchoolsWithDebounced({ + keywords, + page, + }) + return + } + + handleUpdateSchools({ keywords, page, }) - return - } - - handleUpdateSchools({ - keywords, - page, - }) - }, [querySchoolsWithDebounced, handleUpdateSchools]) + }, + [querySchoolsWithDebounced, handleUpdateSchools], + ) - const handleValueChange: ChangeEventHandler = useCallback((e) => { - setOpen(true) - setSchools([]) - pageRef.current = 0 - const inputValue = e.target.value - valueRef.current = inputValue - onChange(inputValue) - handleSearch(true) - }, [onChange, handleSearch, setSchools]) + const handleValueChange: ChangeEventHandler = useCallback( + (e) => { + setOpen(true) + setSchools([]) + pageRef.current = 0 + const inputValue = e.target.value + valueRef.current = inputValue + onChange(inputValue) + handleSearch(true) + }, + [onChange, handleSearch, setSchools], + ) - const handleScroll = useCallback((e: Event) => { - const target = e.target as HTMLDivElement - const { - scrollTop, - scrollHeight, - clientHeight, - } = target - if (scrollTop + clientHeight >= scrollHeight - 5 && scrollTop > 0 && hasNext) { - pageRef.current += 1 - handleSearch() - } - }, [handleSearch, hasNext]) + const handleScroll = useCallback( + (e: Event) => { + const target = e.target as HTMLDivElement + const { scrollTop, scrollHeight, clientHeight } = target + if ( + scrollTop + clientHeight >= scrollHeight - 5 + && scrollTop > 0 + && hasNext + ) { + pageRef.current += 1 + handleSearch() + } + }, + [handleSearch, hasNext], + ) return ( - + - - { - !!schools.length && value && ( -
- { - schools.map((school, index) => ( -
{ - onChange(school) - setOpen(false) - }} - > - {school} -
- )) - } -
- ) - } + + {!!schools.length && value && ( +
+ {schools.map((school, index) => ( +
{ + onChange(school) + setOpen(false) + }} + > + {school} +
+ ))} +
+ )}
) diff --git a/web/app/education-apply/user-info.tsx b/web/app/education-apply/user-info.tsx index e1d60a5e94..5ead0e0924 100644 --- a/web/app/education-apply/user-info.tsx +++ b/web/app/education-apply/user-info.tsx @@ -25,33 +25,30 @@ const UserInfo = () => { } return ( -
-
-
+
+
+
{t('education.currentSigned')}
- +
-
+
-
-
+
+
{userProfile.name}
-
+
{userProfile.email}
-
diff --git a/web/app/education-apply/verify-state-modal.tsx b/web/app/education-apply/verify-state-modal.tsx index 2ea2fe5bae..43df3cb360 100644 --- a/web/app/education-apply/verify-state-modal.tsx +++ b/web/app/education-apply/verify-state-modal.tsx @@ -1,22 +1,20 @@ import React, { useEffect, useRef, useState } from 'react' import { createPortal } from 'react-dom' import { useTranslation } from 'react-i18next' -import { - RiExternalLinkLine, -} from '@remixicon/react' +import { RiExternalLinkLine } from '@remixicon/react' import Button from '@/app/components/base/button' import { useDocLink } from '@/context/i18n' export type IConfirm = { - className?: string - isShow: boolean - title: string - content?: React.ReactNode - onConfirm: () => void - onCancel: () => void - maskClosable?: boolean - email?: string - showLink?: boolean + className?: string; + isShow: boolean; + title: string; + content?: React.ReactNode; + onConfirm: () => void; + onCancel: () => void; + maskClosable?: boolean; + email?: string; + showLink?: boolean; } function Confirm({ @@ -41,8 +39,7 @@ function Confirm({ useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === 'Escape') - onCancel() + if (event.key === 'Escape') onCancel() } document.addEventListener('keydown', handleKeyDown) @@ -52,7 +49,11 @@ function Confirm({ }, [onCancel]) const handleClickOutside = (event: MouseEvent) => { - if (maskClosable && dialogRef.current && !dialogRef.current.contains(event.target as Node)) + if ( + maskClosable + && dialogRef.current + && !dialogRef.current.contains(event.target as Node) + ) onCancel() } @@ -67,48 +68,69 @@ function Confirm({ if (isShow) { setIsVisible(true) } - else { + else { const timer = setTimeout(() => setIsVisible(false), 200) return () => clearTimeout(timer) } }, [isShow]) - if (!isVisible) - return null + if (!isVisible) return null return createPortal( -
{ e.preventDefault() e.stopPropagation() }} > -
-
-
-
{title}
-
{content}
+
+
+
+
{title}
+
+ {content} +
{email && ( -
-
{t('education.emailLabel')}
-
{email}
+
+
+ {t('education.emailLabel')} +
+
+ {email} +
)} -
-
+
+ - +
-
, document.body, +
, + document.body, ) } diff --git a/web/app/forgot-password/ChangePasswordForm.tsx b/web/app/forgot-password/ChangePasswordForm.tsx index 1ab56102f7..5a40b93975 100644 --- a/web/app/forgot-password/ChangePasswordForm.tsx +++ b/web/app/forgot-password/ChangePasswordForm.tsx @@ -8,7 +8,10 @@ import cn from 'classnames' import { CheckCircleIcon } from '@heroicons/react/24/solid' import Input from '../components/base/input' import Button from '@/app/components/base/button' -import { changePasswordWithToken, verifyForgotPasswordToken } from '@/service/common' +import { + changePasswordWithToken, + verifyForgotPasswordToken, +} from '@/service/common' import Toast from '@/app/components/base/toast' import Loading from '@/app/components/base/loading' @@ -23,9 +26,13 @@ const ChangePasswordForm = () => { url: '/forgot-password/validity', body: { token }, } - const { data: verifyTokenRes, mutate: revalidateToken } = useSWR(verifyTokenParams, verifyForgotPasswordToken, { - revalidateOnFocus: false, - }) + const { data: verifyTokenRes, mutate: revalidateToken } = useSWR( + verifyTokenParams, + verifyForgotPasswordToken, + { + revalidateOnFocus: false, + }, + ) const [password, setPassword] = useState('') const [confirmPassword, setConfirmPassword] = useState('') @@ -57,8 +64,7 @@ const ChangePasswordForm = () => { const handleChangePassword = useCallback(async () => { const token = searchParams.get('token') || '' - if (!valid()) - return + if (!valid()) return try { await changePasswordWithToken({ url: '/forgot-password/resets', @@ -70,40 +76,44 @@ const ChangePasswordForm = () => { }) setShowSuccess(true) } - catch { + catch { await revalidateToken() } }, [confirmPassword, password, revalidateToken, searchParams, valid]) return ( -
+ )} + > {!verifyTokenRes && } {verifyTokenRes && !verifyTokenRes.is_valid && (
-
🤷‍♂️
-

{t('login.invalid')}

+
+ 🤷‍♂️ +
+

+ {t('login.invalid')} +

)} {verifyTokenRes && verifyTokenRes.is_valid && !showSuccess && ( -
+

{t('login.changePassword')}

-

+

{t('login.changePasswordTip')}

@@ -111,38 +121,46 @@ const ChangePasswordForm = () => {
{/* Password */} -
-