Example #1
0
 def write(self, data, hasCallback='False'):
     data = self.__wrapData(data)
     data = self.__joinData(data, hasCallback)
     return BackEnd.write(self, data)
Example #2
0
 def on_read(self, data):
     data = self.__unwrapData(data)
     return BackEnd.on_read(self, data)
Example #3
0
	def __init__(self, parent=None, extra_panels=None, id=-1, size=(1000, 600)):
		self.backend = BackEnd(self)
		
		self.filename = None
		
		wx.Frame.__init__(self, parent, id, "Piavca Designer")
		self.statusbar = self.CreateStatusBar()
		
		
		menubar = wx.MenuBar()
		
		filemenu = wx.Menu()
		open = filemenu.Append(wx.NewId(), "Open", "")
		self.Bind(wx.EVT_MENU, self.Open, open)
		imp = filemenu.Append(wx.NewId(), "Import", "")
		self.Bind(wx.EVT_MENU, self.Import, imp)
		save = filemenu.Append(wx.NewId(), "&Save\tCtrl+s", "")
		self.Bind(wx.EVT_MENU, self.Save, save)
		saveas = filemenu.Append(wx.NewId(), "SaveAs", "")
		self.Bind(wx.EVT_MENU, self.SaveAs, saveas)
		quit = filemenu.Append(wx.NewId(), "Quit", "")
		self.Bind(wx.EVT_MENU, self.Quit, quit)
		
		editmenu = wx.Menu()
		delete = editmenu.Append(wx.NewId(), "Delete\tdel", "")
		self.Bind(wx.EVT_MENU, self.backend.Delete, delete)
		publishevents = editmenu.Append(wx.NewId(), "Publish Events", "")
		self.Bind(wx.EVT_MENU, self.backend.PublishEvents, publishevents)
	
		menubar.Append(filemenu, "&File")
		menubar.Append(editmenu, "&Edit")
		self.SetMenuBar(menubar)
		
		self.totalheight = self.mainHeight+self.timelineHeight
		self.totalwidth = self.viewerwidth+self.hierarchywidth+self.listwidth
		
		self.splitter1 = wx.SplitterWindow(self, -1)#, size=(1000, 500))
		self.splitter2 = wx.SplitterWindow(self.splitter1, -1)
		#p2 = wx.Panel(self.splitter2, style=wx.SUNKEN_BORDER)
		
		
		#p1 = wx.Panel(self.splitter2, style=wx.SUNKEN_BORDER)
		#self.viewer = Piavca.FreeCameraCanvas.FreeCameraCanvas(self.splitter2)
		self.viewer = Piavca.ViewerCanvas.ViewerCanvas(self.splitter2)
		self.viewer.setClearColour(0.5, 0.5, 1.0)
		Piavca.getWXApp().setCanvas(self.viewer)
		self.viewer.tracking = False
		self.heirarchy = HeirarchyView.HeirarchyView(self.backend, self.splitter2)#, style=wx.SUNKEN_BORDER)
		self.listboxes = ListBoxController.ListBoxController(self.backend, self.splitter1, extra_panels=extra_panels, style=wx.SUNKEN_BORDER)
		
		self.children = []
		self.children.append(self.heirarchy)
		self.children.append(self.listboxes)
		
		#self.horizSplitter.Initialize(p1)
		self.splitter1.SplitVertically(self.splitter2, self.listboxes)
		self.splitter2.SplitVertically(self.viewer, self.heirarchy)
		
		self.playcontrols = PlayControls.PlayControls(self.backend, self, size=(self.totalwidth, self.timelineHeight))
		
		self.sizer=wx.BoxSizer(wx.VERTICAL)
		self.sizer.Add(self.splitter1, 1, flag=wx.EXPAND)
		self.sizer.Add(self.playcontrols, flag=wx.EXPAND)
		self.SetSizer(self.sizer)
		#self.Fit()
		self.SetAutoLayout(1)
		self.sizer.Fit(self)
		self.Show(True)
		self.Layout()
		
		
		
		self.Bind(wx.EVT_IDLE, self.OnIdle)
		
		self.SetSizeWH(self.totalwidth, self.totalheight)
		
		self.splitter1.SetSashPosition(self.viewerwidth+self.hierarchywidth, redraw=True)
		self.splitter2.SetSashPosition(self.viewerwidth)
		#self.SendSizeEvent((1000,500))
		
		self.update()
