summaryrefslogtreecommitdiff
path: root/servergreps/hercules/src/preproc.py
blob: 23735c91d0d497d2c3fb12bd02efeee993ebe286 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env python2
# -*- coding: utf8 -*-
#
# Copyright (C) 2015-2016  Evol Online
# Author: Andrei Karas (4144)

import os
import re
import sys
import shutil

class PreProc:
    def init(self, tmpDir):
        if os.path.exists(tmpDir):
            shutil.rmtree(tmpDir)
        os.makedirs(tmpDir)


    def run(self, subDir, outFile):
        os.system(
            "cpp {defines} {includes} {subDir}/{inFile} {outFile}".format(
            defines = self.defines,
            includes = self.includes,
            subDir = self.inDir + subDir,
            inFile = outFile,
            outFile = self.outDir + outFile))