mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 18:03:31 +01:00
Arguments to --irrelevant-symbols are not meant to be represented in the AST resulting from parsing. Also, add pad() to misc.py. Signed-off-by: Jan Lindemann <jan@janware.com>
17 lines
439 B
Python
17 lines
439 B
Python
import os, errno
|
|
|
|
def silentremove(filename): #export
|
|
try:
|
|
os.remove(filename)
|
|
except OSError as e:
|
|
if e.errno != errno.ENOENT:
|
|
raise # re-raise exception if a different error occurred
|
|
|
|
def pad(token, total_size, right_align = False):
|
|
add = total_size - len(token)
|
|
if add <= 0:
|
|
return token
|
|
space = ' ' * add
|
|
if right_align:
|
|
return space + token
|
|
return token + space
|