mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-05 16:00:06 +01:00
adding git intergration (finally!)
This commit is contained in:
30
actions.py
30
actions.py
@@ -7,6 +7,7 @@ from pythonosc import osc_message_builder
|
||||
from pythonosc import dispatcher
|
||||
from pythonosc import osc_server
|
||||
from pythonosc import dispatcher
|
||||
from git import Repo
|
||||
import threading
|
||||
import argparse
|
||||
from video_centre.capture import Capture
|
||||
@@ -512,5 +513,34 @@ class Actions(object):
|
||||
if self.serial_port_process is not None:
|
||||
self.serial_port_process.kill()
|
||||
self.serial_port_process = None
|
||||
|
||||
def try_pull_code_and_reset(self):
|
||||
recur_repo = Repo("~/r_e_c_u_r")
|
||||
conjur_repo = Repo("~/openFrameworks/apps/myApps/c_o_n_j_u_r")
|
||||
current_recur_hash = recur_repo.head.object.hexsha
|
||||
current_conjur_hash = conjur_repo.head.object.hexsha
|
||||
recur_repo.remotes.origin.pull()
|
||||
conjur_repo.remotes.origin.pull()
|
||||
new_recur_hash = recur_repo.head.object.hexsha
|
||||
new_conjur_hash = conjur_repo.head.object.hexsha
|
||||
if current_recur_hash != new_recur_hash or current_conjur_hash != new_conjur_hash :
|
||||
#something has changed!
|
||||
os.remove('/home/pi/r_e_c_u_r/json_objects/settings.json')
|
||||
if current_conjur_hash != new_conjur_hash :
|
||||
self.message_handler.set_message('INFO', 'compiling OF pls wait')
|
||||
self.tk.after(100,self.complie_openframeworks)
|
||||
else:
|
||||
self.restart_the_program()
|
||||
else:
|
||||
self.message_handler.set_message('INFO', 'up to date !')
|
||||
|
||||
def complie_openframeworks(self):
|
||||
subprocess.call(['make', '--directory=~/openFrameworks/apps/myApps/c_o_n_j_u_r' ])
|
||||
self.message_handler.set_message('INFO', 'finished compiling!')
|
||||
self.restart_the_program()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user