Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REsolves some edge cases for a few apps and adds automated workflow template for autobuilding if desired #55

Merged
merged 5 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Python package

on:
push:
branches: [ readlocal ]
pull_request:
branches: [ readlocal ]

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x86'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
py -3.7-32 -m pip install --upgrade pip
py -3.7-32 -m pip install -r requirements/dev.txt
py -3.7-32 -m pip install -r requirements/dev.txt --target ./src/
#- name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test and create code coverage
shell: cmd
run: coverage.bat
#- name: Zip Release
# uses: TheDoctor0/zip-release@v0.3.0
# with:
# Filename for archive
# filename: importer_97543122-7785-4444-2254-711233556699.zip
# Base path for archive files
# path: .
# Working directory before zipping
# directory: .
- name: Create zip archive
shell: bash
env:
ZIP_NAME: itch_v0.0.5
run: |
7z a ${ZIP_NAME}.zip ./src/*
- name: Upload result
uses: actions/upload-artifact@v1
with:
name: gog-galaxy-itch.io_ ${{ github.sha }}
path: itch_v0.0.5.zip
- name: Automatic Releases
uses: marvinpinto/action-automatic-releases@latest
with:
# GitHub secret token
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Git tag (for automatic releases)
automatic_release_tag: Prototype_${{ github.sha }}
# Should this release be marked as a pre-release?
prerelease: True
# Release title (for automatic releases)
title: Prototype_${{ github.sha }}
# Assets to upload to the release
files: itch_v0.0.5.zip
3 changes: 2 additions & 1 deletion src/itch.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ def tick(self) -> None:
# self.add_game(my_game_sending)
# my_counter = my_counter+1

my_mod_delta = math.floor(time_delta_seconds/7)
my_counter = 0
while my_counter < 501 and not self.myLocalClientDbReader.my_queue_update_local_game_status.empty():
while my_mod_delta > 0 and my_counter < 101 and not self.myLocalClientDbReader.my_queue_update_local_game_status.empty():
my_game_update_sending = self.myLocalClientDbReader.my_queue_update_local_game_status.get()
logging.error(my_game_update_sending)
self.update_local_game_status(my_game_update_sending)
Expand Down
10 changes: 9 additions & 1 deletion src/localClientDbReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ async def launch_game(self, game_id: str) -> None:
start = int(time.time())
logging.info(resp["basePath"])
logging.info(resp["candidates"][0]["path"])
proc = await asyncio.create_subprocess_shell(os.path.join(resp["basePath"], resp["candidates"][0]["path"]))
my_full_path=os.path.join(resp["basePath"], resp["candidates"][0]["path"])
my_base_path=os.path.split(my_full_path)[0]
#proc = await os.system("%windir%\\Sysnative\\cmd.exe /c \""+os.path.join(resp["basePath"], resp["candidates"][0]["path"])+"\"")
#proc = await asyncio.create_subprocess_shell("%windir%\\Sysnative\\cmd.exe /c \""+os.1path.join(resp["basePath"], resp["candidates"][0]["path"])+"\"")
my_command = "%windir%\\Sysnative\\cmd.exe /c \"cd /d \""+my_base_path+"\" && \""+my_full_path+"\"\""
logging.info(my_command)
proc = await asyncio.create_subprocess_shell(
my_command
)

await proc.communicate() # wait till terminates
end = int(time.time())
Expand Down