Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
multibot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
social
multibot
Commits
2b87ead6
Commit
2b87ead6
authored
Oct 28, 2016
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it start
parent
7a30ca0e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
146 additions
and
0 deletions
+146
-0
__init__.py
multibot/libs/__init__.py
+22
-0
multibot.py
multibot/multibot.py
+51
-0
multibot.py~
multibot/multibot.py~
+73
-0
No files found.
multibot/libs/__init__.py
0 → 100644
View file @
2b87ead6
###########################################################################
# Copyright (c) 2016-2017 Franco (nextime) Lanza <nextime@nexlab.it>
#
# Multibot daemon
#
# This file is part of multibot.
#
# multibot2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
multibot/multibot.py
View file @
2b87ead6
...
...
@@ -19,4 +19,55 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from
twisted.application
import
service
from
twisted.internet
import
defer
,
reactor
,
task
,
protocol
,
threads
from
nexlibs.utils.genutils
import
configFile
,
FakeObject
,
ConvenienceCaller
from
nexlibs.utils
import
genutils
from
nexlibs.utils
import
webutils
as
wu
import
time
,
logging
,
sys
,
os
from
libs.txscheduling
import
task
as
txcron
from
libs.txscheduling.cron
import
CronSchedule
,
parseCronLine
from
libs.txscheduling.interfaces
import
ISchedule
from
netifaces
import
interfaces
,
ifaddresses
,
AF_INET
import
struct
import
extplugins
import
modules
import
events
try
:
import
hashlib
md5
=
hashlib
md5
.
new
=
hashlib
.
md5
sha1
=
hashlib
.
sha1
except
:
import
md5
import
sha1
log
=
logging
.
getLogger
(
'Core'
)
class
MultibotService
(
service
.
Service
):
initialized
=
False
def
__init__
(
self
,
*
args
,
**
kwargs
):
log
.
info
(
'Initializing Core'
)
self
.
curdir
=
kwargs
[
'curdir'
]
self
.
config
=
kwargs
[
'config'
]
sys
.
path
.
append
(
self
.
curdir
+
"/multibot"
)
log
.
debug
(
'Current dir: '
+
self
.
curdir
)
if
self
.
parent
:
self
.
parent
.
__new__
(
self
.
parent
,
self
,
*
args
)
def
configureDaemon
(
self
,
force
=
False
):
if
force
or
not
self
.
initialized
:
# XXX Here configure daemon initialization
self
.
initialized
=
True
def
isStarted
(
self
):
self
.
configureDaemon
()
return
self
.
initialized
multibot/multibot.py~
0 → 100644
View file @
2b87ead6
###########################################################################
# Copyright (c) 2016-2017 Franco (nextime) Lanza <nextime@nexlab.it>
#
# Multibot daemon
#
# This file is part of multibot.
#
# multibot2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from twisted.application import service
from twisted.internet import defer, reactor, task, protocol, threads
from nexlibs.utils.genutils import configFile, FakeObject, ConvenienceCaller
from nexlibs import genutils
from nexlibs import webutils as wu
import time, logging, sys, os
from libs.txscheduling import task as txcron
from libs.txscheduling.cron import CronSchedule, parseCronLine
from libs.txscheduling.interfaces import ISchedule
from netifaces import interfaces, ifaddresses, AF_INET
import struct
import extplugins
import modules
import events
try:
import hashlib
md5 = hashlib
md5.new = hashlib.md5
sha1 = hashlib.sha1
except:
import md5
import sha1
log = logging.getLogger( 'Core' )
class MultibotService(service.Service):
initialized=False
def __init__(self, *args, **kwargs):
log.info('Initializing Core')
self.curdir=kwargs['curdir']
self.config=kwargs['config']
sys.path.append(self.curdir+"/multibot")
log.debug('Current dir: '+self.curdir)
if self.parent:
self.parent.__new__(self.parent, self, *args)
def configureDaemon(self, force=False):
if force or not self.initialized:
# XXX Here configure daemon initialization
self.initialized=True
def isStarted(self):
self.configureDaemon()
return self.initialized
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment