python文件问题

dev_sync_trustie
daiao 5 years ago
parent 2983721f36
commit 258c7150ef

@ -264,11 +264,13 @@ class MyshixunsController < ApplicationController
unless @hide_code || (@myshixun.shixun&.vnc_evaluate && params[:evaluate].present?)
# 远程版本库文件内容
last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"]
content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present?
params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格在windows机器上带来的问题
else
params[:content]
end
content =
if python_file?(path)
params[:content].gsub(/\t/, ' ').gsub(/ /, ' ')
else
params[:content]
end
uid_logger_dubug("###11222333####{content}")
uid_logger_dubug("###222333####{last_content}")
@ -374,4 +376,9 @@ class MyshixunsController < ApplicationController
@repo_path = @myshixun.try(:repo_path)
@path = params[:path]
end
def python_file?(path)
false if path.blank?
path.to_s.split(".").last.downcase == "py"
end
end

Loading…
Cancel
Save