Python function list parser

Berikut adalah konfigurasi notepad++ agar dapat menampilkan daftar fungsi pada FunctionList. Ini akan mempermudah membaca source code python tentunya. 😀

Buka file functionList.xml (gunakan selain editor notepad++), biasanya terdapat di direktori: %appdata%\Notepad++\ kemudian tambahkan/sisipkan baris2 berikut diantara node <parser> :

<parser id="py_function" displayName="Python class" commentExpr="(#.*?$|'''.*?('''|\Z))">
    <classRange mainExpr="(?<=^class ).*?(?=\n\S|\Z)">
        <className>
            <nameExpr expr="\w+(?=[\(|:])"/>
        </className>
        <function mainExpr="(?<=def ).+?(?=:)">
            <functionName>
                <funcNameExpr expr=".*"/>
            </functionName>
        </function>
    </classRange>
    <function mainExpr="(?<=def ).+?(?=:)">
        <functionName>
            <funcNameExpr expr=".*"/>
        </functionName>
    </function>
</parser>

lalu tambahakan/sisipkan baris berikut diantara node <associationMap> :

<association langID="22" id="py_function"/>

Simpan. Jalankan notepad++ dan buka file berekstensi *.py. Tada !!!

Src: http://sourceforge.net/p/notepad-plus/discussion/482781/thread/515001cd/

Advertisements
Python function list parser

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s