Tutorial python tools
9 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
9 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

ASILO st The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/ http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution: http://sourceforge.net/projects/jesms/ Tutorial of python tools Written by F.Camozzi, Asilo Manager, 2005 (C) Contacts: JeSMS Main Developer scotto_a@hotmail.com Asilo Managers asiloleague@gmail.com ASILO st The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/ http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution: http://sourceforge.net/projects/jesms/ Index Tutorial of python tools ................................................................................................................................................... 1 1 Introduction ................................................................................................................................................................. 3 2 Aim of tutorial .............................................................................. ...

Informations

Publié par
Nombre de lectures 43
Langue English

Extrait

ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/
Tutorial of python tools
Written by F.Camozzi, Asilo Manager, 2005 (C)
Contacts: JeSMS Main Developerscotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/IndexTutorial of python tools................................................................................................................................................... 11 Introduction ................................................................................................................................................................. 32 Aim of tutorial ............................................................................................................................................................. 33 Requirements ............................................................................................................................................................... 34 Execution of a python tool........................................................................................................................................... 5Figure 2: A python file ............................................................................................................................................... 5Figure 3: Execution of a python file in a DOS shell ................................................................................................... 55 Simulation of a week ................................................................................................................................................... 76 Updating a week .......................................................................................................................................................... 8Figure 10: Updating tool output directories in applet space ....................................................................................... 97 Insert rest week(s)........................................................................................................................................................ 9Figure 11: Appliyng 3 rest weeks to Day 1 ................................................................................................................ 9Figure 12: Subdirectories created by rest tool ............................................................................................................ 9
Contacts: JeSMS Main Developerscotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/1 Introduction I want to introduce this tutorial giving you a little hystorical background where the python tools that I will show in this document are born. In the 2003 the JesMS project began porting the ESMS software into JAVA language and using as standard inputs/outputs XML files. For testing this new game enviroment a PbEM soccer league was created and named ASILO. ASILO is the first league to test and use the Java EsMS (JesMS) but the aim of the software fonders is to spread and encourage the use of JEsMS for as many as possible leagues. Founders believe that JesMS is a significant improvement in managing a ESMS league and also it takes a more attractive graphical impact of the game. Anyway JEsMS group expresses a special thanks to the EsMS community that develops the soccer game engine and is trying to realize a more realistic simulation. All the feautures and descriptions of JEsMS are available at the web site http://asiloleague.altervista.org/jesms/while all the codes regarding JEsMS and python tools are distributed with GNU GPL license athttp://sourceforge.net/projects/jesms/It is mandatory to know a general view of JEsMS because all the python tools have been written starting from the enviroment built by JesMS. Python tools have been developed in such a way that managing of a JEsMS league is simplier and faster through the automatization of the common tasks that a league manager must face up to run its league. 2 Aim of tutorial This tutorial is written to give the possibility to anybody of having a quick easy start of a JEsMS league using the python tolols developed during the ASILO running. 3 Requirements In order to use the python tools you need on you machine: I.Last version of JAVA installed on your PC (download atwww.java.com) II.Last version of Python installed on your PC (download atwww.python.org) III.Last version of PyXML installed on your PC ( download athttp://sourceforge.net/projects/pyxml/) IV.Last version of JesMS, in particular the java file JesMS.jar must be present inside the work directory of simulations (download athttp://sourceforge.net/projects/jesms/) The last release of Python tools is present athttp://sourceforge.net/projects/jesms/), you have to put the python tools inside the work directory of simulations.
Contacts:Main Developer JeSMS scotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/Moreover as explained in the JesMS web site you must have in the work directory of simulations with the following XML input files of your league: ·The league files ·league.xml (configured with the parameters of the league) ·tactics.xml ·language.xml ·fixtures.xml (configured with the teams of the league) ·table.xml (configured with the teams of the league) st ·there will be also scorers.xml, performs.xml, assisters.xml, suspended.xml,If the day is not the 1 dps.xml and injured.xml i ·The roster files (for example atm.xml), note that the abbreviation of the teams must be the one present in the league.xml ·The teamsheets (for example atmsht.xml or the classic EsMS txt version atmsht.txt). If a teamsheet is not present anyway the simulation can go on with a standard 442N teamsheet automatically created by the python tool st In the figure 1 is shown the work directory at the 1 day of a league. Pay attention before to launch the python tools to have the updated league, roster and teamsheet files in the work directory.
st Figure 1: Work directory of the 1 day of a league
Contacts:Main Developer JeSMS scotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/4 Execution of a python tool There are 2 possible manners to execute a python tool that is file with extention.pyidentified in your PC by the “snake” icon on your PC once you have installed Python.
·
Figure 2: A python file
The first way to load and execute a python file is simplier but in case of bug does not permit the user to understand anything about what has been gone wrong. As shown in figure 2 you have only to select the python tool and double click with your mouse left button. Once you have performed the double cllick on the python tool you’ll see the program to run in a DOS shell like in figure 3.
Figure 3: Execution of a python file in a DOS shell
Contacts:Main Developer JeSMS scotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/·The other way to execute a python file is more robust. In fact the tool is loaded and ran in the python environment so the behaviour of python tool is always under the control of the language interpreter and any possible bug is detected and reported to user. To use this approach you have to click with your mouse right button on the python tool and choose the optionedit with idleas done in figure 4. Then you have to select the window with the program source and choose therun module option from the menu as indicated in figure 5. At this point the program will run in the Python shell as illustrated in figure 6.
Figure4: Load of a python file in python environment
Figure5: Run option selected in the python tool source window
Contacts: JeSMS Main Developerscotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/
Figure6: Execution of python tool in the python shellIf you experimented a bug during the execution of a tool try to run again the tool with the second way described above here and then report the bug with a little description or better an image of the error log in the python shell toasiloleague@gmail.com. 5 Simulation of a week The python tool you need to simulate a week isJetsim,its main characteristics are: ·It does not need any external input via console ·Automatically recognization of the day to play ·A list of checks performed on teamsheets and standard input XML files ·Generation of warning and errors in the console ·Automatically generation of 442N teamsheets in case of mistaken or missed teamsheet ·Automatically generation of a log of any matches played ·Cleaning of teamsheets by the conditionals for security reasons ·Sorting of output files About the last point the sort is made in figure 7 the structure of outputs is shown: it is present the log file in txt format and the output directory named as Day plus the number of the Day to be played.
Figure7: Simulation tool output directory in work space
Contacts:Main Developer JeSMS scotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/The day data directory contains 2 more directories one for the files that will be used by the applet and one with the original teamsheet used with the conditionals (see figure 8)
Figure8: Simulation tool output directories in data spaceThe simulation tool must be used alwaysbeforethe updating tool that must be executed always once a day has been simulated. The outputs of the tool must not be altered in any way. 6 Updating a week The python tool you need to update a week after its simulation a week isJetud,its main characteristics are: ·It does not need any external input via console ·Automatically recognization of the day to update ·A list of checks performed on inputs coming from the Jetsim tool executed before its running ·Save of data of the day before the updating ·Sorting of output files ·Automatically generation of zip file ready for the applet uploading The data directory after the execution of the tool is shown in figure 9:
Figure9: Updating tool output directories in data space
Contacts:Main Developer JeSMS scotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
ASILO st  The 1 League managed with JesMS JEsMS Site: http://asiloleague.altervista.org/GoMambo/http://asiloleague.altervista.org/jesms/ Codes development and GNU GPL licenced software distribution:http://sourceforge.net/projects/jesms/Moreover the Applet files is organized in accordance to applet directories format (see figure 10).
Figure 10: Updating tool output directories in applet space Therefore once the execution of updater is finished you have only to upload in the applet files the data content sorted in the directories League,Matches,Teams and Teamsheet. 7 Insert rest week(s) In the case you need to apply n rest week(s) to your league to reduce the injuries you can use theResttool to update the rosters, its main characteristics are: ·External inputs are the last week played and the number of rest week(s) to be applied ·Sorting of output files A directory named as last day with the week(s) applied is generated,going down the structure inside the applet files directory you will find the subdirectories League where the new injured file is placed while in the Teams directory the updated rosters are stored. See figure 11 and 12.
Figure 11: Appliyng 3 rest weeks to Day 1
Figure 12: Subdirectories created by rest tool
Contacts:Main Developer JeSMS scotto_a@hotmail.com Asilo Managersasiloleague@gmail.com
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents