Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit 817af089864733677138d50273417938a1189b2e

  • Tree SHA1: 5dec9a0
  • Parent SHA1: f80c409 (Fixed a few other bugs during the move to sugar. Still was not able to solve the problem of hardcoded pathes:()
  • raw diff | raw patch
Fixed the hardcoded path problem. os.path.join(os.path.dirname(__file__) did the job.
  • Diff rendering mode:
  • inline
  • side by side

memosono.py

148 # CSOUND-communication148 # CSOUND-communication
149 self.child = popen2.Popen3(os.path.join(self._MEMO['_DIR_CSSERVER'], "universe.py"))149 self.child = popen2.Popen3(os.path.join(self._MEMO['_DIR_CSSERVER'], "universe.py"))
150 self.id = 0150 self.id = 0
151 if self.child:
152 logging.debug(" Csound server started: "+str(self.child))
153 else:
154 logging.error(" Csound server not started"+str(self.child))
151 gobject.timeout_add(1000, self._csconnect)155 gobject.timeout_add(1000, self._csconnect)
152156
153 def _csconnect(self):157 def _csconnect(self):
170 self.cssock.close()170 self.cssock.close()
171 if self.child is not None:171 if self.child is not None:
172 self.child.fromchild.close()172 self.child.fromchild.close()
173 gtk.main_quit()
173 gtk.main_quit() ##FIXME quit what
174 else: 174 else:
175 mess = "csound.SetChannel('sfplay.%d.on', 1)\n" % self.id175 mess = "csound.SetChannel('sfplay.%d.on', 1)\n" % self.id
176 self.cssock.send(mess) 176 self.cssock.send(mess)
199 mess = "perf.InputMessage('i 102 0 3 \"%s\" %s 0.7 0.5 0')\n"%(199 mess = "perf.InputMessage('i 102 0 3 \"%s\" %s 0.7 0.5 0')\n"%(
200 os.path.join(self._MEMO['_DIR_GSOUNDS'],sound),self.id)200 os.path.join(self._MEMO['_DIR_GSOUNDS'],sound),self.id)
201 self.cssock.send(mess)201 self.cssock.send(mess)
202 logging.error(" Read file: "+os.path.join(self._MEMO['_DIR_GSOUNDS'],sound))
202 logging.info(" Read file: "+os.path.join(self._MEMO['_DIR_GSOUNDS'],sound))
203 else:203 else:
204 logging.error(" Can not read file: "+os.path.join(self._MEMO['_DIR_GSOUNDS'],sound))204 logging.error(" Can not read file: "+os.path.join(self._MEMO['_DIR_GSOUNDS'],sound))
205205
510510
511 # set path511 # set path
512 _MEMO = {}512 _MEMO = {}
513 _MEMO['_DIR_CSSERVER'] = "/home/erikos/sugar-jhbuild/build/share/sugar/activities/memosono/csserver"
514 _MEMO['_DIR_IMAGES'] = "/home/erikos/sugar-jhbuild/build/share/sugar/activities/memosono/images"
515 logging.error( os.path.abspath('.') )
513 _MEMO['_DIR_CSSERVER'] = os.path.join(os.path.dirname(__file__), "csserver")
514 _MEMO['_DIR_IMAGES'] = os.path.join(os.path.dirname(__file__), "images")
516 logging.error( os.path.dirname('.') )515 logging.error( os.path.dirname('.') )
517 _MEMO['_DIR_SOUNDS'] = "/home/erikos/sugar-jhbuild/build/share/sugar/activities/memosono/sounds"
516 _MEMO['_DIR_SOUNDS'] = os.path.join(os.path.dirname(__file__), "sounds")
518 path = pathes(gamename)517 path = pathes(gamename)
519 _MEMO['_DIR_GIMAGES'] = path[1]518 _MEMO['_DIR_GIMAGES'] = path[1]
520 _MEMO['_DIR_GSOUNDS'] = path[2]519 _MEMO['_DIR_GSOUNDS'] = path[2]