File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 2
2
# -*- coding: utf8 -*-
3
3
4
4
import pysvn
5
- import time
6
5
import locale
7
6
import os
8
7
import shutil
9
8
import json
10
9
from config import *
11
10
import subprocess
11
+ import sys
12
+ import time
13
+ from datetime import datetime
12
14
13
15
def get_login (realm , username , may_save ):
14
16
return True , Config .username , Config .password , True
@@ -43,8 +45,8 @@ def svn_update(project,target_version):
43
45
print_log ('update ' + project .get_name () + ' error:' + str (err ));
44
46
45
47
def print_log (msg ):
46
- now = time .strftime ( "%Y-%m-%d %H:%M:%S" );
47
- date = time .strftime ('%Y-%m -%d' );
48
+ dt = time .localtime ( );
49
+ now = time .strftime ('%Y-%M -%d %H:%m:%S' , time . localtime () );
48
50
try :
49
51
if not os .path .exists (Config .log_dir ):
50
52
os .makedirs (Config .log_dir );
@@ -128,9 +130,11 @@ def copy_to_dist(project):
128
130
print_log ('copy project ' + project_name + ' distribution to ' + dist_dir + ' error: ' + str (err ));
129
131
130
132
def run_shell_scripts (scripts ):
133
+ reload (sys );
134
+ sys .setdefaultencoding ('utf-8' );
131
135
p = subprocess .Popen (scripts ,shell = True ,stdout = subprocess .PIPE );
132
- out = p .communicate ();
133
- print_log (out );
136
+ out , err = p .communicate ();
137
+ print_log (out . decode ( 'gbk' ) );
134
138
if (p .returncode != 0 ):
135
139
raise Exception ('run "' + scripts + '" error! Exit code is ' + str (p .returncode ));
136
140
print_log ('run "' + scripts + '" successfully!' );
You can’t perform that action at this time.
0 commit comments