Example #4
0
class PiavcaDesigner(wx.Frame):
	mainHeight = 500
	timelineHeight = 25
	viewerwidth=400
	hierarchywidth=400
	listwidth=300
	
	
	def __init__(self, parent=None, extra_panels=None, id=-1, size=(1000, 600)):
		self.backend = BackEnd(self)
		
		self.filename = None
		
		wx.Frame.__init__(self, parent, id, "Piavca Designer")
		self.statusbar = self.CreateStatusBar()
		
		
		menubar = wx.MenuBar()
		
		filemenu = wx.Menu()
		open = filemenu.Append(wx.NewId(), "Open", "")
		self.Bind(wx.EVT_MENU, self.Open, open)
		imp = filemenu.Append(wx.NewId(), "Import", "")
		self.Bind(wx.EVT_MENU, self.Import, imp)
		save = filemenu.Append(wx.NewId(), "&Save\tCtrl+s", "")
		self.Bind(wx.EVT_MENU, self.Save, save)
		saveas = filemenu.Append(wx.NewId(), "SaveAs", "")
		self.Bind(wx.EVT_MENU, self.SaveAs, saveas)
		quit = filemenu.Append(wx.NewId(), "Quit", "")
		self.Bind(wx.EVT_MENU, self.Quit, quit)
		
		editmenu = wx.Menu()
		delete = editmenu.Append(wx.NewId(), "Delete\tdel", "")
		self.Bind(wx.EVT_MENU, self.backend.Delete, delete)
		publishevents = editmenu.Append(wx.NewId(), "Publish Events", "")
		self.Bind(wx.EVT_MENU, self.backend.PublishEvents, publishevents)
	
		menubar.Append(filemenu, "&File")
		menubar.Append(editmenu, "&Edit")
		self.SetMenuBar(menubar)
		
		self.totalheight = self.mainHeight+self.timelineHeight
		self.totalwidth = self.viewerwidth+self.hierarchywidth+self.listwidth
		
		self.splitter1 = wx.SplitterWindow(self, -1)#, size=(1000, 500))
		self.splitter2 = wx.SplitterWindow(self.splitter1, -1)
		#p2 = wx.Panel(self.splitter2, style=wx.SUNKEN_BORDER)
		
		
		#p1 = wx.Panel(self.splitter2, style=wx.SUNKEN_BORDER)
		#self.viewer = Piavca.FreeCameraCanvas.FreeCameraCanvas(self.splitter2)
		self.viewer = Piavca.ViewerCanvas.ViewerCanvas(self.splitter2)
		self.viewer.setClearColour(0.5, 0.5, 1.0)
		Piavca.getWXApp().setCanvas(self.viewer)
		self.viewer.tracking = False
		self.heirarchy = HeirarchyView.HeirarchyView(self.backend, self.splitter2)#, style=wx.SUNKEN_BORDER)
		self.listboxes = ListBoxController.ListBoxController(self.backend, self.splitter1, extra_panels=extra_panels, style=wx.SUNKEN_BORDER)
		
		self.children = []
		self.children.append(self.heirarchy)
		self.children.append(self.listboxes)
		
		#self.horizSplitter.Initialize(p1)
		self.splitter1.SplitVertically(self.splitter2, self.listboxes)
		self.splitter2.SplitVertically(self.viewer, self.heirarchy)
		
		self.playcontrols = PlayControls.PlayControls(self.backend, self, size=(self.totalwidth, self.timelineHeight))
		
		self.sizer=wx.BoxSizer(wx.VERTICAL)
		self.sizer.Add(self.splitter1, 1, flag=wx.EXPAND)
		self.sizer.Add(self.playcontrols, flag=wx.EXPAND)
		self.SetSizer(self.sizer)
		#self.Fit()
		self.SetAutoLayout(1)
		self.sizer.Fit(self)
		self.Show(True)
		self.Layout()
		
		
		
		self.Bind(wx.EVT_IDLE, self.OnIdle)
		
		self.SetSizeWH(self.totalwidth, self.totalheight)
		
		self.splitter1.SetSashPosition(self.viewerwidth+self.hierarchywidth, redraw=True)
		self.splitter2.SetSashPosition(self.viewerwidth)
		#self.SendSizeEvent((1000,500))
		
		self.update()
		
	def Open(self, event):
		self.backend.clear()
		self.Import(event)
		
	def Import(self, event):
		dialog_return = openFileDialog (wildcard="XML Motion files (*.xml)|*.xml|Cal3d Character files files (*.cfg)|*.cfg")
		path = dialog_return.paths[0].encode("latin-1")
		self.ImportFile(path)
		
	def ImportFile(self, path):
	
		print path
		pathend = path.rfind("\\")
		if pathend < 0:
			pathend = path.rfind("/")
		if pathend < 0:
			filename = path
		else:
			filename = path[pathend+1:]
			path = path[:pathend+1]
			if path != "":
				os.chdir(path)
		print filename, path
		self.backend.readfile(filename)
		
	def getSaveName(self):
		dialog_return = saveFileDialog (wildcard="*.xml", filename=".xml") #"XML Motion files (*.xml)|*.xml")
		path = dialog_return.paths[0].encode("latin-1")
	
		print path
		pathend = path.rfind("\\")
		if pathend < 0:
			pathend = path.rfind("/")
		if pathend < 0:
			filename = path
		else:
			filename = path[pathend+1:]
			path = path[:pathend+1]
			if path != "":
				os.chdir(path)
		print filename, path
		return filename
	
	def _save(self, filename=None):
		if filename == None:
			filename = self.getSaveName()
		self.filename = filename
		self.backend.save(filename)
		
	def SaveAs(self, evt):
		self._save()
		
	def Save(self, evt):
		self._save(self.filename)
		
	def Quit(self,event):
		self.Close()
		
	def update(self):
		for child in self.children:
			child.update()
			
		if self.viewer.avatar != self.backend.getAvatar():
			self.viewer.setAvatar(self.backend.getAvatar())
			self.viewer.initCameraPosition()
			self.viewer.SetFocus()

		# this line is a bit of a hack, its the only way I could get the 
		# heirarchy view to update its layout properly
		self.splitter2.SetSashPosition(self.splitter2.GetSashPosition())
		print "finished update"
		
	def OnIdle(self, event):
		self.backend.timeStep()
 def on_read(self, data):
     data = self.__unwrapData(data)
     return BackEnd.on_read(self, data)
 def write(self, data, hasCallback="False"):
     data = self.__wrapData(data)
     data = self.__joinData(data, hasCallback)
     return BackEnd.write(self, data)
Example #7
0
import numpy as np
import openpyxl as xl
import re
import calendar
from BackEnd import BackEnd
from Naming import PreProcess
from Analysis import *
from tkinter import *
import tkinter as ttk

###################
##  Setting global variables and pre-processing statements
###################

PreProcess = PreProcess()  ## Creating month-based named files.
BackEnd = BackEnd()  ##  Reading raw data and GUI
Analysis = Analysis()  ## Analysis data and creating graphs

letters = list(string.ascii_lowercase)
month = PreProcess.Naming()  ## pre-process files and gets the month
#month = "Mar" # NOTE: if you want to analyse a specific month, you can overide here.

#skipable = [" Interest Charge on Cash Advances" , " Interest Charge on Purchases" , " AUTOMATIC PAYMENT" , " ONLINE PAYMENT" , " AUTOPAY PAYMENT"] ## move to excel

Mainpth = 'C:\\Users\\gad-t\\Desktop\\Files\\Money Manger\\Bank Statements\\Processed\\'
WriteFileName = "Combined\\Spending Summary.xlsx"
Write_Full_pth = Mainpth + WriteFileName

###################
## Setting-up Spending Summary file and getting expenses catagories
###################