Skip to content

Commit 2216939

Browse files
Add files via upload
1 parent 97c48da commit 2216939

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

pyfoxfile.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,13 @@ def _is_printable(ch):
444444
else:
445445
prescriptpath = get_importing_script_path()
446446
if(prescriptpath is not None):
447-
scriptconf = os.path.join(os.path.dirname(prescriptpath), __use_ini_name__)
447+
if(__use_ini_file__ and not __use_json_file__):
448+
scriptconf = os.path.join(os.path.dirname(prescriptpath), __use_ini_name__)
449+
elif(__use_json_file__ and not __use_ini_file__):
450+
scriptconf = os.path.join(os.path.dirname(prescriptpath), __use_json_name__)
451+
else:
452+
scriptconf = ""
453+
prescriptpath = None
448454
else:
449455
scriptconf = ""
450456
if os.path.exists(scriptconf):
@@ -653,7 +659,7 @@ def _get(section_dict, key, default=None):
653659
__version_date__ = str(__version_date_info__[0]) + "." + str(
654660
__version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2)
655661
__revision__ = __version_info__[3]
656-
__revision_id__ = "$Id: b3e105b0e17ccf3ed667a2e5866398e002080910 $"
662+
__revision_id__ = "$Id$"
657663
if(__version_info__[4] is not None):
658664
__version_date_plusrc__ = __version_date__ + \
659665
"-" + str(__version_date_info__[4])
@@ -1052,6 +1058,14 @@ def to_ns(timestamp):
10521058
# Multiply by 1e9 to get nanoseconds, then cast to int
10531059
return int(seconds * 1000000000)
10541060

1061+
def format_ns_utc(ts_ns, fmt='%Y-%m-%d %H:%M:%S'):
1062+
ts_ns = int(ts_ns)
1063+
sec, ns = divmod(ts_ns, 10**9)
1064+
dt = datetime.datetime.utcfromtimestamp(sec).replace(microsecond=ns // 1000)
1065+
base = dt.strftime(fmt)
1066+
ns_str = "%09d" % ns
1067+
return base + "." + ns_str
1068+
10551069
def _split_posix(name):
10561070
"""
10571071
Return a list of path parts without collapsing '..'.

0 commit comments

Comments
 (0)