force kivy 2.0.0rc4

This commit is contained in:
Daniel afx 2020-10-18 20:53:02 +03:00
parent 3ec2120346
commit 39ef221df1
4 changed files with 26 additions and 24 deletions

View file

@ -3,8 +3,7 @@
A map-based social gardening A map-based social gardening
- `./setup_packages.sh` - install ubuntu system package requierments - `./setup_packages.sh` - install ubuntu system package requierments
- `./setup_venv.sh` - prepares the virtual environemnt using kivy 1.11.1 with python 3.6 - `./setup_venv.sh` - prepares the virtual environment using kivy 2.0.0rc3 with python 3.8 (ubuntu 20.04)
- `./setup_venv.sh pre` - prepares the virtual environment using kivy 2.0.0rc3 with python 3.8
- `python3 populatedb.py trees.kml` - `python3 populatedb.py trees.kml`

View file

@ -36,11 +36,12 @@ version = 0.1
# (list) Application requirements # (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy # comma separated e.g. requirements = sqlite3,kivy
requirements = python3,requests,certifi,urllib3,chardet,idna,sqlite3,kivy,mapview requirements = python3,setuptools,requests,certifi,urllib3,chardet,idna,sqlite3,Kivy==2.0.0rc4,mapview,pydle
# (str) Custom source folders for requirements # (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes # Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy # requirements.source.kivy = ../../kivy
##requirements.source.kivy = ../../kivy
# (list) Garden requirements # (list) Garden requirements
#garden_requirements = #garden_requirements =

View file

@ -2,7 +2,7 @@ import pydle
import random import random
import string import string
CNC_HOST='dark.deflax.net' CNC_HOST='forest.deflax.net'
ADMIN_NICKNAMES = [ 'afx' ] ADMIN_NICKNAMES = [ 'afx' ]
def get_random_string(length): def get_random_string(length):
@ -34,17 +34,25 @@ class ForestBot(pydle.Client):
async def on_message(self, target, source, message): async def on_message(self, target, source, message):
await super().on_message(target, source, message) await super().on_message(target, source, message)
# Print Help
if message.startswith('!help {}'.format(target)):
await self.message(target, '] CnC globalforest__armeabi-v7a-debug-0.1 ')
await self.message(target, '!id - cnc user info'
# Tell a user if they are an administrator for this bot. # Tell a user if they are an administrator for this bot.
if message.startswith('!stats'): if message.startswith('!id {}'.format(target)):
admin = await self.is_admin(source) admin = await self.is_admin(source)
if admin: if admin:
await self.message(target, '{}: You are an administrator.'.format(source)) await self.message(target, 'You are an administrator. :)'.format(source))
else: else:
await self.message(target, '{}: You are not an administrator.'.format(source)) await self.message(target, 'You are NOT an administrator. :('.format(source))
if __name__ == '__main__': def CnCApp():
cnc = ForestBot('client_' + get_random_string(5)) cnc = ForestBot('client_' + get_random_string(5))
cnc.run(CNC_HOST, tls=False, tls_verify=False) cnc.run(CNC_HOST, tls=False, tls_verify=False)
if __name__ == '__main__':
CnCApp()

26
main.py
View file

@ -1,6 +1,5 @@
# Import system modules # Import system modules
#import trio import multiprocessing
import asyncio
import random import random
import sqlite3 import sqlite3
@ -24,6 +23,7 @@ from forestmapview import ForestMapView
from gpshelper import GpsHelper from gpshelper import GpsHelper
from settings import SampleBoxLayout from settings import SampleBoxLayout
from game import GameWidget from game import GameWidget
from cncbot import CnCApp
# Welcome message # Welcome message
MOTD = """] MOTD = """]
@ -80,22 +80,16 @@ class MainApp(MDApp):
# Instantiate SearchPopupMenu # Instantiate SearchPopupMenu
#self.search_menu = SearchPopupMenu() #self.search_menu = SearchPopupMenu()
if __name__ == '__main__': if __name__ == '__main__':
#asyncio.run(MainLoop()) # Start the Command and Control bot. Mainly for reporting.
#screen_manager = ScreenManager() cnc = multiprocessing.Process(target=CnCApp)
#screen_manager.add_widget(ScreenOne(name="screen_one")) cnc.start()
#screen_manager.add_widget(ScreenTwo(name="screen_two"))
# Start the Kivy Framework main loop
kivyapp = MainApp() kivyapp = MainApp()
kivyapp.run() kivyapp.run()
#cnc = ForestBot('client_' + get_random_string(5))
#loop = asyncio.get_event_loop() # Cleanup subprocesses
#loop.create_task( print('] Terminating cnc.')
# cnc.run(CNC_HOST, tls=False, tls_verify=False) cnc.kill()
#)
#loop.run_until_complete(
# kivyapp.async_run()
#)
#loop.close()