Welcome, Guest. Please login or register.

  Show Posts
Pages: [1]
1  Development / Programming / Re: Coordinating on: March 31, 2010, 07:30:44 PM
Hi I'm alive I'll try to send patch about "Console" after one week. Then I'm free with no "idea" what to do and how parpg work Cheesy

I thought about main menu (or prototype of menu, or prototype of prototype of prototype), but this may be too much for me.
(I'm working out UH way, but it is not so useful).
2  Development / Programming / Re: Q about console class and command handling implementation. on: March 19, 2010, 10:46:47 PM
Created ticket and new thread dedicated my ideas about this code.
http://forums.parpg.net/index.php?topic=688.0
3  Development / Programming / Improving in game console code. on: March 19, 2010, 10:45:49 PM
Here is ticket:
http://parpg-trac.cvsdude.com/parpg/ticket/258
Here are my ideas:
http://forums.parpg.net/index.php?topic=684.0
4  Development / Programming / Re: General patches thread on: March 19, 2010, 09:43:21 PM
Hmm, I've found that UT for console requires whole game loaded. So far someone just initialized console class with None wich cause error and ut fails. IMHO the best is to comment out all tests. So they want be counted in tests, but code will wait for better times. Hand test should be enough.

So here is patch that comment out whole tests/test_console.py
 revision is: "Updated to revision 535."

Code:
[przemo@null parpg]$ svn diff
Index: tests/test_console.py
===================================================================
--- tests/test_console.py       (revision 535)
+++ tests/test_console.py       (working copy)
@@ -16,33 +16,35 @@
 #   along with PARPG.  If not, see <http://www.gnu.org/licenses/>.
 
 
-import unittest
-from scripts.console import Console
+#import unittest
+#from scripts.console import Console
 
-class test_console(unittest.TestCase):
-    def setUp(self):
-        self.con=Console(None)
-        self.invalString="Invalid command, enter help for more information"
-        pass
-    
-    def tearDown(self):
-        pass
-
-    def testConsoleCommandHelp(self):
-        """ Test the help console command """
-        
-        self.assertNotEqual(self.con.handleHelp("help"),self.invalString)
-        self.assertNotEqual(self.con.handleConsoleCommand("help"),
-                            self.invalString)
-
-    def testConsoleCommandPython(self):
-        """ Test the python console command """
-        self.assertEqual(self.con.handlePython("python 1+1"),"2")
-        self.assertEqual(self.con.handleConsoleCommand("python 1+1"),"2")
-      
-    def testInvalid(self):
-        """Test an invalid console command """
-
-        self.assertEqual(self.con.handleConsoleCommand("invalid"),
-                         self.invalString)
-
+#class test_console(unittest.TestCase):
+#    def setUp(self):
+# FIXME        # Below wont work as it would require running whole game
+# all test must be done ingame till any better idea
+#      self.con=Console(None)
+#        self.invalString="Invalid command, enter help for more information"
+#        pass
+#    
+#    def tearDown(self):
+#        pass
+#
+#    def testConsoleCommandHelp(self):
+#        """ Test the help console command """
+#        
+#        self.assertNotEqual(self.con.handleHelp("help"),self.invalString)
+#        self.assertNotEqual(self.con.handleConsoleCommand("help"),
+#                            self.invalString)
+#
+#    def testConsoleCommandPython(self):
+#        """ Test the python console command """
+#        self.assertEqual(self.con.handlePython("python 1+1"),"2")
+#        self.assertEqual(self.con.handleConsoleCommand("python 1+1"),"2")
+#      
+#    def testInvalid(self):
+#        """Test an invalid console command """
+#
+#        self.assertEqual(self.con.handleConsoleCommand("invalid"),
+#                         self.invalString)
+#
[przemo@null parpg]$ svn diff >> no_console_tests.patch

PS why tests/test_* ? "from tests import test_console" looks ugly :|, and test are auto detected so name makes no difference.
5  Development / Programming / Re: General patches thread on: March 18, 2010, 11:21:12 AM
I got it. Sorry.


used my command and got too big diff patch Sad :
Code:
[przemo@null Development]$ wc -l my_fix.patch
424749 my_fix.patch
6  Development / Programming / Re: Q about console class and command handling implementation. on: March 17, 2010, 06:53:49 PM
My ideas are:
1) add command specific help: if "help something" is called help lists only "something" help

1) remove programming specific help form "commands", they duplicate "help", and say only save -> "implements save", etc.
2) remove stand alone help strings and use __doc__ instead
3) change re mathing to dict's native "if x in dict:", and use exceptions to show help

And I thing about adding ticket about reusing console commands (save and load) in game menu and|or removing any other implementations

What do you think ?
7  General Category / General Discussion / Re: Name of game on: March 17, 2010, 06:07:56 PM
RTFM BP ?
or
RTFM AP !
8  Development / Programming / Re: I'll be looking over the code base... on: March 16, 2010, 09:43:48 AM
well you can also use "svn blame filename_you_want_to_change"
9  Development / Programming / Re: General patches thread on: March 16, 2010, 09:32:10 AM
so you mean

cd parpg_clean && svn up && cd ../parpg && svn up && cd .. && diff -urN parpg  parpg_clean > my_fix.patch && vi my_fix.patch

??
10  General Category / General Discussion / Re: Name of game on: March 16, 2010, 09:20:54 AM
"Boomerang Nebula"
coldest place in known universe
http://en.wikipedia.org/wiki/Cold
11  Development / Programming / Re: General patches thread on: March 16, 2010, 08:48:00 AM
How to send useful path ??

here is what i got with "svn diff"

Quote
[przemo@null scripts]$ cat diff_path
Index: dialogue.py
===================================================================
--- dialogue.py (revision 527)
+++ dialogue.py (working copy)
@@ -130,7 +130,6 @@
                 if end_cb:
                     end_cb()
                 logging.debug("Reached the end")
-                return
 
     def continueWithResponse(self, section_name, response):
         """Reply to a response in a section and continue executing dialogue

removed unnecessary return.
12  Development / Programming / Q about console class and command handling implementation. on: March 16, 2010, 08:28:35 AM
How console class works ?
Why commands are build into class code (and not as separate class) ?
Look at save function. Is return statement bug (cause it return result that may be uninitialized) ?
Why re (and not simple if x in dict:) ? And just cut name of command before calling function (so "save" have no need for doing the same re match again).
13  Development / Programming / Re: Organizing a weekly meeting on: March 16, 2010, 08:11:59 AM
weekly meetings still works ?
can someone give me time with time zone (or better time translated to london time) ?
14  General Category / Introduce yourself / Re: przemo_li on: March 08, 2010, 10:51:19 PM
Do not worry I'll be quiet  Wink I'm crashing my fedora to work with fife. And I've lots of problems with it.
So my first commit will be improving "SDL_ttf not found" section of Wiki (I'm expert of that  now Grin )
15  General Category / Introduce yourself / przemo_li on: March 08, 2010, 09:25:00 PM
Currently student of CS
Likes Linux and programming.
Some experience in C/C++/SDL/Python.  (working on "SDL_ttf not found" bug)
Loves Fallout and PA films/books
Pages: [1]