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.
  
148148 # CSOUND-communication
149149 self.child = popen2.Popen3(os.path.join(self._MEMO['_DIR_CSSERVER'], "universe.py"))
150150 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))
151155 gobject.timeout_add(1000, self._csconnect)
152156
153157 def _csconnect(self):
170170 self.cssock.close()
171171 if self.child is not None:
172172 self.child.fromchild.close()
173 gtk.main_quit()
173 gtk.main_quit() ##FIXME quit what
174174 else:
175175 mess = "csound.SetChannel('sfplay.%d.on', 1)\n" % self.id
176176 self.cssock.send(mess)
199199 mess = "perf.InputMessage('i 102 0 3 \"%s\" %s 0.7 0.5 0')\n"%(
200200 os.path.join(self._MEMO['_DIR_GSOUNDS'],sound),self.id)
201201 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))
203203 else:
204204 logging.error(" Can not read file: "+os.path.join(self._MEMO['_DIR_GSOUNDS'],sound))
205205
510510
511511 # set path
512512 _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")
516515 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")
518517 path = pathes(gamename)
519518 _MEMO['_DIR_GIMAGES'] = path[1]
520519 _MEMO['_DIR_GSOUNDS'] = path[2]