no message
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.Files.FileType;
|
||||
@@ -36,16 +36,16 @@ public class CreateTestFromFile extends Pass<Test> {
|
||||
File file_in = (File) args[0];
|
||||
group = (Group) args[1];
|
||||
//--
|
||||
if (CommonUtils.ContainsCyrillic(file_in.getName()) || CommonUtils.ContainsForbiddenName(file_in.getName())) {
|
||||
Log.Writeln_("Имя файла " + CommonUtils.Brackets(file_in.getName())
|
||||
if (Utils_.ContainsCyrillic(file_in.getName()) || Utils_.ContainsForbiddenName(file_in.getName())) {
|
||||
Log.Writeln_("Имя файла " + Utils_.Brackets(file_in.getName())
|
||||
+ " содержит запрещённые символы " +
|
||||
CommonUtils.printAllForbiddenCharacters() + ", или кириллицу.");
|
||||
Utils_.printAllForbiddenCharacters() + ", или кириллицу.");
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
projectFile = new ProjectFile(file_in);
|
||||
if (!projectFile.fileType.equals(FileType.program) || !projectFile.languageName.equals(group.language)) {
|
||||
Log.Writeln_("Не удалось распознать файл " + CommonUtils.Brackets(file_in.getName()) +
|
||||
Log.Writeln_("Не удалось распознать файл " + Utils_.Brackets(file_in.getName()) +
|
||||
" как программу на языке " + group.language.getDescription());
|
||||
return false;
|
||||
}
|
||||
@@ -54,12 +54,12 @@ public class CreateTestFromFile extends Pass<Test> {
|
||||
target.sender_address = Current.getAccount().email;
|
||||
target.sender_name = Current.getAccount().name;
|
||||
target.group_id = group.id;
|
||||
target.description = CommonUtils.getNameWithoutExtension(file_in.getName());
|
||||
target.description = Utils_.getNameWithoutExtension(file_in.getName());
|
||||
target.files = file_in.getName();
|
||||
return true;
|
||||
}
|
||||
public File packTestCode() throws Exception {
|
||||
target.temp_project_name = CommonUtils.getDateName("test");
|
||||
target.temp_project_name = Utils_.getDateName("test");
|
||||
//-
|
||||
File tempProject = target.getTempProject();
|
||||
File tempArchive = target.getTempArchive();
|
||||
@@ -73,7 +73,7 @@ public class CreateTestFromFile extends Pass<Test> {
|
||||
//--
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
if (zip.Do(tempProject.getAbsolutePath(), tempArchive.getAbsolutePath())) {
|
||||
target.project_archive_bytes = CommonUtils.fileToBytes(tempArchive);
|
||||
target.project_archive_bytes = Utils_.fileToBytes(tempArchive);
|
||||
} else throw new PassException("Не удалось создать архив папки с кодом.");
|
||||
return tempProject;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user