Name | w32lex JSON |
Version |
1.0.8
JSON |
| download |
home_page | None |
Summary | Equivalent shlex module for the Win32 world |
upload_time | 2024-10-26 09:38:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.0 |
license | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
keywords |
argument-parser
split
python
python3
win32
splitter
shlex
lexer-parser
argument-parsing
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
w32lex
======
This package contains a pure Python 3 implementation of `split`, `join` and
`quote` functions similar to those found in the builtin `shlex.py` module, but
suitable for the Windows world.
It was tested against optimum [mslex](https://github.com/smoofra/mslex) project (v.1.2.0) and it
gives mostly the same results (but with no regexes used), with a difference: CommandLineToArgvW
(and parse_cmdline from VC run-time) parser and CMD parser/tokenizer are implemented in
distintct functions.
At a glance, a compatible modern Win32 parser follows such rules when splitting a command line:
- leading and trailing spaces are stripped from command line
- unquoted whitespace separates arguments
- quotes:
* `"` opens a block
* `""` opens and closes a block;
* `"""` opens, adds a literal `"` and closes a block
- backslashes, only if followed by `"`:
* `2n -> n`, and opens/closes a block
* `(2n+1) -> n`, and adds a literal `"`
- all other characters are simply copied.
`split` accepts an optional argument `mode` to set the compatibility level:
- with mode=SPLIT_SHELL32 (default), it behaves like standard Windows parser (SHELL32);
- with mode=SPLIT_ARGV0, first argument is parsed in a simplified way (i.e. argument is
everything up to the first space if unquoted, or the second quote otherwise);
- with mode=SPLIT_VC2005, it emulates parse_cmdline from 2005 onwards (a `""` inside a
quoted block emit a literal quote _without_ ending such block).
To parse the line like CMD does, separate functions `cmd_split` and
`cmd_parse` are provided, with a corresponding `cmd_quote`.
`cmd_split` and `cmd_parse` accept a mode argument where further values can be
specified:
- CMD_VAREXPAND to make the parser expand environment `%variables%` in place;
- CMD_EXCLMARK to expand also delayed expansion `!variables!`.
Some annotations about a Windows Command Prompt (CMD) parser follow.
CMD itself parses the command line _before_ invoking commands, in an indipendent
way from `parse_cmdline` (used internally by C apps built by Visual C++
compilers) or CommandLineToArgvW.
With the help of a simple C Windows app, we can look at the command line that
CMD passes to an external command:
```
#include <windows.h>
#pragma comment(linker,"/DEFAULTLIB:USER32.lib")
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
return MessageBox(0, lpCmdLine, "lpCmdLine=", MB_OK);
}
```
or, from the CMD line itself:
```
#include <windows.h>
#pragma comment(linker,"/DEFAULTLIB:USER32.lib")
void main() {
puts(GetCommandLine());
}
```
The results we see, show that the parsing work CMD carries on is not trivial,
not always clear and not constant in time. Some points:
- `:` at line start (the label indicator in batch files) makes the parser ignore
the rest (Windows 2000+) or signal an error;
- one or more ` ;,=@`, _TAB_, vertical TAB, form-feed and 0xFF characters at
line start are ignored but
- a starting `@` is a special character in BAT scripts (=line echo off);
- `a/b` at line start (without white space) is parsed as `a /b` (invoke "a"
command with "/b" option), even if an ".\a\b" command exists - to invoke the
latter, just quote it: `"a/b"`;
- carriage-return character is ignored;
- `|&<>`, and their doubled counterparts (except `<<` which is invalid), are
forbidden at line start;
- empty `()` is forbidden;
- `(command)` with one ore more _balanced_ parenthesis is a valid form;
- `^` escapes the character following; alone at line start, it should be
forbidden (it asks for a second character to escape).
- `"` starts a quoted block, escaping all special characters inside it except
`%` , until another quote, or LF/EOS, is found. Quote belongs to the block
and only the starting quote can be escaped by `^`;
- after a `REM` command, all special symbols are ignored;
- pipe `|`, redirection `<, >, >>`, concatenation `&` and boolean operators `&&, ||`
split a line in subparts, since one or more commands have to be issued; white space
is not needed around them;
- many handle redirections are also permitted, with 0=STDIN, 1=STDOUT, 2=STDERR and
a `&` premitted after the redirection operator (i.e. `2>&1` to redirect STDERR
to STDOUT, or `2>err.log` to copy STDERR to a file);
- longer or different sequences of pipe, redirection, concatenation or boolean
operators are forbidden;
- `%var%` or `^%var%` are replaced with the corresponding environment variable,
if set (while `^%var^%` and `%var^%` are both considered fully escaped);
- all the other characters are simply copied and passed to the external
commands. If the internal ones are targeted, further/different processing could
occur; the same if special CMD environment variables are set. For example,
`SET A =B` sets a variable named `A ` (included the 3 blanks); `FOR` assigns
special meaning to single quotes inside parenthesis; `REM` ignores subsequent
tokens.
Some curious samples:
- `&a [b (c ;d !e %f ^g ,h =i` are valid file system names
- `^ a` calls " a" (Windows 2000+) or ignores the line
- `^;;a` calls ";" passing argument ";a" (Windows 2000+; the same with `,=` characters) or ignores the line
- given a `;d` file (the same with `,h` and `=i`):
* `dir;d` -> not found
* `dir ;d` -> not found
* `dir ^;d` -> not found
* `dir ";d"` -> OK
* `dir "?d"` -> OK
- `dir ^>b` -> lists `[b` file above (!?), but using our simple Windows app we
find that `>b` was passed literally, as expected;
- `dir 1>^&2` is as valid as `dir 1>&2`.
Things get even more complex if we take in account old DOS COMMAND.COM:
- a starting `@` outside BAT files is forbidden;
- `^` is not recognized;
- only a single `;,=` at line start is ignored;
- `:` at line start is ignored (Windows 95+) or is bad;
- `&, &&, ||` operators and parentheses `()` are not recognized;
- numeric handles redirection and delayed expansion is unsupported, also.
A sample assembly program to play with old DOS command line:
```
; compile with NASM PRL.ASM -o PRL.COM
org 100h
bits 16
; DS:0000 PSP seg preloaded by DOS
; DS:0080 command-line length (following)
cmp byte [80h], 0
jnz GO
int 20h ; terminate COM
GO:
mov di, 80h
PRINT:
inc di
mov dl, [ds:di]
cmp dl, 0Dh
jz END
mov ah, 2 ; write char in DL to STDOUT
int 21h
jmp PRINT
END:
int 20h
```
Raw data
{
"_id": null,
"home_page": null,
"name": "w32lex",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": null,
"keywords": "argument-parser, split, python, python3, win32, splitter, shlex, lexer-parser, argument-parsing",
"author": null,
"author_email": "maxpat78 <maxpat78@yahoo.it>",
"download_url": "https://files.pythonhosted.org/packages/57/68/c93def5a869960a64d7b8217da029c31ff0ad003bd85f92e0cc3f05504ac/w32lex-1.0.8.tar.gz",
"platform": null,
"description": "w32lex\n======\n\nThis package contains a pure Python 3 implementation of `split`, `join` and\n`quote` functions similar to those found in the builtin `shlex.py` module, but\nsuitable for the Windows world.\n\nIt was tested against optimum [mslex](https://github.com/smoofra/mslex) project (v.1.2.0) and it\ngives mostly the same results (but with no regexes used), with a difference: CommandLineToArgvW\n(and parse_cmdline from VC run-time) parser and CMD parser/tokenizer are implemented in\ndistintct functions.\n\nAt a glance, a compatible modern Win32 parser follows such rules when splitting a command line:\n- leading and trailing spaces are stripped from command line\n- unquoted whitespace separates arguments\n- quotes:\n * `\"` opens a block\n * `\"\"` opens and closes a block;\n * `\"\"\"` opens, adds a literal `\"` and closes a block\n- backslashes, only if followed by `\"`:\n * `2n -> n`, and opens/closes a block\n * `(2n+1) -> n`, and adds a literal `\"`\n- all other characters are simply copied.\n\n`split` accepts an optional argument `mode` to set the compatibility level:\n- with mode=SPLIT_SHELL32 (default), it behaves like standard Windows parser (SHELL32);\n- with mode=SPLIT_ARGV0, first argument is parsed in a simplified way (i.e. argument is\neverything up to the first space if unquoted, or the second quote otherwise);\n- with mode=SPLIT_VC2005, it emulates parse_cmdline from 2005 onwards (a `\"\"` inside a\nquoted block emit a literal quote _without_ ending such block).\n\nTo parse the line like CMD does, separate functions `cmd_split` and\n`cmd_parse` are provided, with a corresponding `cmd_quote`.\n\n`cmd_split` and `cmd_parse` accept a mode argument where further values can be\nspecified:\n- CMD_VAREXPAND to make the parser expand environment `%variables%` in place;\n- CMD_EXCLMARK to expand also delayed expansion `!variables!`.\n\nSome annotations about a Windows Command Prompt (CMD) parser follow.\n\nCMD itself parses the command line _before_ invoking commands, in an indipendent\nway from `parse_cmdline` (used internally by C apps built by Visual C++\ncompilers) or CommandLineToArgvW.\n\nWith the help of a simple C Windows app, we can look at the command line that \nCMD passes to an external command:\n```\n#include <windows.h>\n#pragma comment(linker,\"/DEFAULTLIB:USER32.lib\")\nint WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)\n{\n return MessageBox(0, lpCmdLine, \"lpCmdLine=\", MB_OK);\n}\n```\nor, from the CMD line itself:\n```\n#include <windows.h>\n#pragma comment(linker,\"/DEFAULTLIB:USER32.lib\")\nvoid main() {\n puts(GetCommandLine());\n}\n```\n\nThe results we see, show that the parsing work CMD carries on is not trivial,\nnot always clear and not constant in time. Some points:\n\n- `:` at line start (the label indicator in batch files) makes the parser ignore\nthe rest (Windows 2000+) or signal an error;\n- one or more ` ;,=@`, _TAB_, vertical TAB, form-feed and 0xFF characters at\nline start are ignored but\n- a starting `@` is a special character in BAT scripts (=line echo off);\n- `a/b` at line start (without white space) is parsed as `a /b` (invoke \"a\"\ncommand with \"/b\" option), even if an \".\\a\\b\" command exists - to invoke the\nlatter, just quote it: `\"a/b\"`;\n- carriage-return character is ignored;\n- `|&<>`, and their doubled counterparts (except `<<` which is invalid), are\nforbidden at line start;\n- empty `()` is forbidden;\n- `(command)` with one ore more _balanced_ parenthesis is a valid form;\n- `^` escapes the character following; alone at line start, it should be\nforbidden (it asks for a second character to escape).\n- `\"` starts a quoted block, escaping all special characters inside it except\n`%` , until another quote, or LF/EOS, is found. Quote belongs to the block\nand only the starting quote can be escaped by `^`;\n- after a `REM` command, all special symbols are ignored;\n- pipe `|`, redirection `<, >, >>`, concatenation `&` and boolean operators `&&, ||`\nsplit a line in subparts, since one or more commands have to be issued; white space\nis not needed around them;\n- many handle redirections are also permitted, with 0=STDIN, 1=STDOUT, 2=STDERR and\na `&` premitted after the redirection operator (i.e. `2>&1` to redirect STDERR\nto STDOUT, or `2>err.log` to copy STDERR to a file);\n- longer or different sequences of pipe, redirection, concatenation or boolean\noperators are forbidden;\n- `%var%` or `^%var%` are replaced with the corresponding environment variable,\nif set (while `^%var^%` and `%var^%` are both considered fully escaped);\n- all the other characters are simply copied and passed to the external\ncommands. If the internal ones are targeted, further/different processing could\noccur; the same if special CMD environment variables are set. For example,\n`SET A =B` sets a variable named `A ` (included the 3 blanks); `FOR` assigns\nspecial meaning to single quotes inside parenthesis; `REM` ignores subsequent\ntokens.\n \n\nSome curious samples:\n- `&a [b (c ;d !e %f ^g ,h =i` are valid file system names\n- `^ a` calls \" a\" (Windows 2000+) or ignores the line\n- `^;;a` calls \";\" passing argument \";a\" (Windows 2000+; the same with `,=` characters) or ignores the line\n- given a `;d` file (the same with `,h` and `=i`):\n * `dir;d` -> not found\n * `dir ;d` -> not found\n * `dir ^;d` -> not found\n * `dir \";d\"` -> OK\n * `dir \"?d\"` -> OK\n- `dir ^>b` -> lists `[b` file above (!?), but using our simple Windows app we\nfind that `>b` was passed literally, as expected;\n- `dir 1>^&2` is as valid as `dir 1>&2`.\n\nThings get even more complex if we take in account old DOS COMMAND.COM:\n- a starting `@` outside BAT files is forbidden;\n- `^` is not recognized;\n- only a single `;,=` at line start is ignored;\n- `:` at line start is ignored (Windows 95+) or is bad;\n- `&, &&, ||` operators and parentheses `()` are not recognized;\n- numeric handles redirection and delayed expansion is unsupported, also.\n\nA sample assembly program to play with old DOS command line:\n```\n; compile with NASM PRL.ASM -o PRL.COM\norg 100h\nbits 16\n\n; DS:0000 PSP seg preloaded by DOS\n; DS:0080 command-line length (following)\ncmp byte [80h], 0\njnz GO\nint 20h ; terminate COM\nGO:\nmov di, 80h\nPRINT:\ninc di\nmov dl, [ds:di]\ncmp dl, 0Dh\njz END\nmov ah, 2 ; write char in DL to STDOUT\nint 21h\njmp PRINT\nEND:\nint 20h\n```\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License. \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\" \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
"summary": "Equivalent shlex module for the Win32 world",
"version": "1.0.8",
"project_urls": {
"Homepage": "https://github.com/maxpat78/w32lex",
"Source": "https://github.com/maxpat78/w32lex"
},
"split_keywords": [
"argument-parser",
" split",
" python",
" python3",
" win32",
" splitter",
" shlex",
" lexer-parser",
" argument-parsing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "056e36f4afe819f081a4bf60b30aac463b189b7191fe652e2f14e3d16bd839af",
"md5": "818de1a3535b0cb47335cd4bc0dd2279",
"sha256": "9a95804801605fae1fa5a76acfc0c08811833920544fc40d2ca62eae1738cbaf"
},
"downloads": -1,
"filename": "w32lex-1.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "818de1a3535b0cb47335cd4bc0dd2279",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0",
"size": 15599,
"upload_time": "2024-10-26T09:37:59",
"upload_time_iso_8601": "2024-10-26T09:37:59.321788Z",
"url": "https://files.pythonhosted.org/packages/05/6e/36f4afe819f081a4bf60b30aac463b189b7191fe652e2f14e3d16bd839af/w32lex-1.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5768c93def5a869960a64d7b8217da029c31ff0ad003bd85f92e0cc3f05504ac",
"md5": "4504228842ce9aadb05fbabc896436e0",
"sha256": "3257ab2b3cf98b68bec33edb02556ef831969d6959960a17a90e0f3ffb92f36c"
},
"downloads": -1,
"filename": "w32lex-1.0.8.tar.gz",
"has_sig": false,
"md5_digest": "4504228842ce9aadb05fbabc896436e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0",
"size": 20272,
"upload_time": "2024-10-26T09:38:00",
"upload_time_iso_8601": "2024-10-26T09:38:00.747679Z",
"url": "https://files.pythonhosted.org/packages/57/68/c93def5a869960a64d7b8217da029c31ff0ad003bd85f92e0cc3f05504ac/w32lex-1.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-26 09:38:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maxpat78",
"github_project": "w32lex",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "w32lex"
}