Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
<py> optparser

 
Post new topic   Reply to topic Printable version
 View previous topic  Shields Post :: Post <C> Lockon  View next topic  
Author Message
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Wed Feb 18, 2009 12:23 pm    Post subject: <py> optparser Reply to topic Reply with quote

I've bundled a wrapper to Python's optparse library in with hgcore to simplify command parsing. Examples on the wiki page, or you can see it in action in the zombies game.
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Initrd.gz
Seasoned Helper


Joined: Sep 18 2008
Posts: 134
Location: Over there --->
Offline

PostPosted: Wed Feb 18, 2009 8:23 pm    Post subject: Reply to topic Reply with quote

That will certainly be useful. Bout time this was made.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Initrd.gz
Seasoned Helper


Joined: Sep 18 2008
Posts: 134
Location: Over there --->
Offline

PostPosted: Sun Apr 26, 2009 7:12 pm    Post subject: Reply to topic Reply with quote

Doesn't seem to be working:
Code: Show/Hide

python ../scripts/pymod-process.py ../build/ hostedgame/hgcore.h hostedgame/optparser.h hs_util/ast.h hs_util/formula.h hs_util/kill.h hs_util/menu.h hs_util/parser.h hs_util/selfpos.h include/app.h include/arenaman.h include/asss.h include/balls.h include/banners.h include/billing.h include/bricks.h include/brickwriter.h include/bwlimit.h include/capman.h include/cfghelp.h include/chat.h include/chatnet.h include/clientset.h include/cmdman.h include/cmod.h include/config.h include/core.h include/db_layout.h include/defs.h include/encrypt.h include/fake.h include/fg_turf.h include/fg_wz.h include/filetrans.h include/flagcore.h include/game.h include/idle.h include/jackpot.h include/koth.h include/lagdata.h include/log_file.h include/logman.h include/mainloop.h include/mapdata.h include/mapnewsdl.h include/md5.h include/module.h include/net-client.h include/net.h include/objects.h include/obscene.h include/param.h include/pathutil.h include/periodic.h include/persist.h include/player.h include/prng.h include/protutil.h include/pwcache.h include/redirect.h include/reldb.h include/rwlock.h include/sizes.h include/statcodes.h include/stats.h include/util.h include/watchdamage.h include/win32compat.h packets/balls.h packets/banners.h packets/billing.h packets/brick.h packets/chat.h packets/clientset.h packets/flags.h packets/goarena.h packets/green.h packets/kill.h packets/koth.h packets/login.h packets/loginresp.h packets/mapfname.h packets/objects.h packets/pdata.h packets/ppk.h packets/reliable.h packets/scoreupd.h packets/shipchange.h packets/simple.h packets/speed.h packets/timesync.h packets/types.h packets/watchdamage.h turf/turf_reward.h
Traceback (most recent call last):
  File "../scripts/pymod-process.py", line 1519, in <module>
    apply(func, m.groups())
  File "../scripts/pymod-process.py", line 1276, in finish
    code.extend(generate_getset_code(tp))
  File "../scripts/pymod-process.py", line 1229, in generate_getset_code
    """ % typ.to_obj('*ptr')
AttributeError: type_void instance has no attribute 'to_obj'
make: *** [../build/py_types.inc] Error 1
bash$ make
gcc -std=gnu99 -pipe -I. -Iinclude -I../build  -Ihs_util -D_REENTRANT -D_GNU_SOURCE -fPIC -g -Wall   -I/usr/include/python2.6 -c -o ../build/pymod.o pymod/pymod.c
pymod/pymod.c: In function 'mthd_call_callback':
pymod/pymod.c:803: error: 'py_cb_caller' undeclared (first use in this function)
pymod/pymod.c:803: error: (Each undeclared identifier is reported only once
pymod/pymod.c:803: error: for each function it appears in.)
pymod/pymod.c:803: error: expected ';' before 'func'
pymod/pymod.c:815: error: 'func' undeclared (first use in this function)
pymod/pymod.c:815: error: 'py_cb_callers' undeclared (first use in this function)
pymod/pymod.c:821: warning: implicit declaration of function 'func'
pymod/pymod.c:821: warning: assignment makes pointer from integer without a cast
pymod/pymod.c: In function 'mthd_get_interface':
pymod/pymod.c:864: error: 'pyint_ints' undeclared (first use in this function)
pymod/pymod.c: In function 'mthd_reg_interface':
pymod/pymod.c:950: error: 'pyint_impl_ints' undeclared (first use in this function)
pymod/pymod.c: In function 'init_asss_module':
pymod/pymod.c:1598: warning: implicit declaration of function 'ready_generated_types'
pymod/pymod.c:1608: warning: implicit declaration of function 'add_type_objects_to_module'
pymod/pymod.c: In function 'MM_pymod':
pymod/pymod.c:1776: warning: implicit declaration of function 'init_py_callbacks'
pymod/pymod.c:1777: warning: implicit declaration of function 'init_py_interfaces'
pymod/pymod.c:1836: warning: implicit declaration of function 'deinit_py_interfaces'
pymod/pymod.c:1837: warning: implicit declaration of function 'deinit_py_callbacks'
make: *** [../build/pymod.o] Error 1
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun May 03, 2009 5:45 pm    Post subject: Reply to topic Reply with quote

oh right, your pymod_process.py needs to have this added to type_void
Code: Show/Hide
class type_void(type_gen):
   def decl(me, s):
        return 'void ' + s
   def to_obj(me, s):
      return 'PyCObject_FromVoidPtr(ptr, NULL)'
   def from_obj(me, s):
      return '*(int *)PyCObject_AsVoidPtr(%s)' % s
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Initrd.gz
Seasoned Helper


Joined: Sep 18 2008
Posts: 134
Location: Over there --->
Offline

PostPosted: Fri May 08, 2009 11:24 pm    Post subject: Reply to topic Reply with quote

Now I get a ton of errors with pymod.c.

Heres the log




A log of errors with pymod.c

err.log - 25.27 KB
File downloaded or viewed 34 time(s)
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue May 12, 2009 8:27 am    Post subject: Reply to topic Reply with quote

Ah yes, until the pyinclude directive makes it downstream you'll need to
Code: Show/Hide
#include "hosted/hgcore.h"
in pymod.c
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 636 page(s) served in previous 5 minutes.

phpBB Created this page in 0.507148 seconds : 33 queries executed (80.8%): GZIP compression disabled