38
38
from blinker import signal
39
39
40
40
from nikola .plugin_categories import Command
41
- from nikola .utils import get_logger , remove_file , unicode_str , makedirs , STDERR_HANDLER
41
+ from nikola .utils import get_logger , remove_file , makedirs , STDERR_HANDLER
42
42
43
43
44
44
class CommandDeploy (Command ):
@@ -56,7 +56,7 @@ def _execute(self, command, args):
56
56
self .logger = get_logger ('deploy' , STDERR_HANDLER )
57
57
# Get last successful deploy date
58
58
timestamp_path = os .path .join (self .site .config ['CACHE_FOLDER' ], 'lastdeploy' )
59
-
59
+
60
60
# Get last-deploy from persistent state
61
61
last_deploy = self .site .state .get ('last_deploy' )
62
62
if last_deploy is None :
@@ -65,7 +65,7 @@ def _execute(self, command, args):
65
65
if os .path .isfile (timestamp_path ):
66
66
try :
67
67
with io .open (timestamp_path , 'r' , encoding = 'utf8' ) as inf :
68
- last_deploy = dateutil .parser .parse (last_deploy )
68
+ last_deploy = dateutil .parser .parse (inf . read () )
69
69
clean = False
70
70
except (IOError , Exception ) as e :
71
71
self .logger .debug ("Problem when reading `{0}`: {1}" .format (timestamp_path , e ))
@@ -78,7 +78,7 @@ def _execute(self, command, args):
78
78
else :
79
79
last_deploy = dateutil .parser .parse (last_deploy )
80
80
clean = False
81
-
81
+
82
82
if self .site .config ['COMMENT_SYSTEM_ID' ] == 'nikolademo' :
83
83
self .logger .warn ("\n WARNING WARNING WARNING WARNING\n "
84
84
"You are deploying using the nikolademo Disqus account.\n "
0 commit comments