Skip to content

Commit 3b425b7

Browse files
committed
Several changes
- Fix improper log path - More beautiful name for REFRESH feature
1 parent 2e32856 commit 3b425b7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

bugzilla/_mi.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
log = logging.getLogger(bugzilla.__name__)
5353

5454
DEFAULT_BZ_LOG = os.getenv("__BUGZILLA_LOG_FILE") or os.path.join(
55-
os.path.abspath(__file__), datetime.datetime.now().strftime("../BZMI%y%m%d%H%M%S.log"))
55+
os.path.dirname(os.path.abspath(__file__)),
56+
datetime.datetime.now().strftime("../BZMI%y%m%d%H%M%S.log"))
5657

5758
FHEAD_PRE = "\n|v>"
5859
FHEAD_SUF = "<v|\n"
@@ -527,7 +528,7 @@ def _main(unittest_bz_instance):
527528
# init argparser & logger
528529
setup_logging()
529530
parser = setup_parser()
530-
refresh = False
531+
bz_REFRESH = False
531532

532533
# main loop
533534
while True:
@@ -539,7 +540,7 @@ def _main(unittest_bz_instance):
539540
try:
540541
NewCmd = sreadl().strip()
541542
if (NewCmd == "__REFRESH__"):
542-
refresh = True
543+
bz_REFRESH = True
543544
continue
544545
NewOpt = parser.parse_args(NewCmd.split())
545546
except InterruptLoop:
@@ -552,8 +553,8 @@ def _main(unittest_bz_instance):
552553
if unittest_bz_instance:
553554
bz = unittest_bz_instance
554555
else:
555-
bz = _make_bz_instance(NewOpt, force_new=refresh)
556-
refresh = False
556+
bz = _make_bz_instance(NewOpt, force_new=bz_REFRESH)
557+
bz_REFRESH = False
557558

558559
try:
559560
# Handle login options
@@ -605,7 +606,7 @@ def _main(unittest_bz_instance):
605606
swrite(FLAG_HEAD_EXCEPT)
606607
swrite("Server error - %s: %s" %(e.__class__.__name__,str(e)))
607608
swrite(FLAG_TAIL_EXCEPT)
608-
refresh = True
609+
bz_REFRESH = True
609610
continue
610611
except requests.exceptions.SSLError as e:
611612
# Give SSL recommendations
@@ -614,7 +615,7 @@ def _main(unittest_bz_instance):
614615
swrite("\nIf you trust the remote server, you can work "
615616
"around this error with `--nosslverify`")
616617
swrite(FLAG_TAIL_EXCEPT)
617-
refresh = True
618+
bz_REFRESH = True
618619
continue
619620
except (socket.error,
620621
requests.exceptions.HTTPError,
@@ -624,7 +625,7 @@ def _main(unittest_bz_instance):
624625
swrite(FLAG_HEAD_EXCEPT)
625626
swrite("Connection lost/failed - %s: %s" %(e.__class__.__name__,str(e)))
626627
swrite(FLAG_TAIL_EXCEPT)
627-
refresh = True
628+
bz_REFRESH = True
628629
continue
629630

630631
def main(unittest_bz_instance=None):

0 commit comments

Comments
 (0)