Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STCC-280 Add "Notes and Credits" Section when converting [MW] #236

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified lib/catroid_class_hierarchy.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions sourcecodefilter/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<classpathentry kind="lib" path="lib/org.eclipse.osgi_3.10.100.v20150529-1857.jar"/>
<classpathentry kind="lib" path="lib/org.eclipse.text_3.5.400.v20150505-1044.jar"/>
<classpathentry kind="lib" path="lib/snakeyaml-1.16.jar"/>
<classpathentry kind="lib" path="/home/lukas/IdeaProjects/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4.jar"/>
<classpathentry kind="lib" path="/home/lukas/IdeaProjects/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4-javadoc.jar"/>
<classpathentry kind="lib" path="/home/lukas/IdeaProjects/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4-jdk14.jar"/>
<classpathentry kind="lib" path="/home/lukas/IdeaProjects/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4-sources.jar"/>
<classpathentry kind="lib" path="/home/martin/Dokumente/ScratchToCatrobat/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4.jar"/>
<classpathentry kind="lib" path="/home/martin/Dokumente/ScratchToCatrobat/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4-javadoc.jar"/>
<classpathentry kind="lib" path="/home/martin/Dokumente/ScratchToCatrobat/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4-jdk14.jar"/>
<classpathentry kind="lib" path="/home/martin/Dokumente/ScratchToCatrobat/ScratchToCatrobat/sourcecodefilter/lib/ini4j-0.5.4-sources.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
2 changes: 2 additions & 0 deletions sourcecodefilter/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ class_to_preserved_methods_mapping:
- getDefaultScene
- getUserVariable
- getUserList
- getNotesAndCredits
- setNotesAndCredits
SoundInfo:
- compareTo
- setTitle
Expand Down
12 changes: 5 additions & 7 deletions sourcecodefilter/src/sourcecodefilter/SourceCodeFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTParser;
Expand All @@ -51,7 +51,6 @@
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.IExtendedModifier;
import org.eclipse.jdt.core.dom.ImportDeclaration;
import org.eclipse.jdt.core.dom.MarkerAnnotation;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.ParameterizedType;
Expand All @@ -60,23 +59,22 @@
import org.eclipse.jdt.core.dom.Statement;
import org.eclipse.jdt.core.dom.Type;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.ini4j.Ini;
import org.ini4j.Wini;
import org.yaml.snakeyaml.Yaml;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

import sourcecodefilter.ConverterRelevantCatroidSource.FilteringProject;
import sourcecodefilter.filter.AssignmentFilter;
import sourcecodefilter.filter.IfElseFilter;
import sourcecodefilter.filter.MethodInvocationFilter;
import sourcecodefilter.filter.VariableDeclarationFilter;
import sourcecodefilter.filter.TryCatchFilter;
import sourcecodefilter.filter.VariableDeclarationFilter;
import sourcecodefilter.inject.InlineClassInjector;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

class ExitCode {
public static final int FAILURE = 1;
public static final int SUCCESS = 0;
Expand Down
9 changes: 5 additions & 4 deletions src/scratchtocatrobat/converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1806,20 +1806,21 @@ def _update_xml_header(xml_header, scratch_project_id, program_name, scratch_pro
xml_header.setRemixParentsUrlString(helpers.config.get("SCRATCH_API", "project_base_url") + scratch_project_id)

sep_line = "\n" + "-" * 40 + "\n"
description = sep_line
description = ""

try:
if scratch_project_instructions is not None:
description += "Instructions:\n" + scratch_project_instructions + sep_line
description += scratch_project_instructions + sep_line
except:
# TODO: FIX ASCII issue!!
pass

try:
if scratch_project_notes_and_credits is not None:
description += "Description:\n" + scratch_project_notes_and_credits + sep_line
xml_header.setNotesAndCredits(scratch_project_notes_and_credits)
except:
# TODO: FIX ASCII issue!!
pass
# TODO: FIX ASCII issue!!

description += "\nMade with {} version {}.\nOriginal Scratch project => {}".format( \
helpers.application_info("name"), \
Expand Down