#include "generator.h"

#include <iostream>
#include <fstream>

using namespace Mugen;

CharacterGenerator::CharacterGenerator(const std::string & filename):
filename(filename){
}

CharacterGenerator::~CharacterGenerator(){
}

void CharacterGenerator::output(const std::string & file){
    Mugen::PythonStream out;
    out.open(file);
    out << "import mugen" << PythonStream::endl;
    out <<  "class TestCharacter(mugen.Character):" << PythonStream::endl;
        out << PythonStream::indent;
        out << "def __init__(self):" << PythonStream::endl;
            out << PythonStream::indent;
            out << "self.setName('TestCharacter')" << PythonStream::endl;
    out.clearIndents();
    out << "char = TestCharacter()" << PythonStream::endl;
    out << "print char.name" << PythonStream::endl;
    out.close();
}
#include "generator.h"

#include <iostream>
#include <fstream>

using namespace Mugen;

CharacterGenerator::CharacterGenerator(const std::string & filename):
filename(filename){
}

CharacterGenerator::~CharacterGenerator(){
}

void CharacterGenerator::output(const std::string & file){
    Mugen::PythonStream out;
    out.open(file);
    out << "import mugen" << PythonStream::endl;
    out <<  "class TestCharacter(mugen.Character):" << PythonStream::endl;
    out << PythonStream::indent;
    out << "def __init__(self):" << PythonStream::endl;
    out << PythonStream::indent;
    out << "self.setName('TestCharacter')" << PythonStream::endl;
    out.clearIndents();
    out << "char = TestCharacter()" << PythonStream::endl;
    out << "print char.name" << PythonStream::endl;
    out.close();
}
--- 
+++ 
@@ -17,10 +17,10 @@
     out.open(file);
     out << "import mugen" << PythonStream::endl;
     out <<  "class TestCharacter(mugen.Character):" << PythonStream::endl;
-    out << PythonStream::indent;
-    out << "def __init__(self):" << PythonStream::endl;
-    out << PythonStream::indent;
-    out << "self.setName('TestCharacter')" << PythonStream::endl;
+        out << PythonStream::indent;
+        out << "def __init__(self):" << PythonStream::endl;
+            out << PythonStream::indent;
+            out << "self.setName('TestCharacter')" << PythonStream::endl;
     out.clearIndents();
     out << "char = TestCharacter()" << PythonStream::endl;
     out << "print char.name" << PythonStream::endl;
Indent code to more or less visualize the indentation of the outputed python code.

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@5819 662fdd30-d327-0410-a531-f549c87e1e9e
