| Server IP : 93.115.150.27 / Your IP : 216.73.216.221 Web Server : LiteSpeed System : Linux host2.azar.host 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 User : dorfakkh ( 1797) PHP Version : 8.1.34 Disable Function : show_source, system, passthru, exec, popen, proc_open, mail MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/usr/lib/python3.6/site-packages/__pycache__/ |
Upload File : |
3
���]�$ � @ s� d Z ddlZddlZddlZdZdZddd�ZG dd� de�ZG d d
� d
e �Z
G dd� de �ZG d
d� de �Ze
dkr�ddlZejej Zejed�Zee� ejejdk� dS )a@
asciidocapi - AsciiDoc API wrapper class.
The AsciiDocAPI class provides an API for executing asciidoc. Minimal example
compiles `mydoc.txt` to `mydoc.html`:
import asciidocapi
asciidoc = asciidocapi.AsciiDocAPI()
asciidoc.execute('mydoc.txt')
- Full documentation in asciidocapi.txt.
- See the doctests below for more examples.
Doctests:
1. Check execution:
>>> import io
>>> infile = io.StringIO('Hello *{author}*')
>>> outfile = io.StringIO()
>>> asciidoc = AsciiDocAPI()
>>> asciidoc.options('--no-header-footer')
>>> asciidoc.attributes['author'] = 'Joe Bloggs'
>>> asciidoc.execute(infile, outfile, backend='html4')
>>> print(outfile.getvalue())
<p>Hello <strong>Joe Bloggs</strong></p>
>>> asciidoc.attributes['author'] = 'Bill Smith'
>>> infile = io.StringIO('Hello _{author}_')
>>> outfile = io.StringIO()
>>> asciidoc.execute(infile, outfile, backend='docbook')
>>> print(outfile.getvalue())
<simpara>Hello <emphasis>Bill Smith</emphasis></simpara>
2. Check error handling:
>>> import io
>>> asciidoc = AsciiDocAPI()
>>> infile = io.StringIO('---------')
>>> outfile = io.StringIO()
>>> asciidoc.execute(infile, outfile)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "asciidocapi.py", line 189, in execute
raise AsciiDocError(self.messages[-1])
AsciiDocError: ERROR: <stdin>: line 1: [blockdef-listing] missing closing delimiter
Copyright (C) 2009 Stuart Rackham. Free use of this software is granted
under the terms of the GNU General Public License (GPL).
� Nz0.1.2z8.4.1c C sR |dkrt jjdd�}x6|jt j�D ]"}t jj|| �}t jj|�r$|S q$W dS dS )z=
Find file fname in paths. Return None if not found.
N�PATH� )�os�environ�get�split�pathsep�path�join�isfile)�fnamer �dirZfpath� r �!/usr/lib/python3.6/asciidocapi.py�find_in_path<