Hello & Welcome to our community. Is this your first visit? Register
  • News & Announcements
      As a counter measurement to Ad spam, newly registered users are required to create a thread in the Introduction Forum before allowing to be able to reply and create threads.
      Please allow some time for posts to be approved. We thank you for your patience on this matter.
Bookmark Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Shinmai Shosa (新米少佐) prkc's Avatar
    Join Date
    Aug 2014
    Posts
    11
    Rep
    3
    Mentioned
    0 Post(s)

    [Tool] HTML shiplist generator

    Hi!

    I don't really like the in-game ui to view your ship collection, so I've written a python script which generates a nice HTML page with all your ships/fleets.
    You can also list all ships, so you can see which ships do you have / not have (ships you don't have are listed with a darker background, optionally)

    Here are some example screenshots (generated by two different configs):
    Imgur

    How it works:
    * It grabs the ship data and images from the wiki
    * You list your ships in a config file (you can change some other options here too)
    * Based on the config file and the downloaded data, it generates a html page
    * You have to manually write your ships' names into the config file, it does not connect to the game

    You can put this html and the data on any hosting/server, it is static html so there is no requirement for php or database or anything really

    You'll need:
    * Python 3 (only required on non-windows platforms, there is a standalone .exe for windows)
    * Imagemagick, specifically the 'convert' utility (this is only needed if you redownload the data from the wiki)
    I've included recent data in the archive so you DON'T have to redownload the data (downloading the data can place heavy load on the wiki since it downloads all ship pages, so use sparingly)

    How to run:
    * Customize the config file (it's a simple text file)
    * For generating html: python ./kancolle-html-shiplist.py config-file-name gen_html output-html-filename
    This will only work if there is ship data in the data/ folder, it won't download the data automatically
    The generated file will be saved to the data/ folder
    * For downloading the data: python ./kancolle-html-shiplist.py config-file-name get_data
    * You can customize the HTML/CSS templates in the data dir

    How to run (on Windows):
    * There is a standalone .exe file which you can run from the command line called kancolle-html-shiplist.exe
    So open a command line (cmd.exe), go to the directory which contains the .exe and then run
    kancolle-html-shiplist.exe config-file-name gen_html output-html-filename (for example: kancolle-html-shiplist.exe config.txt gen_html index.html)
    * This works exactly like the python script, all parameters are the same
    * You can still use the Python script version on Windows too, if you have Python 3 installed
    * I didn't test this standalone .exe much (only in WINE) since I don't use Windows, hope it works

    Download:
    https://drive.google.com/folderview?...EU&usp=sharing (select the most recent version then click on the download button at the top)

    Let me know what you think. If there is interest, I'll put the code on github. Patches & suggestions are very welcome.

    Github: https://github.com/prkc/kancolle-html-shiplist



  2. #2
    Commander Pythe's Avatar
    Join Date
    Jun 2014
    Posts
    267
    Rep
    8
    Mentioned
    20 Post(s)

    Re: [TOOL] HTML shiplist generator

    uhh.. so the tool updates itself using the wiki's data?
    what about if new ships are implemented? do we get to update the tool too?

    also code on github please.



  3. #3
    Shinmai Shosa (新米少佐) prkc's Avatar
    Join Date
    Aug 2014
    Posts
    11
    Rep
    3
    Mentioned
    0 Post(s)

    Re: [TOOL] HTML shiplist generator

    @Pythe The tool can download data from the wiki
    When new ships are implemented (and added to the wiki) you can run the command (see README) to redownload the data, you don't have to update the tool

    Edit: I've put everything on github: https://github.com/prkc/kancolle-html-shiplist



  4. #4
    Shinmai Shosa (新米少佐)
    Join Date
    Apr 2014
    Posts
    2
    Rep
    0
    Mentioned
    0 Post(s)

    Re: [TOOL] HTML shiplist generator

    Got these errors when in Windows
    Code:
    C:\Users\xxx\Desktop\kancolle-html-shiplist> kancolle-html-shiplist.exe config
    .txt gen_html index.html
    Traceback (most recent call last):
      File "boot_common.py", line 46, in <module>
    ImportError: No module named 'ctypes'
    Traceback (most recent call last):
      File "kancolle-html-shiplist.py", line 315, in <module>
        generate_html(config,sys.argv[3])
      File "kancolle-html-shiplist.py", line 307, in generate_html
        f1.write(index_str)
      File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
    UnicodeEncodeError: 'charmap' codec can't encode character '\u0110' in position
    61971: character maps to <undefined>



  5. #5
    Rear-Admiral velocius's Avatar
    Join Date
    Nov 2014
    Posts
    1,166
    Rep
    23
    Mentioned
    64 Post(s)

    Re: [TOOL] HTML shiplist generator

    @prkc this is what i have been looking for :P. the errors i get seem to be high on the noob ladder though. i must be doing something wrong. i am following your windows guide. there is ship girls images in the data folder.

    C:\Users\andy.poelvoorde\Downloads\kancolle-html-shiplist\kancolle-html-shiplist
    >kancolle-html-shiplist.exe config.txt gen_html index.html
    Traceback (most recent call last):
    File "boot_common.py", line 46, in <module>
    ImportError: No module named 'ctypes'
    Traceback (most recent call last):
    File "kancolle-html-shiplist.py", line 315, in <module>
    generate_html(config,sys.argv[3])
    File "kancolle-html-shiplist.py", line 240, in generate_html
    encountered_ships = get_ships_from_names(config["encountered_ships"])
    KeyError: 'encountered_ships'



  6. #6
    Shinmai Shosa (新米少佐) prkc's Avatar
    Join Date
    Aug 2014
    Posts
    11
    Rep
    3
    Mentioned
    0 Post(s)

    Re: [TOOL] HTML shiplist generator

    @christantoan, @velocius
    Thanks for your feedback, I've found some bugs with the windows version and now fixed them.
    I've updated the link in the OP for the new version, please download & try it again



  7. #7
    Rear-Admiral velocius's Avatar
    Join Date
    Nov 2014
    Posts
    1,166
    Rep
    23
    Mentioned
    64 Post(s)

    Re: [TOOL] HTML shiplist generator

    @prkc it works :D.

    but i already have a request.

    can you order the list by how i enter them in config file?

    i am entering them on my collection rate, so the config looks like

    #The ships you currently have
    active_ships=Samidare Kai, Isonami Kai, Arashio Kai
    #All ships you had (you don't have to repeat your active ships here, but it won't cause problems if you do)
    encountered_ships=Samidare

    i'd like the webpage to be able to be ordered like that. would it be possible to base your ordering of that (with another option in config file that decides order (number, config))

    (encountered ships would go behind active ships)

    it's not something i need, but it would be nice to have :D.


    small sidenote i have found, the list can't have leading or trailing spaces spaces. makes sense in hindsight but i was wondering why only the first ship worked.



    another weird thing i found,

    Nachi Kai2,Ashigara Kai2,Haguro Kai Ni

    Since you fetch this from the wiki, is the wiki inconsistent?


    Is there a fix for Hibiki Kai ni?

    she gives the following error

    UnicodeDecodeError: 'utf-8' codec can't decode byte 0x84 in position 1258: invalid start byte

    the wiki name is ВерныР¹, Verniy doesn't work and russion in ze config file confuses my windows or your app.



  8. #8
    Shinmai Shosa (新米少佐) prkc's Avatar
    Join Date
    Aug 2014
    Posts
    11
    Rep
    3
    Mentioned
    0 Post(s)

    Re: [TOOL] HTML shiplist generator

    @velocius
    New version is uploaded
    I've added new config key: ship_order, value can be num or config
    Leading/trailing spaces now work in lists

    The wiki data is indeed inconsistent in some places, now I've added a workaround: in all ship names, Kai2 and Kai 2 are replaced with Kai Ni
    in the config file you should always write the proper ship names (Kai Ni)



  9. #9
    Rear-Admiral velocius's Avatar
    Join Date
    Nov 2014
    Posts
    1,166
    Rep
    23
    Mentioned
    64 Post(s)

    Re: [TOOL] HTML shiplist generator

    @prkc your fast. Thanks :D.

    i edited my post with a Hibiki error. not sure how that can be fixed unless you do a sort of patch for her only? or do i need to install rusian language packs on my pc?



  10. #10
    Shinmai Shosa (新米少佐) prkc's Avatar
    Join Date
    Aug 2014
    Posts
    11
    Rep
    3
    Mentioned
    0 Post(s)

    Re: [TOOL] HTML shiplist generator

    @velocius
    Try editing/saving the config file using utf-8 encoding, I don't think you can do this in notepad but more advanced editors support this, and then it should recognize the russian name.
    I think I will still add a workaround for the next version (so it accepts Verniy).

    Edit:
    another thing you can do is edit data/shipdata.txt, find all occurrences of
    \xd0\x92\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9
    (this is the russian name, just encoded)
    and replace it with the name you want to use



 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT. The time now is 11:05 PM.
Powered by vBulletin® Version 4.2.2
Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.
Resources saved on this page: MySQL 8.70%
vBulletin Optimisation provided by vB Optimise v2.6.3 (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Thread / Post Bookmarks provided by Thread / Post Bookmarking v1.1.1pl1 (Free) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd. Runs best on HiVelocity Hosting.
Live Threads provided by AJAX Threads (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
vBulletin Skin By: PurevB.com