mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-14 05:26:28 +00:00
Fixed command line history saving problems
This commit is contained in:
parent
3cc97accfc
commit
31dd1be090
@ -455,14 +455,17 @@ class Legacy(BaseMode, component.Component):
|
|||||||
#If both are under maximum, it's first, otherwise it's the one not full
|
#If both are under maximum, it's first, otherwise it's the one not full
|
||||||
if self._hf_lines[0] < MAX_HISTFILE_SIZE and self._hf_lines[1] < MAX_HISTFILE_SIZE:
|
if self._hf_lines[0] < MAX_HISTFILE_SIZE and self._hf_lines[1] < MAX_HISTFILE_SIZE:
|
||||||
active_file = 0
|
active_file = 0
|
||||||
if self._hf_lines[0] > self._hf_lines[1]:
|
elif self._hf_lines[0] == MAX_HISTFILE_SIZE:
|
||||||
active_file = 1
|
active_file = 1
|
||||||
else:
|
else:
|
||||||
active_file = 0
|
active_file = 0
|
||||||
|
|
||||||
#Write the line
|
#Write the line
|
||||||
f = open(self.history_file[active_file], 'a')
|
f = open(self.history_file[active_file], 'a')
|
||||||
f.write( text + os.linesep )
|
|
||||||
|
f.write( text.encode('utf-8') )
|
||||||
|
|
||||||
|
f.write( os.linesep )
|
||||||
|
|
||||||
#And increment line counter
|
#And increment line counter
|
||||||
self._hf_lines[active_file] += 1
|
self._hf_lines[active_file] += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user