Skip to content

Commit

Permalink
extracted Jadi
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Apr 22, 2015
1 parent ae76f03 commit b523763
Show file tree
Hide file tree
Showing 120 changed files with 153 additions and 303 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ check:
cd plugins && ajenti-dev-multitool --find-outdated

upload: build
cd ajenti-core && ./setup.py sdist upload
cd ajenti-panel && ./setup.py sdist upload
cd ajenti-core && ./setup.py sdist upload --sign --identity "Ajenti Packagers"
cd ajenti-panel && ./setup.py sdist upload --sign --identity "Ajenti Packagers"

upload-plugins: build
cd plugins && ajenti-dev-multitool --setuppy 'sdist upload --sign --identity "Ajenti Packagers"'
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from aj.api.di import interface, component, service, Context, NoImplementationError
from jadi import interface, component, service, Context, NoImplementationError


__all__ = [
Expand Down
167 changes: 0 additions & 167 deletions ajenti-core/aj/api/di.py

This file was deleted.

3 changes: 1 addition & 2 deletions ajenti-core/aj/api/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import logging
import re
import types

from aj.api import interface
from jadi import interface


def url(pattern):
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pwd
import requests
import subprocess
from jadi import component, service, interface

import aj
from aj.api import component, service, interface
from aj.api.http import BaseHttpHandler
from aj.security.verifier import ClientCertificateVerificator
from aj.util import public
Expand Down
3 changes: 1 addition & 2 deletions ajenti-core/aj/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import pwd
import stat
import yaml

from aj.api import service
from jadi import service


class BaseConfig(object):
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import sys
import syslog
import traceback
from jadi import Context

import aj
import aj.plugins
from aj.auth import AuthenticationService
from aj.http import HttpRoot, HttpMiddlewareAggregator
from aj.gate.middleware import GateMiddleware
from aj.plugins import PluginManager
from aj.api import Context
from aj.util import make_report
from aj.util.sslsocket import SSLSocket
from aj.util.pidfile import PidFile
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/gate/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from gevent.timeout import Timeout
from socketio.namespace import BaseNamespace
from socketio.mixins import BroadcastMixin
from jadi import service

import aj
from aj.api import service
from aj.api.http import BaseHttpHandler
from aj.gate.gate import WorkerGate
from aj.gate.session import Session
Expand Down
3 changes: 1 addition & 2 deletions ajenti-core/aj/gate/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import traceback
import setproctitle
import sys

from gevent.event import Event
from jadi import Context

import aj
from aj.api import Context
from aj.api.http import SocketEndpoint
from aj.http import HttpMiddlewareAggregator, HttpContext
from aj.auth import AuthenticationMiddleware, AuthenticationService
Expand Down
6 changes: 3 additions & 3 deletions ajenti-core/aj/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import sys
import traceback
import yaml
from jadi import service

import aj
from aj.api import service
from aj.util import public


Expand Down Expand Up @@ -302,7 +302,6 @@ def load_all_from(self, providers):
self.__crashes[plugin['info']['name']] = dep.build_exception()
logging.warn('Not loading [%s] because [%s] is unavailable', plugin['info']['name'], dep.plugin_name)


for name in list(load_order):
try:
for dependency in self[name]['info']['dependencies']:
Expand All @@ -321,6 +320,7 @@ def load_all_from(self, providers):
except Exception as e:
self.__crashes[name] = PluginCrashed(e)
logging.error('[%s]: plugin import failed: %s', name, e)
logging.error(traceback.format_exc())
load_order.remove(name)

for name in list(load_order):
Expand All @@ -329,9 +329,9 @@ def load_all_from(self, providers):
except Exception as e:
self.__crashes[name] = PluginCrashed(e)
logging.error('[%s]: plugin init failed: %s', name, e)
logging.error(traceback.format_exc())
load_order.remove(name)


logging.info('Loaded %i plugins', len(load_order))

def __import_plugin_module(self, name, info):
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/routing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
import cgi
import traceback
from jadi import service

from aj.api import service
from aj.api.http import BaseHttpHandler, HttpPlugin


Expand Down
3 changes: 2 additions & 1 deletion ajenti-core/aj/security/verifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from jadi import service

import aj
from aj.api import service


@service
Expand Down
2 changes: 1 addition & 1 deletion docs/source/dev/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Plugins can provide their own HTTP endpoints by extending the :class:`aj.api.htt
Example::

import time
from jadi import component

from aj.api import component
from aj.api.http import url, HttpPlugin

from aj.api.endpoint import endpoint, EndpointError, EndpointReturn
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Python API Reference
--------------------

.. toctree::
ref/jadi
ref/aj
ref/aj.api
ref/aj.api.http
ref/aj.api.endpoint
ref/aj.config
Expand Down
6 changes: 0 additions & 6 deletions docs/source/ref/aj.api.rst

This file was deleted.

6 changes: 6 additions & 0 deletions docs/source/ref/jadi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
API: jadi
*********

.. automodule:: jadi
:members:
:undoc-members:
2 changes: 1 addition & 1 deletion plugins/ace/.last-upload
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1429206456.32
1429540561.59
2 changes: 1 addition & 1 deletion plugins/augeas/.last-upload
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1429206590.45
1429540624.68
3 changes: 1 addition & 2 deletions plugins/augeas/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import augeas

from aj.api import interface
from jadi import interface


class AugeasError(Exception):
Expand Down
2 changes: 1 addition & 1 deletion plugins/augeas/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: augeas
author: Ajenti project
email: e@ajenti.org
url: http://ajenti.org
version: '0.2'
version: '0.3'
title: 'Augeas API'
icon: cog
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions plugins/augeas/views.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
from jadi import component

from aj.api import component
from aj.api.http import url, HttpPlugin

from aj.api.endpoint import endpoint, EndpointError, EndpointReturn
from aj.api.endpoint import endpoint, EndpointReturn
from aj.plugins.augeas.api import AugeasEndpoint


Expand Down
2 changes: 1 addition & 1 deletion plugins/auth_users/.last-upload
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1429206111.39
1429540344.44

0 comments on commit b523763

Please sign in to comment.