⚝
One Hat Cyber Team
⚝
Your IP:
160.79.111.20
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
lib64
/
python2.7
/
Tools
/
scripts
/
Edit File: ptags.py
#! /usr/bin/python2.7 # ptags # # Create a tags file for Python programs, usable with vi. # Tagged are: # - functions (even inside other defs or classes) # - classes # - filenames # Warns about files it cannot open. # No warnings about duplicate tags. import sys, re, os tags = [] # Modified global variable! def main(): args = sys.argv[1:] for filename in args: treat_file(filename) if tags: fp = open('tags', 'w') tags.sort() for s in tags: fp.write(s) expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:\(]' matcher = re.compile(expr) def treat_file(filename): try: fp = open(filename, 'r') except: sys.stderr.write('Cannot open %s\n' % filename) return base = os.path.basename(filename) if base[-3:] == '.py': base = base[:-3] s = base + '\t' + filename + '\t' + '1\n' tags.append(s) while 1: line = fp.readline() if not line: break m = matcher.match(line) if m: content = m.group(0) name = m.group(2) s = name + '\t' + filename + '\t/^' + content + '/\n' tags.append(s) if __name__ == '__main__': main()
Simpan