From 105e0bfb3c23e3ae595b7877da516242cc62135b Mon Sep 17 00:00:00 2001 From: Trilarion Date: Wed, 7 Aug 2019 13:36:53 +0200 Subject: [PATCH] some conversions of repositories to Git --- docs/data.json | 14 +- games/_action.md | 4 +- games/_all.md | 6 +- games/_tool.md | 2 +- games/dfend_reloaded.md | 4 +- games/freedoom.md | 5 +- games/open_city.md | 2 +- games/scrabble3d.md | 2 +- games/sengoku_warring_states_of_japan.md | 5 +- games/tumiki_fighters.md | 5 +- games/xpilot.md | 2 +- games/yo_frankie.md | 2 + statistics.md | 33 ++-- template.md | 2 +- tools/archives.json | 9 +- tools/{ => conversions}/aatraders.json | 0 .../aatraders_source_release_to_git.py | 0 .../dfend_reloaded_source_releases_to_git.py | 150 ++++++++++++++++++ .../dungeon_crawl_source_releases_to_git.py | 2 +- .../lechemindeladam_svn_to_git.py | 2 +- tools/{ => conversions}/phaos.json | 0 .../phaos_source_release_to_git.py | 1 - tools/is_already_included.py | 4 +- tools/list_python_external_imports.py | 2 +- 24 files changed, 207 insertions(+), 51 deletions(-) rename tools/{ => conversions}/aatraders.json (100%) rename tools/{ => conversions}/aatraders_source_release_to_git.py (100%) create mode 100644 tools/conversions/dfend_reloaded_source_releases_to_git.py rename tools/{ => conversions}/dungeon_crawl_source_releases_to_git.py (99%) rename tools/{ => conversions}/lechemindeladam_svn_to_git.py (99%) rename tools/{ => conversions}/phaos.json (100%) rename tools/{ => conversions}/phaos_source_release_to_git.py (99%) diff --git a/docs/data.json b/docs/data.json index fd0728c0..0aee74db 100644 --- a/docs/data.json +++ b/docs/data.json @@ -750,7 +750,7 @@ "Link", "mature / inactive since 2015", "tool, frontend", - "Pascal - GPL" + "Source - Pascal - GPL-3.0" ], [ "DNT (home, entry)", @@ -1334,7 +1334,7 @@ "Link", "beta / active", "action, engine required", - "Source - Python - BSD" + "Source - Not applicable - Not applicable" ], [ "FreedroidRPG (home, entry)", @@ -2414,7 +2414,7 @@ "Link", "beta / active", "simulation", - "Source - C++ - GPL-2.0" + "Source - C++ - GPL-2.0" ], [ "OpenClonk (home, entry)", @@ -2966,7 +2966,7 @@ "", "mature / inactive since 2015", "strategy, board game", - "Source - Pascal - GPL-3.0" + "Source - Pascal - GPL-3.0" ], [ "Scrolling Game Development Kit 2 (home, entry)", @@ -2998,7 +2998,7 @@ "Link", "beta / inactive since 2008", "strategy", - "C++, Lua - MIT" + "Source - C++, Lua - MIT" ], [ "Sentient Storage (home, entry)", @@ -3534,7 +3534,7 @@ "Link", "mature / inactive since 2005", "action, shooter", - "D - 2-clause BSD" + "Source - D, C++ - 2-clause BSD" ], [ "Turious (home, entry)", @@ -3878,7 +3878,7 @@ "Link", "mature / inactive since 2010", "action, space", - "Source - C - GPL-2.0" + "Source - C - GPL-2.0" ], [ "XSera (home, entry)", diff --git a/games/_action.md b/games/_action.md index 212f8c9e..34214dbb 100644 --- a/games/_action.md +++ b/games/_action.md @@ -22,7 +22,7 @@ - **[Chromium B.S.U.](chromium_bsu.md)** (C++, Artistic License, mature) - **[CommandoJS](commando_js.md)** (JavaScript, CoffeeScript, MIT, beta, inactive since 2012) - **[Epiar](epiar.md)** (C, C++, Lua, GPL-2.0, beta) -- **[Freedoom](freedoom.md)** (Python, BSD, beta) +- **[Freedoom](freedoom.md)** (Not applicable, Not applicable, beta) - **[GDash](gdash.md)** (C++, MIT, beta) - **[GLtron](gltron.md)** (C, GPL, beta, inactive since 2016) - **[GPL Arcade Volleyball](gpl_arcade_volleyball.md)** (C++, GPL-2.0, beta, inactive since 2006) @@ -61,7 +61,7 @@ - **[SuperTuxKart](supertuxkart.md)** (C++, C, GPL-3.0, mature) - **[The Legend of Edgar](the_legend_of_edgar.md)** (C, GPL-2.0, mature) - **[Tremulous](tremulous.md)** (C, GPL-2.0, mature, inactive since 2016) -- **[Tumiki Fighters](tumiki_fighters.md)** (D, 2-clause BSD, mature, inactive since 2005) +- **[Tumiki Fighters](tumiki_fighters.md)** (D, C++, 2-clause BSD, mature, inactive since 2005) - **[Tux Racer](tux_racer.md)** (C, GPL-2.0, beta, inactive since 2001) - **[UltraStar](ultrastar.md)** (Pascal, ?, mature, inactive since 2010) - **[Unvanquished](unvanquished.md)** (C++, GPL-3.0, mature) diff --git a/games/_all.md b/games/_all.md index 5eac9bea..c367bad5 100644 --- a/games/_all.md +++ b/games/_all.md @@ -93,7 +93,7 @@ - **[Crossfire](crossfire.md)** (C, Java, GPL-2.0, mature) - **[Crown and Cutlass](crown_and_cutlass.md)** (C++, Custom, beta, inactive since 2009) - **[Crypto++](crypto.md)** (C++, Boost-1.0, mature) -- **[D-Fend Reloaded](dfend_reloaded.md)** (Pascal, GPL, mature, inactive since 2015) +- **[D-Fend Reloaded](dfend_reloaded.md)** (Pascal, GPL-3.0, mature, inactive since 2015) - **[DNT](dnt.md)** (C++, GPL-3.0, beta, inactive since 2016) - **[DRL](drl.md)** (Lua, Pascal, GPL-2.0, mature) - **[Daimonin](daimonin.md)** (C, GPL-2.0, mature) @@ -166,7 +166,7 @@ - **[Freeciv WebGL](freeciv_web.md)** (JavaScript, Java, AGPL-3.0, mature) - **[Freeciv](freeciv.md)** (C, GPL-2.0, mature) - **[Freedink](freedink.md)** (C++, GPL-3.0, mature) -- **[Freedoom](freedoom.md)** (Python, BSD, beta) +- **[Freedoom](freedoom.md)** (Not applicable, Not applicable, beta) - **[FreedroidRPG](freedroid.md)** (C, GPL-2.0, mature) - **[Freeminer](freeminer.md)** (C++, Lua, GPL-3.0, beta) - **[Freeserf](freeserf.md)** (C++, GPL-3.0, beta) @@ -441,7 +441,7 @@ - **[Tressette](tresette.md)** (?, ?, mature, inactive since 2017) - **[Trinity Reign](trinity_reign.md)** (C++, GPL-3.0, beta, inactive since 2013) - **[TripleA](triplea.md)** (Java, GPL-2.0, mature) -- **[Tumiki Fighters](tumiki_fighters.md)** (D, 2-clause BSD, mature, inactive since 2005) +- **[Tumiki Fighters](tumiki_fighters.md)** (D, C++, 2-clause BSD, mature, inactive since 2005) - **[Turious](turious.md)** (C, GPL-3.0, beta, inactive since 2014) - **[Turn of War](turn_of_war.md)** (Java, GPL-3.0, beta) - **[Tux Football](tux_football.md)** (C++, GPL-2.0, beta, inactive since 2012) diff --git a/games/_tool.md b/games/_tool.md index f2aab272..39fc52d1 100644 --- a/games/_tool.md +++ b/games/_tool.md @@ -2,7 +2,7 @@ # Tool - **[AutoREALM](autorealm.md)** (C++, GPL-3.0, mature) -- **[D-Fend Reloaded](dfend_reloaded.md)** (Pascal, GPL, mature, inactive since 2015) +- **[D-Fend Reloaded](dfend_reloaded.md)** (Pascal, GPL-3.0, mature, inactive since 2015) - **[Deity](deity.md)** (Python, GPL-2.0, mature, inactive since 2014) - **[Doxygen](doxygen.md)** (C++, GPL-2.0, mature) - **[Dungeon Mapper](dungeon_mapper.md)** (C++, GPL-3.0, beta, inactive since 2013) diff --git a/games/dfend_reloaded.md b/games/dfend_reloaded.md index 80e7a25b..54a1df9e 100644 --- a/games/dfend_reloaded.md +++ b/games/dfend_reloaded.md @@ -7,8 +7,8 @@ _Graphical environment for DOSBox._ - Download: http://dfendreloaded.sourceforge.net/Download.html, https://sourceforge.net/projects/dfendreloaded/files/D-Fend%20Reloaded/ - Platform: Windows - Keywords: tool, frontend -- Code repository: (see download) +- Code repository: https://github.com/Trilarion/D-Fend-Reloaded.git (import of source releases) - Code language: Pascal -- Code license: GPL +- Code license: GPL-3.0 ## Building diff --git a/games/freedoom.md b/games/freedoom.md index 1914cc9e..b90cb7b4 100644 --- a/games/freedoom.md +++ b/games/freedoom.md @@ -9,9 +9,10 @@ _Open content for the Doom engine._ - Platform: Windows, Linux, macOS (all that are supported by the Doom engine) - Keywords: action, engine required - Code repository: https://github.com/freedoom/freedoom.git -- Code language: Python -- Code license: BSD +- Code language: Not applicable (only content) +- Code license: Not applicable (only content) - Code dependencies: Doom engine, pillow +- Assets license: 3-clause BSD ## Building diff --git a/games/open_city.md b/games/open_city.md index 01cc633a..0b8168e3 100644 --- a/games/open_city.md +++ b/games/open_city.md @@ -7,7 +7,7 @@ _Another 3D city simulator._ - State: beta - Download: http://www.opencity.info/en/Download.html - Keywords: simulation -- Code repository: https://svn.code.sf.net/p/opencity/code/ (svn), https://sourceforge.net/p/opencity/cvs/ (cvs) +- Code repository: https://gitlab.com/osgames/opencity.git (combination of cvs and svn), https://svn.code.sf.net/p/opencity/code/ (svn), https://sourceforge.net/p/opencity/cvs/ (cvs) - Code language: C++ - Code license: GPL-2.0 diff --git a/games/scrabble3d.md b/games/scrabble3d.md index b7a7ae2c..ba698e1a 100644 --- a/games/scrabble3d.md +++ b/games/scrabble3d.md @@ -7,7 +7,7 @@ _Board game with the goal to place letters on the board like in crosswords._ - Download: (see home) - Platform: Windows, Linux, macOS - Keywords: strategy, board game -- Code repository: https://svn.code.sf.net/p/scrabble/code/ (svn) +- Code repository: https://gitlab.com/osgames/scrabble3d.git, https://svn.code.sf.net/p/scrabble/code/ (svn) - Code language: Pascal - Code license: GPL-3.0 diff --git a/games/sengoku_warring_states_of_japan.md b/games/sengoku_warring_states_of_japan.md index 10f59095..5e48d501 100644 --- a/games/sengoku_warring_states_of_japan.md +++ b/games/sengoku_warring_states_of_japan.md @@ -6,11 +6,10 @@ _Something in-between of a turn-based/real-time strategy game set in Japan durin - State: beta, inactive since 2008 - Download: https://sourceforge.net/projects/sengdokuwsj/files - Keywords: strategy -- Code repository: (see download) +- Code repository: https://gitlab.com/osgames/sengoku.git (import of source releases) - Code language: C++, Lua - Code license: MIT - -Requires: SDL +- Code dependencies: SDL More like alpha. diff --git a/games/tumiki_fighters.md b/games/tumiki_fighters.md index 9e2f7a25..027bbdb2 100644 --- a/games/tumiki_fighters.md +++ b/games/tumiki_fighters.md @@ -7,10 +7,11 @@ _Side-scrolling shooter._ - State: mature, inactive since 2005 - Download: https://sourceforge.net/projects/tumiki/files/tumiki/ - Keywords: action, shooter -- Code repository: (see download) -- Code language: D +- Code repository: https://gitlab.com/osgames/tumiki.git (import of source releases) +- Code language: D, C++ - Code license: 2-clause BSD - Code dependencies: SDL ## Building +- Build system: Make diff --git a/games/xpilot.md b/games/xpilot.md index 583a052e..cd5debaf 100644 --- a/games/xpilot.md +++ b/games/xpilot.md @@ -8,7 +8,7 @@ _Multi-player 2D space game._ - Download: https://sourceforge.net/projects/xpilotgame/files/ - Platform: Windows, Linux - Keywords: action, space -- Code repository: http://hg.code.sf.net/p/xpilotgame/xpilotgame (hg), http://xpilotgame.cvs.sourceforge.net (cvs) +- Code repository: http://hg.code.sf.net/p/xpilotgame/www.xpilot.org (hg, website), http://xpilotgame.cvs.sourceforge.net (cvs) - Code language: C - Code license: GPL-2.0 diff --git a/games/yo_frankie.md b/games/yo_frankie.md index 3babd545..ee4ea52e 100644 --- a/games/yo_frankie.md +++ b/games/yo_frankie.md @@ -13,4 +13,6 @@ _Platform game._ - Code license: ? - Code dependencies: Blender game engine +[Download overview page](https://download.blender.org/apricot/) + ## Building diff --git a/statistics.md b/statistics.md index 65a21b26..931945b2 100644 --- a/statistics.md +++ b/statistics.md @@ -1,7 +1,7 @@ [comment]: # (autogenerated content, do not edit) # Statistics -analyzed 518 entries on 2019-08-05 17:03:54 +analyzed 518 entries on 2019-08-07 13:35:45 ## State @@ -17,10 +17,10 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D ##### Language frequency -- C++ (37.0%) +- C++ (37.1%) - C (20.2%) - Java (10.9%) -- Python (9.1%) +- Python (8.9%) - Lua (4.7%) - JavaScript (2.9%) - Pascal (2.8%) @@ -51,6 +51,7 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D - Game Maker Script (0.2%) - Groovy (0.2%) - Kotlin (0.2%) +- Not applicable (0.2%) - Ruby (0.2%) - Script (0.2%) - Swift (0.2%) @@ -62,7 +63,7 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D ##### Licenses frequency - GPL-2.0 (38.5%) -- GPL-3.0 (25.0%) +- GPL-3.0 (25.1%) - MIT (10.9%) - Custom (4.4%) - ? (2.7%) @@ -70,7 +71,7 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D - zlib (2.3%) - 3-clause BSD (2.1%) - LGPL-2.1 (2.1%) -- GPL (1.5%) +- GPL (1.3%) - AGPL-3.0 (1.1%) - LGPL-3.0 (1.0%) - LGPL-2.0 (0.8%) @@ -81,7 +82,6 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D - Boost-1.0 (0.4%) - ISC (0.4%) - MPL-2.0 (0.4%) -- BSD (0.2%) - CC-BY-NC (0.2%) - CC-BY-NC-SA (0.2%) - CC-BY-NC-SA-2.0 (0.2%) @@ -91,6 +91,7 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D - CC0 (0.2%) - LGPL (0.2%) - Ms-RL (0.2%) +- Not applicable (0.2%) - Proprietary (0.2%) - SWIG license (0.2%) @@ -203,12 +204,12 @@ Blobby Volley 2 (2017), Eat The Whistle (2017), PokerTH (2017), Scrolling Game D ## Code dependencies -With code dependency field 104 (20.1%) +With code dependency field 105 (20.3%) ##### Code dependencies frequency -- pygame (15.0%) -- SDL (12.5%) +- pygame (14.9%) +- SDL (12.9%) - numpy (3.5%) - pillow (3.5%) - wxPython (3.5%) @@ -296,17 +297,17 @@ With code dependency field 104 (20.1%) ## Build systems -Build systems information available for 24.5% of all projects. +Build systems information available for 24.7% of all projects. -##### Build systems frequency (127) +##### Build systems frequency (128) -- CMake (61.4%) -- Autoconf (15.7%) -- Make (4.7%) +- CMake (60.9%) +- Autoconf (15.6%) +- Make (5.5%) - Scons (3.9%) - setup.py (3.1%) -- Custom (2.4%) -- Gradle (2.4%) +- Custom (2.3%) +- Gradle (2.3%) - Ant (1.6%) - Maven (1.6%) - Lazarus project (0.8%) diff --git a/template.md b/template.md index 7bf3f4c3..10c64883 100644 --- a/template.md +++ b/template.md @@ -11,7 +11,7 @@ _{Description}_ - Keywords: {XX} (optional) - Code repository: {URL} - Code language: {XX} -- Code license: {XX} (optional) +- Code license: {XX} - Code dependencies: {XX} (optional) - Assets license: {XX} (optional) diff --git a/tools/archives.json b/tools/archives.json index 66efdbab..7fdc929a 100644 --- a/tools/archives.json +++ b/tools/archives.json @@ -143,6 +143,7 @@ "https://github.com/TASVideos/desmume.git", "https://github.com/TVTower/TVTower.git", "https://github.com/TobiasBielefeld/Simple-Solitaire.git", + "https://github.com/Trilarion/D-Fend-Reloaded.git", "https://github.com/Trilarion/mpango.git", "https://github.com/Trilarion/spacetraderjava.git", "https://github.com/Tuxemon/Tuxemon.git", @@ -433,6 +434,7 @@ "https://gitlab.com/osgames/murderpd.git", "https://gitlab.com/osgames/nxtank.git", "https://gitlab.com/osgames/openblox.git", + "https://gitlab.com/osgames/opencity.git", "https://gitlab.com/osgames/openrpg.git", "https://gitlab.com/osgames/openrpgmaker.git", "https://gitlab.com/osgames/openyahtzee.git", @@ -449,8 +451,10 @@ "https://gitlab.com/osgames/rogueclone.git", "https://gitlab.com/osgames/rpdungeon.git", "https://gitlab.com/osgames/rpge.git", + "https://gitlab.com/osgames/scrabble3d.git", "https://gitlab.com/osgames/sdl-asylum.git", "https://gitlab.com/osgames/sdl-sopwith.git", + "https://gitlab.com/osgames/sengoku.git", "https://gitlab.com/osgames/sge2d.git", "https://gitlab.com/osgames/sharpkonquest.git", "https://gitlab.com/osgames/skrupel.git", @@ -465,6 +469,7 @@ "https://gitlab.com/osgames/theclans.git", "https://gitlab.com/osgames/torcs.git", "https://gitlab.com/osgames/trophy.git", + "https://gitlab.com/osgames/tumiki.git", "https://gitlab.com/osgames/tuxfootball.git", "https://gitlab.com/osgames/tuxracer.git", "https://gitlab.com/osgames/uaf.git", @@ -503,10 +508,8 @@ "https://svn.code.sf.net/p/freesynd/code/", "https://svn.code.sf.net/p/fsc/code/", "https://svn.code.sf.net/p/lgames/code/", - "https://svn.code.sf.net/p/opencity/code/", "https://svn.code.sf.net/p/pio/code/", "https://svn.code.sf.net/p/planeshift/code/", - "https://svn.code.sf.net/p/scrabble/code/", "https://svn.code.sf.net/p/space-faring/code/", "https://svn.code.sf.net/p/spacezero/code/", "https://svn.code.sf.net/p/speed-dreams/code/", @@ -519,7 +522,7 @@ "http://hg.code.sf.net/p/grobots/trunk", "http://hg.code.sf.net/p/openblox/openblox", "http://hg.code.sf.net/p/phantasy/code", - "http://hg.code.sf.net/p/xpilotgame/xpilotgame", + "http://hg.code.sf.net/p/xpilotgame/www.xpilot.org (hg", "http://hg.libsdl.org/SDL", "https://bitbucket.org/Darthman/quad/src", "https://bitbucket.org/allacrost/allacrost/src", diff --git a/tools/aatraders.json b/tools/conversions/aatraders.json similarity index 100% rename from tools/aatraders.json rename to tools/conversions/aatraders.json diff --git a/tools/aatraders_source_release_to_git.py b/tools/conversions/aatraders_source_release_to_git.py similarity index 100% rename from tools/aatraders_source_release_to_git.py rename to tools/conversions/aatraders_source_release_to_git.py diff --git a/tools/conversions/dfend_reloaded_source_releases_to_git.py b/tools/conversions/dfend_reloaded_source_releases_to_git.py new file mode 100644 index 00000000..e76e0c61 --- /dev/null +++ b/tools/conversions/dfend_reloaded_source_releases_to_git.py @@ -0,0 +1,150 @@ +""" +Converts the source releases of D-Fend Reloaded to a Git. +""" + +import sys +import os +import shutil +import zipfile +import datetime +import subprocess +import re +import time + + +def subprocess_run(cmd): + """ + + """ + result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if result.returncode: + print("error {} in call {}".format(result.returncode, cmd)) + print(result.stderr.decode('ascii')) + sys.exit(-1) + else: + print(' output: {}'.format(result.stdout.decode('ascii'))) + + +def unzip(zip_file, destination_directory): + dirs = {} + + with zipfile.ZipFile(zip_file, 'r') as zip: + for info in zip.infolist(): + name, date_time = info.filename, info.date_time + name = os.path.join(destination_directory, name) + zip.extract(info, destination_directory) + + # still need to adjust the dt o/w item will have the current dt + date_time = time.mktime(info.date_time + (0, 0, -1)) + + if os.path.isdir(name): + # changes to dir dt will have no effect right now since files are + # being created inside of it; hold the dt and apply it later + dirs[name] = date_time + else: + os.utime(name, (date_time, date_time)) + + # done creating files, now update dir dt + for name in dirs: + date_time = dirs[name] + os.utime(name, (date_time, date_time)) + + +def single_release(zip): + """ + + """ + + # get version + matches = version_regex.findall(zip) + version = matches[0] + print(' version {}'.format(version)) + ftp_link = 'https://sourceforge.net/projects/dfendreloaded/files/D-Fend%20Reloaded/D-Fend%20Reloaded%20{}/'.format(version) + + # clear git path without deleting '.git' + for item in os.listdir(git_path): + # ignore '.git + if item == '.git': + continue + item = os.path.join(git_path, item) + if os.path.isdir(item): + shutil.rmtree(item) + else: + os.remove(item) + + # unpack zip to git path + # with zipfile.ZipFile(os.path.join(source_releases_path, zip), 'r') as zipf: + # zipf.extractall(git_path) + unzip(os.path.join(source_releases_path, zip), git_path) + + # get date from the files (latest of last modified) + latest_last_modified = 0 + for dirpath, dirnames, filenames in os.walk(git_path): + if dirpath.startswith(os.path.join(git_path, '.git')): + # not in '.git' + continue + for filename in filenames: + filepath = os.path.join(dirpath, filename) + lastmodified = os.path.getmtime(filepath) + if lastmodified > latest_last_modified: + latest_last_modified = lastmodified + # print('{}, {}'.format(filepath, datetime.datetime.fromtimestamp(latest_last_modified).strftime('%Y-%m-%d'))) + + original_date = datetime.datetime.fromtimestamp(latest_last_modified).strftime('%Y-%m-%d') + print(' last modified: {}'.format(original_date)) + + # update the git index (add unstaged, remove deleted, ...) + print('git add') + os.chdir(git_path) + subprocess_run(['git', 'add', '--all']) + + # perform the commit + print('git commit') + os.chdir(git_path) + message = 'version {} from {} ({})'.format(version, original_date, ftp_link) + print(' message "{}"'.format(message)) + subprocess_run(['git', 'commit', '--message={}'.format(message), '--author={}'.format(author), '--date={}'.format(original_date)]) + + +def recreate_directory(path): + """ + + """ + if os.path.isdir(path): + shutil.rmtree(path) + for attempts in range(10): + try: + os.mkdir(path) + except PermissionError: + time.sleep(0.1) + continue + else: + break + else: + raise RuntimeError() + +if __name__ == "__main__": + + # general properties + author = 'alexanderherzog ' + version_regex = re.compile(r"Reloaded-(.*)-", re.MULTILINE) + + # get paths + source_releases_path = sys.argv[1] + git_path = os.path.join(source_releases_path, 'git') + + # recreate git path + recreate_directory(git_path) + os.chdir(git_path) + subprocess_run('git init') + + # get all files in the source releases path and sort them + zips = os.listdir(source_releases_path) + zips = [file for file in zips if os.path.isfile(os.path.join(source_releases_path, file))] + print('found {} source releases'.format(len(zips))) + zips.sort() + + # iterate over them and do revisions + for counter, zip in enumerate(zips): + print('{}/{}'.format(counter, len(zips))) + single_release(zip) \ No newline at end of file diff --git a/tools/dungeon_crawl_source_releases_to_git.py b/tools/conversions/dungeon_crawl_source_releases_to_git.py similarity index 99% rename from tools/dungeon_crawl_source_releases_to_git.py rename to tools/conversions/dungeon_crawl_source_releases_to_git.py index 858b2ecc..bd630a88 100644 --- a/tools/dungeon_crawl_source_releases_to_git.py +++ b/tools/conversions/dungeon_crawl_source_releases_to_git.py @@ -1,5 +1,5 @@ """ - Helps me with importing source revisions into Git +Helps me with importing source revisions into Git """ import shutil diff --git a/tools/lechemindeladam_svn_to_git.py b/tools/conversions/lechemindeladam_svn_to_git.py similarity index 99% rename from tools/lechemindeladam_svn_to_git.py rename to tools/conversions/lechemindeladam_svn_to_git.py index ddb62c4e..c52c0d11 100644 --- a/tools/lechemindeladam_svn_to_git.py +++ b/tools/conversions/lechemindeladam_svn_to_git.py @@ -7,7 +7,7 @@ TODO instead of svn export for every revision, checkout and then update to revis """ import json - +import sys import psutil from utils.utils import * diff --git a/tools/phaos.json b/tools/conversions/phaos.json similarity index 100% rename from tools/phaos.json rename to tools/conversions/phaos.json diff --git a/tools/phaos_source_release_to_git.py b/tools/conversions/phaos_source_release_to_git.py similarity index 99% rename from tools/phaos_source_release_to_git.py rename to tools/conversions/phaos_source_release_to_git.py index e663463d..5197653b 100644 --- a/tools/phaos_source_release_to_git.py +++ b/tools/conversions/phaos_source_release_to_git.py @@ -6,7 +6,6 @@ import json import datetime from utils.utils import * - if __name__ == '__main__': # https://sourceforge.net/projects/phaosrpg/files/OldFiles/Pv0.7devel.zip/download is a corrupt zip diff --git a/tools/is_already_included.py b/tools/is_already_included.py index 27f96b87..33e01094 100644 --- a/tools/is_already_included.py +++ b/tools/is_already_included.py @@ -1,6 +1,6 @@ """ - Checks a list of game names (comma separated in text file) if they are already included in the database. - Is fuzzy, i.e. accepts a certain similarity of names. +Checks a list of game names (comma separated in text file) if they are already included in the database. +Is fuzzy, i.e. accepts a certain similarity of names. """ import json diff --git a/tools/list_python_external_imports.py b/tools/list_python_external_imports.py index 903c11ce..7d812462 100644 --- a/tools/list_python_external_imports.py +++ b/tools/list_python_external_imports.py @@ -1,5 +1,5 @@ """ -Where no requirements.txt or setup.py or other information is given, get an idea of the external dependencies +Where no requirements.txt or setup.py or other information is given for a Python project, get an idea of the external dependencies by parsing the Python files and looking for import statements. """