Example #1
0
from java.io import File
from java.lang import String
from java.lang import Exception as JException

from org.eclipse.core.resources import ResourcesPlugin, IResource
from org.eclipse.core.runtime import Path
from org.eclipse.jdt.core import JavaCore
from org.eclipse.jdt.core.dom import ASTParser, AST

from org.tmatesoft.svn.core import SVNURL
from org.tmatesoft.svn.core.wc import SVNWCUtil
from org.tmatesoft.svn.core.wc2 import SvnOperationFactory, SvnTarget


app = Flask(__name__, instance_path=os.path.dirname(os.path.abspath(__file__)) + "/instance")
app.config["MAKO_DEFAULT_FILTERS"] = ["h"]
mako = MakoTemplates(app)


def open_project(project):
    project.open(None)

    description = project.description
    description.natureIds = [JavaCore.NATURE_ID]
    project.setDescription(description, None)

    return JavaCore.create(project)


def get_projects(workspace):
    acc = {}
Example #2
0
def log_attach_user_id(sender, **extra):
    UserIdFilter.set_userid(session.get("user_id", "-"))


request_started.connect(log_attach_user_id, app)


# setup templates and haml
from flask.ext.mako import MakoTemplates, _lookup, render_template
import haml

MakoTemplates(app)
app.config["MAKO_PREPROCESSOR"] = haml.preprocessor
app.config["MAKO_TRANSLATE_EXCEPTIONS"] = False
app.config["MAKO_DEFAULT_FILTERS"] = ["decode.utf8"]

# CSRF protection
from flask_wtf.csrf import CsrfProtect

CsrfProtect(app)

# Database
from flask.ext.sqlalchemy import SQLAlchemy

db = SQLAlchemy(app)


# Mail
from flask_mail import Mail