예제 #1
0
    def __init__(self, app):
        super(Window, self).__init__(title="Trails",
                                    default_width=450,
                                    default_height=300,
                                    application=app,
                                    )

        menubar = Gtk.MenuBar()
        menubar.props.hexpand = True

        fmi = Gtk.MenuItem.new_with_label("File")

        menu = Gtk.Menu()
        emi = Gtk.MenuItem.new_with_label("Exit")
        emi.connect("activate", self.quit_app)
        ami = Gtk.MenuItem.new_with_label("About")
        ami.connect("activate", self.about)
        menu.append(emi)

        fmi.set_submenu(menu)

        menubar.add(fmi)
        menubar.add(ami)

        self.user_entry = Gtk.Entry(margin_right=64,
                            halign=1,
                            max_length=18,
                            width_chars=17
                            )

        self.pass_entry = Gtk.Entry(margin_right=64,
                            halign=1,
                            max_length=18,
                            width_chars=17,
                            visibility=False,
                            )

        user_label = Gtk.Label(label="Username:"******"Password:"******"text.txt")
        trail_rows = trail.get_trails()

        r = 0
        for i in trail_rows:
            c = 0
            for n in trail_rows[i]:
                self.trails_table.attach(Gtk.Label(label=trail_rows[i][n]), c, r, 1, 1)
                c += 1
            r += 1

        self.login_b = Gtk.Button(label="Login", hexpand=True, halign=3, margin_bottom=64)
        self.login_b.connect("clicked", self.login)

        self.create_acc_b = Gtk.Button(label="Create Account", hexpand=True, halign=3, margin_bottom=64)
        self.create_acc_b.connect("clicked", self.create_acc)

        self.login_grid = Gtk.Grid(halign=3,
                                column_spacing=16,
                                )

        self.login_grid.attach(self.login_b, 0, 0, 1, 1)
        self.login_grid.attach(self.create_acc_b, 1, 0, 1, 1)

        self.grid2.attach(user_label, 0, 0, 1, 1)
        self.grid2.attach(pass_label, 0, 1, 1, 1)
        self.grid2.attach(self.user_entry, 1, 0, 1, 1)
        self.grid2.attach(self.pass_entry, 1, 1, 1, 1)

        self.grid = Gtk.Grid(row_spacing=64, column_homogeneous=True)
        self.grid.attach(menubar, 0, 0, 1, 1)
        self.grid.attach(self.grid2, 0, 1, 1, 1)
        self.grid.attach(self.login_grid, 0, 2, 1, 1)

        self.log = Access.Access("access.txt")
        self.tid = None
        self.add(self.grid)
예제 #2
0
}

class TokenManager(object):
    def GET(self):
        hostname = socket.getfqdn(socket.gethostname())
        hostaddress = socket.gethostbyname(myname)
        if web.ctx.ip == hostaddress:
            return token_access.get_access_token()
        else:
            Msg = ("TokenAccess from Outside[GET/%s]" % web.ctx.ip)
            Recorder.Warning.Record(Msg, 1)
            return "Apple: Token manager on working, access from inside."
    def POST(self):
        Msg = ("TokenAccess with Post[POST/%s]" % web.ctx.ip)
        Recorder.Warning.Record(Msg, 1)

class OtherAccessManager(object):
    def GET(self):
        Msg = ("Unknown Access[GET/%s]" % web.ctx.ip)
        Recorder.Warning.Record(Msg, 3)
    def POST(self):
        Msg = ("Unknown Access[POST/%s]" % web.ctx.ip)
        Recorder.Warning.Record(Msg, 3)
        
token_access = Access.Access();

if __name__ == '__main__':
    token_access.get_access_token();
    app = web.application(urls, globals(), True)
    app.run()
예제 #3
0
    def __init__(self, app):
        super(Window, self).__init__(
            title="Trails",
            default_width=450,
            default_height=300,
            application=app,
        )

        menubar = Gtk.MenuBar()
        menubar.props.hexpand = True

        fmi = Gtk.MenuItem.new_with_label("File")

        menu = Gtk.Menu()
        emi = Gtk.MenuItem.new_with_label("Exit")
        emi.connect("activate", self.quit_app)
        ami = Gtk.MenuItem.new_with_label("About")
        ami.connect("activate", self.about)
        menu.append(emi)

        fmi.set_submenu(menu)

        menubar.add(fmi)
        menubar.add(ami)

        self.user_entry = Gtk.Entry(margin_right=64,
                                    halign=1,
                                    max_length=18,
                                    width_chars=17)

        self.pass_entry = Gtk.Entry(
            margin_right=64,
            halign=1,
            max_length=18,
            width_chars=17,
            visibility=False,
        )

        user_label = Gtk.Label(
            label="Username:"******"Password:"******"Login",
                                  hexpand=True,
                                  halign=3,
                                  margin_bottom=64)
        self.login_b.connect("clicked", self.login)

        self.create_acc_b = Gtk.Button(label="Create Account",
                                       hexpand=True,
                                       halign=3,
                                       margin_bottom=64)
        self.create_acc_b.connect("clicked", self.create_acc)

        self.login_grid = Gtk.Grid(
            halign=3,
            column_spacing=16,
        )

        self.login_grid.attach(self.login_b, 0, 0, 1, 1)
        self.login_grid.attach(self.create_acc_b, 1, 0, 1, 1)

        self.grid2.attach(user_label, 0, 0, 1, 1)
        self.grid2.attach(pass_label, 0, 1, 1, 1)
        self.grid2.attach(self.user_entry, 1, 0, 1, 1)
        self.grid2.attach(self.pass_entry, 1, 1, 1, 1)

        self.grid = Gtk.Grid(row_spacing=64, column_homogeneous=True)
        self.grid.attach(menubar, 0, 0, 1, 1)
        self.grid.attach(self.grid2, 0, 1, 1, 1)
        self.grid.attach(self.login_grid, 0, 2, 1, 1)

        self.add(self.grid)
예제 #4
0
sys.path.append("./sched/")
import AuthSys
import KeepAlive
import MobsUpdate
import Regen
import MissionClock
import Security
sys.path.append("./mods/")
import SpamFilter
import Basic
import Mobster
import Missions
import LegalAffairs

logger = Logger.Logger()
access = Access.Access(logger)
event = Event.Event(access)
scheduler = Scheduler.Scheduler()

# bot network info
#		Title	Network			Port	NICK	USER		NICKSERV		[AJOIN]
rizon = Utility.Network("rizon", "irc.rizon.net", 6697)
ajoin = [
    "#mobsters", "#nova"
]  #First channel in Array will be the active game channel, 2nd channel is the OPs channel

#Two bots are required. First bot will be the main game bot, while the second one is the missions bot
bots = [[rizon, Utility.Identity("mobsters", "mobster", None, ajoin)],
        [rizon, Utility.Identity("DonVito", "dv", None, ajoin)]]

eng = Engine.Engine(event, bots, scheduler,