File tree Expand file tree Collapse file tree 6 files changed +70
-8
lines changed
Expand file tree Collapse file tree 6 files changed +70
-8
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ All notable changes to this project will be documented in this file.
77The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
88and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
99
10+ ## [ 0.2.1] - 2024-02-16
11+
12+ ### Added
13+ - Added build script for PyInstaller
14+
15+ ### Changed
16+ - Replaced the use of PyFiglet for an simplified ASCII art banner
17+
1018## [ 0.2.0] - 2024-02-16
1119
1220### Added
Original file line number Diff line number Diff line change 1+ import os
2+ import platform
3+ import subprocess
4+
5+ def build ():
6+ # Determine the platform-specific separator
7+ is_windows = platform .system () == "Windows"
8+ separator = ";" if is_windows else ":"
9+
10+ # Base command
11+ cmd = [
12+ "pyinstaller" ,
13+ "--name=devtool" ,
14+ "--onefile" ,
15+ "--clean" ,
16+ f"--add-data=config{ separator } config" ,
17+ "--hidden-import=rich" ,
18+ "--hidden-import=questionary" ,
19+ "--collect-all=pyfiglet" ,
20+ ]
21+
22+ # Add icon according the platform
23+ #if is_windows:
24+ # cmd.append("--icon=assets/icon.ico")
25+ #else:
26+ # cmd.append("--icon=assets/icon.png")
27+
28+ # Add the main file
29+ cmd .append ("src/main.py" )
30+
31+ # Execute the command
32+ subprocess .run (cmd )
33+
34+ if __name__ == "__main__" :
35+ build ()
Original file line number Diff line number Diff line change 66
77setup (
88 name = "devtooling-cli" ,
9- version = "0.2.0 " ,
9+ version = "0.2.1 " ,
1010 packages = find_packages (),
1111 include_package_data = True ,
1212 install_requires = [
Original file line number Diff line number Diff line change 22DevTooling CLI - A CLI tool for project analysis and management
33"""
44
5- __version__ = '0.2.0 '
5+ __version__ = '0.2.1 '
66__author__ = 'KloutDevs'
Original file line number Diff line number Diff line change @@ -17,13 +17,20 @@ def _clear_screen(self):
1717 os .system ('cls' if os .name == 'nt' else 'clear' )
1818
1919 def _create_banner_text (self ) -> str :
20- """Creates the banner text using figlet ."""
20+ """Crea el texto del banner ."""
2121 try :
22- figlet = pyfiglet .Figlet (font = 'slant' )
23- return figlet .renderText ('DevTooling CLI' )
22+ # Now we use an ASCII art banner instead of pyfiglet
23+ return """
24+ ____ _____ _ _
25+ | _ \ _____ _|_ _|__ ___ | (_)_ __ __ _
26+ | | | |/ _ \ \ / / | |/ _ \ / _ \| | | '_ \ / _` |
27+ | |_| | __/\ V / | | (_) | (_) | | | | | | (_| |
28+ |____/ \___| \_/ |_|\___/ \___/|_|_|_| |_|\__, |
29+ |___/
30+ """
2431 except Exception as e :
2532 self .logger .error (f"Error creating banner: { str (e )} " )
26- return "DevTooling CLI" # Fallback
33+ return "DevTooling CLI" # Fallback simple
2734
2835 def show (self ):
2936 """Shows the banner with animation."""
Original file line number Diff line number Diff line change 1+ import os
2+ import sys
13import json
24from typing import Dict , Any
35
6+ def get_config_path () -> str :
7+ """Get the absolute path to the config directory."""
8+ if hasattr (sys , '_MEIPASS' ):
9+ # PyInstaller creates a temp folder and stores path in _MEIPASS
10+ return os .path .join (sys ._MEIPASS , 'config' )
11+
12+ return os .path .join (os .path .dirname (os .path .dirname (os .path .dirname (__file__ ))), 'config' )
13+
414def load_config (filename : str ) -> Dict [str , Any ]:
5- with open (f'config/{ filename } ' , 'r' , encoding = 'utf-8' ) as f :
15+ """Load a configuration file."""
16+ config_path = os .path .join (get_config_path (), filename )
17+ with open (config_path , 'r' , encoding = 'utf-8' ) as f :
618 return json .load (f )
719
820def get_version () -> str :
9- return "0.2.0 "
21+ return "0.2.1 "
You canβt perform that action at this time.
0 commit comments