Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Add linux correct path in file open Attempt#3
Browse files Browse the repository at this point in the history
  • Loading branch information
doctorixx committed Aug 5, 2024
1 parent 82c7022 commit d5b3ce2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import math
import os
import sys

import numpy as np
from stl import mesh
Expand All @@ -11,6 +13,13 @@
from .utils import *


def get_current_executable_directory():
if getattr(sys, 'frozen', False):
return os.path.dirname(os.path.realpath(sys.executable))

return os.getcwd()


def process_github_stats(username, year, filename):
contributions = get_contributions(username, year)
contribution_array = generate_contribution_array(contributions)
Expand All @@ -23,7 +32,11 @@ def process_github_stats(username, year, filename):
to_export = mesh.Mesh(numpy.concatenate([body.data, letters.data, year_obj.data, github_logo.data]))
to_export.rotate([0, 0, 1], math.radians(180))

to_export.save(filename)
path = os.path.join(
get_current_executable_directory(), filename
)

to_export.save(path)


def process_text(text, filename):
Expand Down

0 comments on commit d5b3ce2

Please sign in to comment.