-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ef5fff
commit 71017c2
Showing
23 changed files
with
222 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: pip install mkdocs-material | ||
- run: mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/__pycache__ | ||
src/tests | ||
credentials.json | ||
tokens.json | ||
token.json | ||
*.env | ||
/tests | ||
/__pycache__ |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
Empty file.
Empty file.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Welcome to MkDocs | ||
|
||
For full documentation visit [mkdocs.org](https://www.mkdocs.org). | ||
|
||
## Commands | ||
|
||
* `mkdocs new [dir-name]` - Create a new project. | ||
* `mkdocs serve` - Start the live-reloading docs server. | ||
* `mkdocs build` - Build the documentation site. | ||
* `mkdocs -h` - Print help message and exit. | ||
|
||
## Project layout | ||
|
||
mkdocs.yml # The configuration file. | ||
docs/ | ||
index.md # The documentation homepage. | ||
... # Other markdown pages, images and other files. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
site_name: GameFlow Connect | ||
repo_name: GitHub - GameFlow Connect | ||
repo_url: https://github.com/Germano123/python-gameflowconnect | ||
edit_uri: edit/main/documentation/ | ||
|
||
theme: | ||
name: material | ||
# logo: assets/logo.png | ||
# favicon: assets/favicon.ico | ||
palette: | ||
primary: "teal" | ||
accent: "cyan" | ||
font: | ||
text: "Roboto" | ||
code: "Roboto Mono" | ||
language: "en" | ||
icon: | ||
repo: fontawesome/brands/github | ||
edit: material/pencil | ||
view: material/eye | ||
features: | ||
- content.action.edit | ||
- header.autohide | ||
- navigation.tabs | ||
- navigation.path | ||
- navigation.prune | ||
- navigation.top | ||
|
||
extra: | ||
social: | ||
- icon: fontawesome/brands/instagram | ||
link: https://www.instagram.com/geh_m_gomes/ | ||
name: instagram | ||
- icon: fontawesome/brands/github | ||
link: https://github.com/Germano123 | ||
name: github | ||
|
||
nav: | ||
- Home: index.md | ||
- Getting Started: | ||
- Installation: 1 getting_started/1 installation.md | ||
- Usage Guide: 1 getting_started/2 usage.md | ||
- Requirements: 1 getting_started/3 requirements.md | ||
- Features: | ||
- Core Features: 2 features/1 core_features.md | ||
- Secondary Features: 2 features/2 secondary_features.md | ||
- Technical Details: | ||
- Architecture: 3 technical_details/1 architecture.md | ||
- UI Design: 3 technical_details/2 ui_design.md | ||
- Integrations: 3 technical_details/3 integrations.md | ||
- Collaboration: | ||
- Contributing Guide: 4 collaboration/1 contributing.md | ||
- Roadmap: 4 collaboration/2 roadmap.md | ||
- Changelog: 4 collaboration/3 changelog.md | ||
- Troubleshooting: troubleshooting.md | ||
- FAQ: faq.md | ||
|
||
markdown_extensions: | ||
- admonition | ||
- pymdownx.details | ||
|
||
copyright: Copyright © 2025 - Germano Gomes |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import os.path | ||
|
||
import google.auth | ||
from google.auth.transport.requests import Request | ||
from google.oauth2.credentials import Credentials | ||
from google_auth_oauthlib.flow import InstalledAppFlow | ||
from googleapiclient.discovery import build | ||
from googleapiclient.errors import HttpError | ||
from googleapiclient.http import MediaFileUpload | ||
|
||
def uploadfile(creds): | ||
# creds, _ = google.auth.default() | ||
try: | ||
service = build("drive", "v3", credentials=creds) | ||
file_metadata = { | ||
'name': 'fileName_to_be_in_drive.txt', | ||
} | ||
media = MediaFileUpload('test.txt', | ||
mimetype='*/*', | ||
resumable=True) | ||
file = ( | ||
service.files() | ||
.create(body=file_metadata, media_body=media, fields='id') | ||
.execute() | ||
) | ||
|
||
except HttpError as error: | ||
print(f"An error occurred: {error}") | ||
file = None | ||
|
||
# print ('File ID: ' + file.get('id')) | ||
|
||
# If modifying these scopes, delete the file token.json. | ||
SCOPES = ["https://www.googleapis.com/auth/drive"] | ||
|
||
def list_files(creds): | ||
try: | ||
service = build("drive", "v3", credentials=creds) | ||
|
||
# Call the Drive v3 API | ||
results = ( | ||
service.files() | ||
.list(pageSize=10, fields="nextPageToken, files(id, name)") | ||
.execute() | ||
) | ||
items = results.get("files", []) | ||
|
||
if not items: | ||
print("No files found.") | ||
return | ||
|
||
print("Files:") | ||
for item in items: | ||
print(f"{item['name']} ({item['id']})") | ||
except HttpError as error: | ||
# TODO(developer) - Handle errors from drive API. | ||
print(f"An error occurred: {error}") | ||
|
||
def main(): | ||
"""Shows basic usage of the Drive v3 API. | ||
Prints the names and ids of the first 10 files the user has access to. | ||
""" | ||
creds = None | ||
# The file token.json stores the user's access and refresh tokens, and is | ||
# created automatically when the authorization flow completes for the first | ||
# time. | ||
if os.path.exists("token.json"): | ||
creds = Credentials.from_authorized_user_file("token.json", SCOPES) | ||
# If there are no (valid) credentials available, let the user log in. | ||
if not creds or not creds.valid: | ||
if creds and creds.expired and creds.refresh_token: | ||
creds.refresh(Request()) | ||
else: | ||
flow = InstalledAppFlow.from_client_secrets_file( | ||
"credentials.json", SCOPES | ||
) | ||
creds = flow.run_local_server(port=0) | ||
# Save the credentials for the next run | ||
with open("token.json", "w") as token: | ||
token.write(creds.to_json()) | ||
|
||
# list_files(creds) | ||
uploadfile(creds) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from github import Github | ||
from github import Auth | ||
|
||
from dotenv import load_dotenv | ||
import os | ||
|
||
load_dotenv() | ||
access_token = os.getenv("ACCESS_TOKEN") | ||
|
||
# using an access token | ||
auth = Auth.Token(access_token) | ||
|
||
# Public Web Github | ||
g = Github(auth=auth) | ||
|
||
for repo in g.get_user().get_repos(): | ||
print(repo.name) | ||
# to see all the available attributes and methods | ||
# print(dir(repo)) | ||
|
||
g.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters