Coding style.
- Tools should return a status and a text string, not a status and a fill3 widget.
This commit is contained in:
parent
8eff1d5a0f
commit
9b5ad3332e
25 changed files with 246 additions and 243 deletions
|
|
@ -114,7 +114,7 @@ def _run_command(command, success_status=None, error_status=None,
|
|||
error_status = Status.problem if error_status is None else error_status
|
||||
stdout, stderr, returncode = _do_command(command, timeout=timeout)
|
||||
result_status = success_status if returncode == 0 else error_status
|
||||
return result_status, fill3.Text(stdout + stderr)
|
||||
return result_status, (stdout + stderr)
|
||||
|
||||
|
||||
def deps(**kwargs):
|
||||
|
|
@ -150,8 +150,9 @@ def _syntax_highlight(text, lexer, style):
|
|||
"", [termstr.TermStr(text, _char_style_for_token_type(
|
||||
token_type, default_bg_color, default_style))
|
||||
for token_type, text in pygments.lex(text, lexer)])
|
||||
return fill3.Text(text, pad_char=termstr.TermStr(" ").bg_color(
|
||||
text_widget = fill3.Text(text, pad_char=termstr.TermStr(" ").bg_color(
|
||||
default_bg_color))
|
||||
return fill3.join("\n", text_widget.text)
|
||||
|
||||
|
||||
def _syntax_highlight_using_path(text, path):
|
||||
|
|
@ -230,7 +231,7 @@ def metadata(path):
|
|||
name = termstr.TermStr(name + ":").fg_color(
|
||||
termstr.Color.blue).ljust(16)
|
||||
text.append(name + fill3.join("", value) + "\n")
|
||||
return (Status.normal, fill3.Text(fill3.join("", text)))
|
||||
return (Status.normal, fill3.join("", text))
|
||||
|
||||
|
||||
@deps(deps={"pip/pygments"}, url="python3-pygments")
|
||||
|
|
@ -239,13 +240,13 @@ def contents(path):
|
|||
try:
|
||||
text = file_.read()
|
||||
except UnicodeDecodeError:
|
||||
return Status.not_applicable, fill3.Text("Not unicode")
|
||||
return Status.not_applicable, "Not unicode"
|
||||
text = _fix_input(text)
|
||||
try:
|
||||
text_widget = _syntax_highlight_using_path(text, path)
|
||||
text = _syntax_highlight_using_path(text, path)
|
||||
except pygments.util.ClassNotFound:
|
||||
text_widget = fill3.Text(text)
|
||||
return Status.normal, text_widget
|
||||
pass
|
||||
return Status.normal, text
|
||||
|
||||
|
||||
@deps(url="https://en.wikipedia.org/wiki/Python_syntax_and_semantics")
|
||||
|
|
@ -258,7 +259,7 @@ def python_syntax(path):
|
|||
is_correct = False
|
||||
else:
|
||||
is_correct = True
|
||||
return (Status.ok if is_correct else Status.problem), fill3.Text("")
|
||||
return (Status.ok if is_correct else Status.problem), ""
|
||||
|
||||
|
||||
def _has_shebang_line(path):
|
||||
|
|
@ -278,9 +279,9 @@ def python_unittests(path):
|
|||
else [PYTHON_EXECUTABLE, path])
|
||||
stdout, stderr, returncode = _do_command(command, timeout=TIMEOUT)
|
||||
status = Status.ok if returncode == 0 else Status.problem
|
||||
return status, fill3.Text(stdout + "\n" + stderr)
|
||||
return status, (stdout + "\n" + stderr)
|
||||
else:
|
||||
return Status.not_applicable, fill3.Text("No tests.")
|
||||
return Status.not_applicable, "No tests."
|
||||
|
||||
|
||||
@deps(url="https://docs.python.org/3/library/pydoc.html")
|
||||
|
|
@ -291,7 +292,7 @@ def pydoc(path):
|
|||
if not stdout.startswith("Help on module"):
|
||||
status = Status.not_applicable
|
||||
stdout = stdout.replace(os.getcwd() + "/", "")
|
||||
return status, fill3.Text(_fix_input(stdout))
|
||||
return status, _fix_input(stdout)
|
||||
|
||||
|
||||
@deps(deps={"pip/mypy"}, url="http://mypy-lang.org/", executables={"mypy"})
|
||||
|
|
@ -300,7 +301,7 @@ def mypy(path):
|
|||
[PYTHON_EXECUTABLE, "-m", "mypy", "--ignore-missing-imports", path],
|
||||
timeout=TIMEOUT)
|
||||
status = Status.ok if returncode == 0 else Status.problem
|
||||
return status, fill3.Text(stdout)
|
||||
return status, stdout
|
||||
|
||||
|
||||
def _colorize_coverage_report(text):
|
||||
|
|
@ -329,10 +330,10 @@ def python_coverage(path):
|
|||
flat_path = path.replace("/", "_")
|
||||
with open(os.path.join(temp_dir, flat_path + ",cover"), "r") as f:
|
||||
stdout = f.read()
|
||||
return Status.normal, fill3.Text(_colorize_coverage_report(stdout))
|
||||
return Status.normal, _colorize_coverage_report(stdout)
|
||||
else:
|
||||
return Status.not_applicable, fill3.Text(
|
||||
"No corresponding test file: " + os.path.normpath(test_path))
|
||||
return Status.not_applicable, ("No corresponding test file: "
|
||||
+ os.path.normpath(test_path))
|
||||
|
||||
|
||||
@deps(url="https://github.com/ahamilton/eris/blob/master/gut.py")
|
||||
|
|
@ -363,7 +364,7 @@ def python_mccabe(path):
|
|||
max_score = max(_get_mccabe_line_score(line)
|
||||
for line in stdout.splitlines())
|
||||
status = Status.problem if max_score > 10 else Status.ok
|
||||
return status, fill3.Text(_colorize_mccabe(stdout))
|
||||
return status, _colorize_mccabe(stdout)
|
||||
|
||||
|
||||
# FIX: Reenable when pydisasm is not causing problems
|
||||
|
|
@ -381,15 +382,15 @@ def bandit(path):
|
|||
timeout=TIMEOUT)
|
||||
status = Status.ok if returncode == 0 else Status.problem
|
||||
text_without_timestamp = "".join(stdout.splitlines(keepends=True)[2:])
|
||||
return status, fill3.Text(text_without_timestamp)
|
||||
return status, text_without_timestamp
|
||||
|
||||
|
||||
@deps(deps={"perl-doc"}, url="http://perldoc.perl.org/",
|
||||
executables={"perldoc"})
|
||||
def perldoc(path):
|
||||
stdout, stderr, returncode = _do_command(["perldoc", "-t", path])
|
||||
return ((Status.normal, fill3.Text(stdout)) if returncode == 0
|
||||
else (Status.not_applicable, fill3.Text(stderr)))
|
||||
return ((Status.normal, stdout) if returncode == 0
|
||||
else (Status.not_applicable, stderr))
|
||||
|
||||
|
||||
@deps(deps={"perltidy"}, url="http://perltidy.sourceforge.net/",
|
||||
|
|
@ -407,8 +408,7 @@ def git_blame(path):
|
|||
"--color-by-age", path], text=True, capture_output=True)
|
||||
status = (Status.normal if process.returncode == 0
|
||||
else Status.not_applicable)
|
||||
return status, fill3.Text(termstr.TermStr.from_term(
|
||||
process.stdout + process.stderr))
|
||||
return status, termstr.TermStr.from_term(process.stdout + process.stderr)
|
||||
|
||||
|
||||
@deps(deps={"git"}, url="https://git-scm.com/docs/git-log",
|
||||
|
|
@ -419,8 +419,7 @@ def git_log(path):
|
|||
capture_output=True)
|
||||
status = (Status.normal if process.returncode == 0
|
||||
else Status.not_applicable)
|
||||
return status, fill3.Text(termstr.TermStr.from_term(
|
||||
process.stdout + process.stderr))
|
||||
return status, termstr.TermStr.from_term(process.stdout + process.stderr)
|
||||
|
||||
|
||||
@deps(deps={"tidy"}, url="tidy", executables={"tidy"})
|
||||
|
|
@ -428,7 +427,7 @@ def html_syntax(path):
|
|||
# Maybe only show errors
|
||||
stdout, stderr, returncode = _do_command(["tidy", path])
|
||||
status = Status.ok if returncode == 0 else Status.problem
|
||||
return status, fill3.Text(stderr)
|
||||
return status, stderr
|
||||
|
||||
|
||||
MAX_IMAGE_SIZE = 200
|
||||
|
|
@ -449,7 +448,7 @@ def _image_to_text(image):
|
|||
for row_index in range(image.height)]
|
||||
if image.height % 2 == 1:
|
||||
rows.append([None] * image.width)
|
||||
return fill3.Fixed([
|
||||
return fill3.join("\n", [
|
||||
termstr.TermStr(text, tuple(termstr.CharStyle(
|
||||
fg_color=top_pixel, bg_color=bottom_pixel)
|
||||
for top_pixel, bottom_pixel in zip(rows[index],
|
||||
|
|
@ -484,7 +483,7 @@ def godoc(path):
|
|||
os.symlink(os.path.abspath(path), symlink_path)
|
||||
stdout, stderr, returncode = _do_command(["godoc", "."], cwd=temp_dir)
|
||||
os.remove(symlink_path)
|
||||
return Status.normal, fill3.Text(stdout)
|
||||
return Status.normal, stdout
|
||||
|
||||
|
||||
def make_tool_function(dependencies, command, url=None, success_status=None,
|
||||
|
|
@ -695,9 +694,9 @@ def run_tool_no_error(path, tool):
|
|||
try:
|
||||
status, result = tool(path)
|
||||
except subprocess.TimeoutExpired:
|
||||
status, result = Status.timed_out, fill3.Text("Timed out")
|
||||
status, result = Status.timed_out, "Timed out"
|
||||
except UnicodeDecodeError:
|
||||
status, result = Status.not_applicable, fill3.Text("Result not in UTF-8")
|
||||
status, result = Status.not_applicable, "Result not in UTF-8"
|
||||
except:
|
||||
status, result = Status.error, _syntax_highlight(
|
||||
traceback.format_exc(), pygments.lexers.PythonTracebackLexer(),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import asyncio
|
|||
import os
|
||||
import signal
|
||||
|
||||
import eris.fill3 as fill3
|
||||
import eris.tools as tools
|
||||
|
||||
|
||||
|
|
@ -86,7 +87,8 @@ def main():
|
|||
tool_name, path = input(), input()
|
||||
tool = getattr(tools, tool_name)
|
||||
result = tools.Result(path, tool)
|
||||
status, result.result = tools.run_tool_no_error(path, tool)
|
||||
status, text = tools.run_tool_no_error(path, tool)
|
||||
result.result = fill3.Text(text)
|
||||
print(status.value, flush=True)
|
||||
except:
|
||||
tools.log_error()
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
Test results:
|
||||
No issues identified.
|
||||
|
||||
Code scanned:
|
||||
Total lines of code: 2
|
||||
Test results:
|
||||
No issues identified.
|
||||
|
||||
Code scanned:
|
||||
Total lines of code: 2
|
||||
Total lines skipped (#nosec): 0
|
||||
|
||||
Run metrics:
|
||||
Total issues (by severity):
|
||||
Undefined: 0.0
|
||||
Low: 0.0
|
||||
Medium: 0.0
|
||||
High: 0.0
|
||||
Total issues (by confidence):
|
||||
Undefined: 0.0
|
||||
Low: 0.0
|
||||
Medium: 0.0
|
||||
High: 0.0
|
||||
Files skipped (0):
|
||||
|
||||
Run metrics:
|
||||
Total issues (by severity):
|
||||
Undefined: 0.0
|
||||
Low: 0.0
|
||||
Medium: 0.0
|
||||
High: 0.0
|
||||
Total issues (by confidence):
|
||||
Undefined: 0.0
|
||||
Low: 0.0
|
||||
Medium: 0.0
|
||||
High: 0.0
|
||||
Files skipped (0):
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
hello
|
||||
hello
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
|
||||
line 2 column 3 - Warning: inserting missing 'title' element
|
||||
Info: Document content looks like HTML5
|
||||
Tidy found 2 warnings and 0 errors!
|
||||
|
||||
|
||||
About HTML Tidy: https://github.com/htacg/tidy-html5
|
||||
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
|
||||
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
|
||||
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
|
||||
Validate your HTML documents: http://validator.w3.org/nu/
|
||||
Lobby your company to join the W3C: http://www.w3.org/Consortium
|
||||
|
||||
Do you speak a language other than English, or a different variant of
|
||||
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
|
||||
line 2 column 3 - Warning: inserting missing 'title' element
|
||||
Info: Document content looks like HTML5
|
||||
Tidy found 2 warnings and 0 errors!
|
||||
|
||||
|
||||
About HTML Tidy: https://github.com/htacg/tidy-html5
|
||||
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
|
||||
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
|
||||
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
|
||||
Validate your HTML documents: http://validator.w3.org/nu/
|
||||
Lobby your company to join the W3C: http://www.w3.org/Consortium
|
||||
|
||||
Do you speak a language other than English, or a different variant of
|
||||
English? Consider helping us to localize HTML Tidy. For details please see
|
||||
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md
|
||||
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
[m[38;2;0;135;189m[48;2;0;0;0msize:[m[38;2;255;255;255m[48;2;0;0;0m 12.0 B[m[38;2;100;100;100m[48;2;0;0;0m (12 bytes)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mpermissions:[m[38;2;255;255;255m[48;2;0;0;0m ?rwxr-xr-x[m[38;2;100;100;100m[48;2;0;0;0m (755)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0msize:[m[38;2;255;255;255m[48;2;0;0;0m 12.0 B[m[38;2;100;100;100m[48;2;0;0;0m (12 bytes)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mpermissions:[m[38;2;255;255;255m[48;2;0;0;0m ?rwxr-xr-x[m[38;2;100;100;100m[48;2;0;0;0m (755)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mmodified time:[m[38;2;255;255;255m[48;2;0;0;0m Sun Jan 31 23:14:05 2016[m[38;2;100;100;100m[48;2;0;0;0m (1454282045 secs)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mcreation time:[m[38;2;255;255;255m[48;2;0;0;0m Sun Jan 31 23:14:05 2016[m[38;2;100;100;100m[48;2;0;0;0m (1454282045 secs)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;135;189m[48;2;0;0;0maccess time:[m[38;2;255;255;255m[48;2;0;0;0m Sun Jan 31 23:14:07 2016[m[38;2;100;100;100m[48;2;0;0;0m (1454282047 secs)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mowner:[m[38;2;255;255;255m[48;2;0;0;0m foo[m[38;2;100;100;100m[48;2;0;0;0m (1111 uid)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mgroup:[m[38;2;255;255;255m[48;2;0;0;0m foo[m[38;2;100;100;100m[48;2;0;0;0m (1111 gid)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mhardlinks:[m[38;2;255;255;255m[48;2;0;0;0m 2
|
||||
[m[38;2;0;135;189m[48;2;0;0;0msymlink:[m[38;2;255;255;255m[48;2;0;0;0m no
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mmime type:[m[38;2;255;255;255m[48;2;0;0;0m text/x-python; charset=us-ascii
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mfile type:[m[38;2;255;255;255m[48;2;0;0;0m Python script, ASCII text executable [m
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mowner:[m[38;2;255;255;255m[48;2;0;0;0m foo[m[38;2;100;100;100m[48;2;0;0;0m (1111 uid)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mgroup:[m[38;2;255;255;255m[48;2;0;0;0m foo[m[38;2;100;100;100m[48;2;0;0;0m (1111 gid)[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mhardlinks:[m[38;2;255;255;255m[48;2;0;0;0m 2
|
||||
[m[38;2;0;135;189m[48;2;0;0;0msymlink:[m[38;2;255;255;255m[48;2;0;0;0m no
|
||||
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mmime type:[m[38;2;255;255;255m[48;2;0;0;0m text/x-python; charset=us-ascii
|
||||
[m[38;2;0;135;189m[48;2;0;0;0mfile type:[m[38;2;255;255;255m[48;2;0;0;0m Python script, ASCII text executable
|
||||
[m
|
||||
|
|
@ -1 +1 @@
|
|||
00000000 D _LIB_VERSION
|
||||
00000000 D _LIB_VERSION
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
nm: ./input/libpcprofile.so: no symbols
|
||||
nm: ./input/libpcprofile.so: no symbols
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
./input/Mcrt1.o: file format elf32-i386
|
||||
|
||||
|
||||
./input/Mcrt1.o: file format elf32-i386
|
||||
|
||||
objdump: ./input/Mcrt1.o: not a dynamic object
|
||||
objdump: ./input/Mcrt1.o: invalid operation
|
||||
objdump: ./input/Mcrt1.o: invalid operation
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
|
||||
./input/Mcrt1.o: file format elf32-i386
|
||||
./input/Mcrt1.o
|
||||
architecture: i386, flags 0x00000000:
|
||||
|
||||
start address 0x00000000
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .text 00000000 00000000 00000000 00000034 2**0
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
1 .data 00000000 00000000 00000000 00000034 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
2 .bss 00000000 00000000 00000000 00000034 2**0
|
||||
ALLOC
|
||||
|
||||
./input/Mcrt1.o: file format elf32-i386
|
||||
./input/Mcrt1.o
|
||||
architecture: i386, flags 0x00000000:
|
||||
|
||||
start address 0x00000000
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .text 00000000 00000000 00000000 00000034 2**0
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
1 .data 00000000 00000000 00000000 00000034 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
2 .bss 00000000 00000000 00000000 00000034 2**0
|
||||
ALLOC
|
||||
3 .note.GNU-stack 00000000 00000000 00000000 00000034 2**0
|
||||
CONTENTS, READONLY
|
||||
4 .gnu_debuglink 0000000c 00000000 00000000 00000034 2**0
|
||||
CONTENTS, READONLY
|
||||
SYMBOL TABLE:
|
||||
no symbols
|
||||
|
||||
|
||||
CONTENTS, READONLY
|
||||
4 .gnu_debuglink 0000000c 00000000 00000000 00000034 2**0
|
||||
CONTENTS, READONLY
|
||||
SYMBOL TABLE:
|
||||
no symbols
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Cover Page
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
|
|
@ -1 +1 @@
|
|||
./input/perl.pl syntax OK
|
||||
./input/perl.pl syntax OK
|
||||
|
|
|
|||
|
|
@ -1,70 +1,70 @@
|
|||
Net::Z3950::AsyncZ
|
||||
Intro
|
||||
Net::Z3950::AsyncZ
|
||||
Intro
|
||||
Net::Z3950::AsyncZ adds an additional layer of asynchronous support for
|
||||
the Z3950 module through the use of multiple forked processes. I hope
|
||||
that users will also find that it provides a convenient front end to
|
||||
the Z3950 module through the use of multiple forked processes. I hope
|
||||
that users will also find that it provides a convenient front end to
|
||||
"Net::Z3950". My initial idea was to write something that would provide
|
||||
a convenient means of processing and formatting Z39.50 records--which I
|
||||
did, using the "Z3950" synchronous code. But I also wanted something
|
||||
that could handle queries to large numbers of servers at one session.
|
||||
did, using the "Z3950" synchronous code. But I also wanted something
|
||||
that could handle queries to large numbers of servers at one session.
|
||||
Working on this part of my project, I found that I had trouble with the
|
||||
"Z3950" asynchronous features and so ended up with what I have here.
|
||||
|
||||
I give a more detailed account in in the DESCRIPTION section of
|
||||
"AsyncZ.pod".
|
||||
|
||||
Documentation
|
||||
AsyncZ.pod
|
||||
This is the starting point--it gives an overview of the AsyncZ
|
||||
"Z3950" asynchronous features and so ended up with what I have here.
|
||||
|
||||
I give a more detailed account in in the DESCRIPTION section of
|
||||
"AsyncZ.pod".
|
||||
|
||||
Documentation
|
||||
AsyncZ.pod
|
||||
This is the starting point--it gives an overview of the AsyncZ
|
||||
module, describes the basic mechanics of its asynchronous workings,
|
||||
and details the particulars of the objects and methods. But see
|
||||
""Examples.pod" for detailed explanations of the sample scripts
|
||||
which come with the "Net::Z3950::AsyncZ" distribution.
|
||||
|
||||
Options.pod
|
||||
and details the particulars of the objects and methods. But see
|
||||
""Examples.pod" for detailed explanations of the sample scripts
|
||||
which come with the "Net::Z3950::AsyncZ" distribution.
|
||||
|
||||
Options.pod
|
||||
This document details the various options that can be set to modify
|
||||
the behavior of AsyncZ Index
|
||||
|
||||
Report.pod
|
||||
Report.pod deals with how records are treated line by line and how
|
||||
you can affect the apearance of a record's line by line output
|
||||
|
||||
Examples.pod
|
||||
This document goes through the sample scripts that come with the
|
||||
"Net::Z3950::AsyncZ" distribution and annotates them in a
|
||||
line-by-line fashion. It's a basic HOW-TO.
|
||||
|
||||
The Modules
|
||||
the behavior of AsyncZ Index
|
||||
|
||||
Report.pod
|
||||
Report.pod deals with how records are treated line by line and how
|
||||
you can affect the apearance of a record's line by line output
|
||||
|
||||
Examples.pod
|
||||
This document goes through the sample scripts that come with the
|
||||
"Net::Z3950::AsyncZ" distribution and annotates them in a
|
||||
line-by-line fashion. It's a basic HOW-TO.
|
||||
|
||||
The Modules
|
||||
There are more modules than there is documentation. The reason for this
|
||||
is that the only module you have full and complete access to is
|
||||
"Net::Z3950::AsyncZ". The other modules are either internal to
|
||||
"Net::AsyncZ" or accessed indirectly or in part indirectly.
|
||||
|
||||
Here are the modules:
|
||||
Net::Z3950::AsyncZ
|
||||
The main module: direct access --documented in "AsyncZ" and
|
||||
"Options" documentation
|
||||
|
||||
Net::Z3950::AsyncZ::ErrMsg
|
||||
User error message handling: indirect access -- documented in
|
||||
"AsyncZ" documentation
|
||||
|
||||
Net::Z3950::AsyncZ::Errors
|
||||
Error handling for debugging: limited access -- documented in
|
||||
"AsyncZ" documentation
|
||||
|
||||
Net::Z3950::AsyncZ::Report
|
||||
Module reponsible for fetching and formatting records: limited
|
||||
access -- documented
|
||||
|
||||
Net::Z3950::AsyncZ::ZLoop
|
||||
Event loop for child processes: no access -- not documented
|
||||
|
||||
Net::Z3950::AsyncZ::ZSend
|
||||
is that the only module you have full and complete access to is
|
||||
"Net::Z3950::AsyncZ". The other modules are either internal to
|
||||
"Net::AsyncZ" or accessed indirectly or in part indirectly.
|
||||
|
||||
Here are the modules:
|
||||
Net::Z3950::AsyncZ
|
||||
The main module: direct access --documented in "AsyncZ" and
|
||||
"Options" documentation
|
||||
|
||||
Net::Z3950::AsyncZ::ErrMsg
|
||||
User error message handling: indirect access -- documented in
|
||||
"AsyncZ" documentation
|
||||
|
||||
Net::Z3950::AsyncZ::Errors
|
||||
Error handling for debugging: limited access -- documented in
|
||||
"AsyncZ" documentation
|
||||
|
||||
Net::Z3950::AsyncZ::Report
|
||||
Module reponsible for fetching and formatting records: limited
|
||||
access -- documented
|
||||
|
||||
Net::Z3950::AsyncZ::ZLoop
|
||||
Event loop for child processes: no access -- not documented
|
||||
|
||||
Net::Z3950::AsyncZ::ZSend
|
||||
Connection details for child processes: no access -- not documented
|
||||
|
||||
Net::Z3950::AsyncZ::Options::_params
|
||||
Options for child processes: direct and indirect access --
|
||||
documented in "Options" and "AsyncZ" documentation
|
||||
|
||||
INDEX
|
||||
|
||||
Net::Z3950::AsyncZ::Options::_params
|
||||
Options for child processes: direct and indirect access --
|
||||
documented in "Options" and "AsyncZ" documentation
|
||||
|
||||
INDEX
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
No documentation found for "./input/perl.pl".
|
||||
No documentation found for "./input/perl.pl".
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
No syntax errors detected in ./input/root.php
|
||||
No syntax errors detected in ./input/root.php
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
Help on module hi3:
|
||||
|
||||
NAME
|
||||
hi3
|
||||
|
||||
FUNCTIONS
|
||||
hi()
|
||||
|
||||
FILE
|
||||
input/hi3.py
|
||||
|
||||
|
||||
|
||||
NAME
|
||||
hi3
|
||||
|
||||
FUNCTIONS
|
||||
hi()
|
||||
|
||||
FILE
|
||||
input/hi3.py
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;159;107m[48;2;0;0;0m> def hi():[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
[m[38;2;0;159;107m[48;2;0;0;0m> print("hi")[m
|
||||
[m[38;2;255;255;255m[48;2;0;0;0m
|
||||
|
||||
[m[38;2;0;159;107m[48;2;0;0;0m> def hi():
|
||||
> print("hi")
|
||||
[m
|
||||
|
|
@ -1 +1 @@
|
|||
3:0: 'hi' 1
|
||||
3:0: 'hi' 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
Name File
|
||||
---- ----
|
||||
m __main__ ./input/hi3.py
|
||||
|
||||
Name File
|
||||
---- ----
|
||||
m __main__ ./input/hi3.py
|
||||
|
|
|
|||
|
|
@ -1,47 +1,47 @@
|
|||
ELF Header:
|
||||
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
|
||||
Class: ELF32
|
||||
Data: 2's complement, little endian
|
||||
Version: 1 (current)
|
||||
OS/ABI: UNIX - System V
|
||||
ABI Version: 0
|
||||
Type: REL (Relocatable file)
|
||||
Machine: Intel 80386
|
||||
Version: 0x1
|
||||
Entry point address: 0x0
|
||||
Start of program headers: 0 (bytes into file)
|
||||
Start of section headers: 124 (bytes into file)
|
||||
Flags: 0x0
|
||||
Size of this header: 52 (bytes)
|
||||
Size of program headers: 0 (bytes)
|
||||
Number of program headers: 0
|
||||
Size of section headers: 40 (bytes)
|
||||
Number of section headers: 7
|
||||
Section header string table index: 6
|
||||
|
||||
Section Headers:
|
||||
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
|
||||
[ 0] NULL 00000000 000000 000000 00 0 0 0
|
||||
[ 1] .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
|
||||
[ 2] .data PROGBITS 00000000 000034 000000 00 WA 0 0 1
|
||||
[ 3] .bss NOBITS 00000000 000034 000000 00 WA 0 0 1
|
||||
[ 4] .note.GNU-stack PROGBITS 00000000 000034 000000 00 0 0 1
|
||||
[ 5] .gnu_debuglink PROGBITS 00000000 000034 00000c 00 0 0 1
|
||||
[ 6] .shstrtab STRTAB 00000000 000040 00003b 00 0 0 1
|
||||
Key to Flags:
|
||||
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
|
||||
L (link order), O (extra OS processing required), G (group), T (TLS),
|
||||
C (compressed), x (unknown), o (OS specific), E (exclude),
|
||||
p (processor specific)
|
||||
|
||||
There are no section groups in this file.
|
||||
|
||||
There are no program headers in this file.
|
||||
|
||||
There is no dynamic section in this file.
|
||||
|
||||
There are no relocations in this file.
|
||||
|
||||
ELF Header:
|
||||
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
|
||||
Class: ELF32
|
||||
Data: 2's complement, little endian
|
||||
Version: 1 (current)
|
||||
OS/ABI: UNIX - System V
|
||||
ABI Version: 0
|
||||
Type: REL (Relocatable file)
|
||||
Machine: Intel 80386
|
||||
Version: 0x1
|
||||
Entry point address: 0x0
|
||||
Start of program headers: 0 (bytes into file)
|
||||
Start of section headers: 124 (bytes into file)
|
||||
Flags: 0x0
|
||||
Size of this header: 52 (bytes)
|
||||
Size of program headers: 0 (bytes)
|
||||
Number of program headers: 0
|
||||
Size of section headers: 40 (bytes)
|
||||
Number of section headers: 7
|
||||
Section header string table index: 6
|
||||
|
||||
Section Headers:
|
||||
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
|
||||
[ 0] NULL 00000000 000000 000000 00 0 0 0
|
||||
[ 1] .text PROGBITS 00000000 000034 000000 00 AX 0 0 1
|
||||
[ 2] .data PROGBITS 00000000 000034 000000 00 WA 0 0 1
|
||||
[ 3] .bss NOBITS 00000000 000034 000000 00 WA 0 0 1
|
||||
[ 4] .note.GNU-stack PROGBITS 00000000 000034 000000 00 0 0 1
|
||||
[ 5] .gnu_debuglink PROGBITS 00000000 000034 00000c 00 0 0 1
|
||||
[ 6] .shstrtab STRTAB 00000000 000040 00003b 00 0 0 1
|
||||
Key to Flags:
|
||||
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
|
||||
L (link order), O (extra OS processing required), G (group), T (TLS),
|
||||
C (compressed), x (unknown), o (OS specific), E (exclude),
|
||||
p (processor specific)
|
||||
|
||||
There are no section groups in this file.
|
||||
|
||||
There are no program headers in this file.
|
||||
|
||||
There is no dynamic section in this file.
|
||||
|
||||
There are no relocations in this file.
|
||||
|
||||
The decoding of unwind sections for machine type Intel 80386 is not currently supported.
|
||||
|
||||
No version information found in this file.
|
||||
|
||||
No version information found in this file.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py
|
||||
-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py
|
||||
-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py
|
||||
-rw-rw-r-- ahamilton/ahamilton 27 2016-02-09 21:50 hi.py
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Archive: ./input/hi.zip
|
||||
Zip file size: 187 bytes, number of entries: 1
|
||||
Archive: ./input/hi.zip
|
||||
Zip file size: 187 bytes, number of entries: 1
|
||||
-rw-rw-r-- 3.0 unx 27 tx stor 16-Feb-09 21:50 hi.py
|
||||
1 file, 27 bytes uncompressed, 27 bytes compressed: 0.0%
|
||||
1 file, 27 bytes uncompressed, 27 bytes compressed: 0.0%
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ToolsTestCase(unittest.TestCase):
|
|||
with self.subTest(input_filename=input_filename):
|
||||
status, result = run_tool(tool, input_filename)
|
||||
golden_path = result_path(tool, input_filename)
|
||||
golden.assertGolden(widget_to_string(result), golden_path)
|
||||
golden.assertGolden(str(result), golden_path)
|
||||
self.assertEqual(status, expected_status)
|
||||
|
||||
def test_metadata(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue