diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..47d48b5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,102 @@ +name: Build PuniPi Application + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - name: Checkout Repository + uses: actions/checkout@v3 + + # Set up Python environment + - name: Set up Python 3.9 + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + # Install system-level dependencies + - name: Install System Dependencies + run: | + sudo apt update + sudo apt install -y \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav \ + gstreamer1.0-tools \ + libglib2.0-0 \ + libcairo2-dev \ + libgirepository1.0-dev \ + pkg-config \ + libffi-dev \ + libssl-dev \ + libxml2-dev \ + libxslt1-dev \ + gir1.2-glib-2.0 \ + gir1.2-pango-1.0 \ + gir1.2-cairo-1.0 + + # Cache pip dependencies for faster builds + - name: Cache pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # Install Python dependencies + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + # Compile QML resources if needed + # Assuming you have a script or command to compile resources + - name: Compile QML Resources + run: | + ls -la + # Example command; adjust based on your project setup + pyside6-rcc src/punipi/resources/resources.qrc -o src/punipi/resources/resources_rc.py + + # Build the executable with PyInstaller + - name: Build Executable with PyInstaller + run: | + pyinstaller --clean --onefile punipi.spec + + # Upload the executable as an artifact + - name: Upload Executable + uses: actions/upload-artifact@v3 + with: + name: punipi-executable + path: dist/punipi/punipi # Adjust the path based on your spec file + + # Optionally, create a GitHub Release and attach the executable + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v1.0.0 # Update dynamically as needed + release_name: PuniPi v1.0.0 + draft: false + prerelease: false + + - name: Upload Executable to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/punipi # Adjust the path based on your spec file + asset_name: punipi + asset_content_type: application/octet-stream diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 0000000..5fc0e06 --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,57 @@ +# .github/workflows/workflow.yml + +# This workflow will upload a Python Package using Twine when a release is created. +# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-python + +name: Upload Python Package to PyPi + +on: + push: + branches: + - master + release: + types: [created] + workflow_dispatch: + +# Define top-level permissions +permissions: + contents: write # Allows write access to repository contents (needed for checkout) + id-token: write + packages: write # Allows uploading packages to GitHub Packages or external registries + actions: write # Allows reading workflow run information + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' # Specify your Python version + + - name: Add repository sub-modules + run: | + git submodule init + git submodule update + + - name: Install build and Twine + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build the package + run: | + python -m build --sdist --wheel + # The '--sdist --wheel' flags are optional as 'python -m build' builds both by default + + - name: Publish to TestPyPI + env: + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + run: | + twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/* diff --git a/.gitignore b/.gitignore index 82f9275..5021209 100644 --- a/.gitignore +++ b/.gitignore @@ -1,162 +1,51 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so +# These are some examples of commonly ignored file patterns. +# You should customize this list as applicable to your project. +# Learn more about .gitignore: +# https://www.atlassian.com/git/tutorials/saving-changes/gitignore -# Distribution / packaging -.Python -build/ -develop-eggs/ +# Node artifact files +node_modules/ dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec +src/punipi.egg-info/ -# Installer logs -pip-log.txt -pip-delete-this-directory.txt +# Compiled Java class files +*.class -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot +# Compiled Python bytecode +*.py[cod] -# Django stuff: +# Log files *.log -local_settings.py -db.sqlite3 -db.sqlite3-journal -# Flask stuff: -instance/ -.webassets-cache +# Package files +*.jar -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ +# Maven target/ +dist/ -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/latest/usage/project/#working-with-version-control -.pdm.toml -.pdm-python -.pdm-build/ - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject +# JetBrains IDE +.idea/ -# mkdocs documentation -/site +# Unit test reports +TEST*.xml -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json +# Generated by MacOS +.DS_Store -# Pyre type checker -.pyre/ +# Generated by Windows +Thumbs.db -# pytype static type analyzer -.pytype/ +# Applications +*.app +*.exe +*.war -# Cython debug symbols -cython_debug/ +# Large media files +*.mp4 +*.tiff +*.avi +*.flv +*.mov +*.wmv -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..04379e7 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,571 @@ +[MAIN] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Files or directories to be skipped. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against paths and can be in Posix or Windows format. +ignore-paths=^src/m3u8 + +# Files or directories matching the regex patterns are skipped. The regex +# matches against base names, not paths. +ignore-patterns=^\.# + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + pylint.extensions.check_elif, + pylint.extensions.bad_builtin, + pylint.extensions.docparams, + pylint.extensions.for_any_all, + pylint.extensions.set_membership, + pylint.extensions.code_style, + pylint.extensions.overlapping_exceptions, + pylint.extensions.typing, + pylint.extensions.redefined_variable_type, + pylint.extensions.comparison_placement, + pylint.extensions.mccabe, + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use. +jobs=0 + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-allow-list= + +# Minimum supported python version +py-version = 3.7.2 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10.0 + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +# confidence= + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + use-symbolic-message-instead, + useless-suppression, + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" + +disable= + attribute-defined-outside-init, + invalid-name, + missing-docstring, + protected-access, + too-few-public-methods, + # handled by black + format, + # We anticipate #3512 where it will become optional + fixme, + cyclic-import, + import-error, + W0718,W1203, + E0611 + + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables 'fatal', 'error', 'warning', 'refactor', 'convention' +# and 'info', which contain the number of messages in each category, as +# well as 'statement', which is the total number of statements analyzed. This +# score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Activate the evaluation score. +score=yes + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + +# Regular expression of note tags to take in consideration. +#notes-rgx= + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=6 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_.*|dummy + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins= + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.* + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=120 + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Maximum number of lines in a module +max-module-lines=1000 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + + +[BASIC] + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names +variable-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names +attr-rgx=[a-z_][a-z0-9_]{2,}$ + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names +argument-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. +#class-const-rgx= + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names +method-rgx=[a-z_][a-z0-9_]{2,}$ + +# Regular expression which can overwrite the naming style set by typevar-naming-style. +#typevar-rgx= + +# Regular expression which should only match function or class names that do +# not require a docstring. Use ^(?!__init__$)_ to also check __init__. +no-docstring-rgx=__.*__ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# List of decorators that define properties, such as abc.abstractproperty. +property-classes=abc.abstractproperty + + +[TYPECHECK] + +# Regex pattern to define which classes are considered mixins if ignore-mixin- +# members is set to 'yes' +mixin-class-rgx=.*MixIn + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=SQLObject, optparse.Values, thread._local, _thread._local + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members=REQUEST,acl_users,aq_parent,argparse.Namespace + +# List of decorators that create context managers from functions, such as +# contextlib.contextmanager. +contextmanager-decorators=contextlib.contextmanager + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# List of comma separated words that should be considered directives if they +# appear and the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:,pragma:,# noinspection + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file=.pyenchant_pylint_custom_dict.txt + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=2 + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=10 + +# Maximum number of locals for function / method body +max-locals=25 + +# Maximum number of return / yield for function / method body +max-returns=11 + +# Maximum number of branch for function / method body +max-branches=27 + +# Maximum number of statements in function / method body +max-statements=100 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# List of qualified class names to ignore when counting class parents (see R0901). +ignored-parents= + +# Maximum number of attributes for a class (see R0902). +max-attributes=11 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=25 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# List of regular expressions of class ancestor names to +# ignore when counting public methods (see R0903). +exclude-too-few-public-methods= + +max-complexity=15 + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp,__post_init__ + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,TERMIOS,Bastion,rexec + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=builtins.Exception + + +[TYPING] + +# Set to ``no`` if the app / library does **NOT** need to support runtime +# introspection of type annotations. If you use type annotations +# **exclusively** for type checking of an application, you're probably fine. +# For libraries, evaluate if some users what to access the type hints at +# runtime first, e.g., through ``typing.get_type_hints``. Applies to Python +# versions 3.7 - 3.9 +runtime-typing = no + + +[DEPRECATED_BUILTINS] + +# List of builtins function names that should not be used, separated by a comma +bad-functions=map,input + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=10 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[CODE_STYLE] + +# Max line length for which to sill emit suggestions. Used to prevent optional +# suggestions which would get split by a code formatter (e.g., black). Will +# default to the setting for ``max-line-length``. +#max-line-length-suggestions= diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..317c993 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,26 @@ +# Include essential documentation and license files +include README.md +include LICENSE + +# Include all Python files within the punipi package +recursive-include src/punipi *.py + +# Include the compiled resource module +include src/punipi/resources/resources_rc.py + +# Include resource files +recursive-include src/punipi/resources/icons *.svg +recursive-include src/punipi/resources *.qrc + +# Include QML files and qmldir within MediaPlayer and Qml directories +recursive-include src/punipi/MediaPlayer *.qml qmldir +recursive-include src/punipi/Qml *.qml + +# Include translation files +recursive-include src/punipi/translations *.qm + +# (Optional) Include additional resources if any +# recursive-include src/punipi/resources *.png *.jpg *.json *.yaml + +# (Optional) Exclude test files or other unwanted directories +# exclude src/punipi/tests/* diff --git a/README.md b/README.md index 56da84a..d45f851 100644 --- a/README.md +++ b/README.md @@ -1 +1,48 @@ -# project-universe \ No newline at end of file +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3d615b0fda674848bd9a9ba8b0ca631f)](https://app.codacy.com/gh/JustSomeBytes/PuniPi/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) +![Python](https://img.shields.io/badge/python-3.12-green) + +# Project Universe on Pi - PuniPi + +is supposed to become an open universal linux media platform running on Raspberry Pi 5 hardware (or equivalent). +One major element is the integration of Enigma2 setop boxes as servers for live DVB streams and recordings. +In contrast to ancient Enigma2 technology the intent is to use/integrate modern packages that can easily be upgraded as they evolve. + +## Primary & Secondary Display + +![Logo](https://github.com/JustSomeBytes/PuniPi/blob/master/punipi.png?raw=true) + +## Hardware Platform + +### Production + +- Raspberry Pi 5, 8 GB memory +- Display 1: TV +- Display 2: 7 inch HDMI display, 800 x 480 pixels +- 64 GB SD card +- Fire TV bluetooth remote control + +### Development + +Standard Linux platform with + +- preferably Ubuntu distribution +- keyboard (no remote control required) +- Wayland window system + +## Software Platform + +- Raspberry Pi OS +- Python3 +- PySide6 +- GStreamer +- Chromium + +## Project Status: Prototype 5 + +PuniPi is currently in an evaluation phase. So, don't download and try to run yet. +The python code is being developed by dream-alpha and ChatGPT :-) + +## Links + +- Installation: +- Support: diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..b215492 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,9 @@ + + +

PuniPi Installation

+ To install the PuniPi app execute the following commands in a telnet console on your Pi (or compatible Linux platfor): + + + diff --git a/howtos/dev_input.txt b/howtos/dev_input.txt new file mode 100644 index 0000000..8748bdd --- /dev/null +++ b/howtos/dev_input.txt @@ -0,0 +1 @@ +sudo usermod -aG input diff --git a/howtos/firetv.txt b/howtos/firetv.txt new file mode 100644 index 0000000..bbd1447 --- /dev/null +++ b/howtos/firetv.txt @@ -0,0 +1,24 @@ + +How to Put a 3rd Generation Fire TV Remote Control into Pairing Mode: + +1. Remove Current Pairing (if needed): + - If the remote is already paired with another Fire TV device, it’s best to unpair it first. + - To reset the remote, hold down the Back, Menu (☰), and Left Navigation buttons simultaneously for 10-15 seconds. + - This resets the remote and prepares it for pairing. + +2. Put the Remote in Pairing Mode: + - Hold down the Home button (the button with a house icon) for 10 seconds or until the LED indicator at the top of the remote starts blinking rapidly. + - The rapid blinking indicates the remote is now in pairing mode. + +3. Pair with the Raspberry Pi: + - On the Raspberry Pi, use bluetoothctl or a GUI-based Bluetooth manager to detect and pair with the remote: + bluetoothctl + scan on + - Look for the device name in the scan results (e.g., "Amazon Fire TV Remote"). + - Pair and connect using the device's MAC address. + +Troubleshooting: +- If the remote doesn’t appear during scanning: + - Make sure the remote’s batteries are properly inserted and charged. + - Repeat the pairing steps to ensure it’s in pairing mode. +- If you encounter issues with reconnection later, you may need to re-pair or reset the remote. diff --git a/howtos/pi.txt b/howtos/pi.txt new file mode 100644 index 0000000..c532d00 --- /dev/null +++ b/howtos/pi.txt @@ -0,0 +1,8 @@ +rpi-eeprom-update +raspi-config + +# restart wayfire +pkill wayfire +wayfire & + +xset r rate diff --git a/howtos/pip.txt b/howtos/pip.txt new file mode 100644 index 0000000..a566f97 --- /dev/null +++ b/howtos/pip.txt @@ -0,0 +1,5 @@ +python -m build +pip install twine +.pypirc (token) +twine upload --repository-url https://test.pypi.org/legacy/ dist/* +twine upload --repository testpypi dist/* (token in .pypirc) diff --git a/howtos/pyinstaller.txt b/howtos/pyinstaller.txt new file mode 100644 index 0000000..6f6d087 --- /dev/null +++ b/howtos/pyinstaller.txt @@ -0,0 +1,2 @@ +pyinstaller --clean --onefile --windowed --name punipi src/punipi/main.py +pyinstalller punipi.spec diff --git a/howtos/python-vlc.txt b/howtos/python-vlc.txt new file mode 100644 index 0000000..4d6b5cb --- /dev/null +++ b/howtos/python-vlc.txt @@ -0,0 +1,71 @@ +The Python python-vlc library allows you to control VLC via its Media Control Interface (libVLC). Below is a list of common commands that can be sent to VLC using this library, categorized for convenience: + +Playback Control + +play(): Start or resume playback. +pause(): Pause playback. +stop(): Stop playback. +set_position(float): Set playback position as a fraction of the media length (0.0 to 1.0). +get_position(): Get current playback position as a fraction. +set_time(int): Set the playback time in milliseconds. +get_time(): Get the current playback time in milliseconds. +set_rate(float): Set playback rate (e.g., 1.0 for normal, 0.5 for half-speed). +get_rate(): Get the current playback rate. +next_frame(): Advance playback by a single frame (in paused mode). +Media Management + +set_media(media): Attach a media instance to the player. +get_media(): Retrieve the currently attached media. +add_media(media_path): Add a media file by path. +get_length(): Get the media length in milliseconds. +is_playing(): Check if media is currently playing. +open_media(media_path): Load and play a media file in one command. + +Audio Control +audio_set_volume(int): Set the volume level (0-100). +audio_get_volume(): Get the current volume level. +audio_toggle_mute(): Toggle mute status. +audio_get_mute(): Check if audio is muted. +audio_set_track(int): Select an audio track. +audio_get_track(): Get the current audio track. +audio_get_track_count(): Get the number of available audio tracks. + +Video Control +video_set_aspect_ratio(str): Set the video aspect ratio (e.g., "16:9", "4:3"). +video_get_aspect_ratio(): Get the current aspect ratio. +video_set_crop_geometry(str): Set the cropping geometry. +video_get_crop_geometry(): Get the current cropping geometry. +video_take_snapshot(int, str, int, int): Take a snapshot of the video (width and height optional). +video_get_track_count(): Get the number of available video tracks. +video_set_track(int): Set the active video track. +video_get_track(): Get the current video track. + +Subtitle Control +video_set_subtitle_track(int): Select a subtitle track. +video_get_subtitle_track(): Get the current subtitle track. +video_get_spu_count(): Get the number of available subtitle tracks. +video_set_subtitle_file(str): Load an external subtitle file. + +Event Management +event_attach(event_type, callback): Attach a callback to a specific event. +event_detach(event_type, callback): Detach a previously attached callback. +Common events include: +MediaPlayerTimeChanged +MediaPlayerPositionChanged +MediaPlayerEndReached + +Playlist Management +add_to_playlist(media_path): Add media to the playlist. +remove_from_playlist(index): Remove media from the playlist by index. +play_playlist_item(index): Play an item from the playlist by index. +Input Controls +set_fullscreen(bool): Enable or disable fullscreen mode. +toggle_fullscreen(): Toggle fullscreen mode. +set_hwnd(hwnd): Attach VLC to a specific window handle (for embedding video). + +Advanced Features +set_equalizer(equalizer): Apply an equalizer preset. +add_option(option): Add an advanced VLC command-line option (e.g., --network-caching=1000). +set_chapter(int): Set the current chapter. +get_chapter(): Get the current chapter. +get_chapter_count(): Get the total number of chapters. diff --git a/howtos/rc_keys.txt b/howtos/rc_keys.txt new file mode 100644 index 0000000..dfe194d --- /dev/null +++ b/howtos/rc_keys.txt @@ -0,0 +1,293 @@ +Input driver version is 1.0.1 +Input device ID: bus 0x5 vendor 0x171 product 0x41e version 0x37 +Input device name: "AR Keyboard" +Supported events: + Event type 0 (EV_SYN) + Event type 1 (EV_KEY) + Event code 1 (KEY_ESC) + Event code 2 (KEY_1) + Event code 3 (KEY_2) + Event code 4 (KEY_3) + Event code 5 (KEY_4) + Event code 6 (KEY_5) + Event code 7 (KEY_6) + Event code 8 (KEY_7) + Event code 9 (KEY_8) + Event code 10 (KEY_9) + Event code 11 (KEY_0) + Event code 12 (KEY_MINUS) + Event code 13 (KEY_EQUAL) + Event code 14 (KEY_BACKSPACE) + Event code 15 (KEY_TAB) + Event code 16 (KEY_Q) + Event code 17 (KEY_W) + Event code 18 (KEY_E) + Event code 19 (KEY_R) + Event code 20 (KEY_T) + Event code 21 (KEY_Y) + Event code 22 (KEY_U) + Event code 23 (KEY_I) + Event code 24 (KEY_O) + Event code 25 (KEY_P) + Event code 26 (KEY_LEFTBRACE) + Event code 27 (KEY_RIGHTBRACE) + Event code 28 (KEY_ENTER) + Event code 29 (KEY_LEFTCTRL) + Event code 30 (KEY_A) + Event code 31 (KEY_S) + Event code 32 (KEY_D) + Event code 33 (KEY_F) + Event code 34 (KEY_G) + Event code 35 (KEY_H) + Event code 36 (KEY_J) + Event code 37 (KEY_K) + Event code 38 (KEY_L) + Event code 39 (KEY_SEMICOLON) + Event code 40 (KEY_APOSTROPHE) + Event code 41 (KEY_GRAVE) + Event code 42 (KEY_LEFTSHIFT) + Event code 43 (KEY_BACKSLASH) + Event code 44 (KEY_Z) + Event code 45 (KEY_X) + Event code 46 (KEY_C) + Event code 47 (KEY_V) + Event code 48 (KEY_B) + Event code 49 (KEY_N) + Event code 50 (KEY_M) + Event code 51 (KEY_COMMA) + Event code 52 (KEY_DOT) + Event code 53 (KEY_SLASH) + Event code 54 (KEY_RIGHTSHIFT) + Event code 55 (KEY_KPASTERISK) + Event code 56 (KEY_LEFTALT) + Event code 57 (KEY_SPACE) + Event code 58 (KEY_CAPSLOCK) + Event code 59 (KEY_F1) + Event code 60 (KEY_F2) + Event code 61 (KEY_F3) + Event code 62 (KEY_F4) + Event code 63 (KEY_F5) + Event code 64 (KEY_F6) + Event code 65 (KEY_F7) + Event code 66 (KEY_F8) + Event code 67 (KEY_F9) + Event code 68 (KEY_F10) + Event code 69 (KEY_NUMLOCK) + Event code 70 (KEY_SCROLLLOCK) + Event code 71 (KEY_KP7) + Event code 72 (KEY_KP8) + Event code 73 (KEY_KP9) + Event code 74 (KEY_KPMINUS) + Event code 75 (KEY_KP4) + Event code 76 (KEY_KP5) + Event code 77 (KEY_KP6) + Event code 78 (KEY_KPPLUS) + Event code 79 (KEY_KP1) + Event code 80 (KEY_KP2) + Event code 81 (KEY_KP3) + Event code 82 (KEY_KP0) + Event code 83 (KEY_KPDOT) + Event code 85 (KEY_ZENKAKUHANKAKU) + Event code 86 (KEY_102ND) + Event code 87 (KEY_F11) + Event code 88 (KEY_F12) + Event code 89 (KEY_RO) + Event code 90 (KEY_KATAKANA) + Event code 91 (KEY_HIRAGANA) + Event code 92 (KEY_HENKAN) + Event code 93 (KEY_KATAKANAHIRAGANA) + Event code 94 (KEY_MUHENKAN) + Event code 95 (KEY_KPJPCOMMA) + Event code 96 (KEY_KPENTER) + Event code 97 (KEY_RIGHTCTRL) + Event code 98 (KEY_KPSLASH) + Event code 99 (KEY_SYSRQ) + Event code 100 (KEY_RIGHTALT) + Event code 102 (KEY_HOME) + Event code 103 (KEY_UP) + Event code 104 (KEY_PAGEUP) + Event code 105 (KEY_LEFT) + Event code 106 (KEY_RIGHT) + Event code 107 (KEY_END) + Event code 108 (KEY_DOWN) + Event code 109 (KEY_PAGEDOWN) + Event code 110 (KEY_INSERT) + Event code 111 (KEY_DELETE) + Event code 113 (KEY_MUTE) + Event code 114 (KEY_VOLUMEDOWN) + Event code 115 (KEY_VOLUMEUP) + Event code 116 (KEY_POWER) + Event code 117 (KEY_KPEQUAL) + Event code 119 (KEY_PAUSE) + Event code 121 (KEY_KPCOMMA) + Event code 122 (KEY_HANGUEL) + Event code 123 (KEY_HANJA) + Event code 124 (KEY_YEN) + Event code 125 (KEY_LEFTMETA) + Event code 126 (KEY_RIGHTMETA) + Event code 127 (KEY_COMPOSE) + Event code 128 (KEY_STOP) + Event code 129 (KEY_AGAIN) + Event code 130 (KEY_PROPS) + Event code 131 (KEY_UNDO) + Event code 132 (KEY_FRONT) + Event code 133 (KEY_COPY) + Event code 134 (KEY_OPEN) + Event code 135 (KEY_PASTE) + Event code 136 (KEY_FIND) + Event code 137 (KEY_CUT) + Event code 138 (KEY_HELP) + Event code 139 (KEY_MENU) + Event code 140 (KEY_CALC) + Event code 142 (KEY_SLEEP) + Event code 144 (KEY_FILE) + Event code 150 (KEY_WWW) + Event code 152 (KEY_SCREENLOCK) + Event code 155 (KEY_MAIL) + Event code 156 (KEY_BOOKMARKS) + Event code 158 (KEY_BACK) + Event code 159 (KEY_FORWARD) + Event code 161 (KEY_EJECTCD) + Event code 163 (KEY_NEXTSONG) + Event code 164 (KEY_PLAYPAUSE) + Event code 165 (KEY_PREVIOUSSONG) + Event code 166 (KEY_STOPCD) + Event code 167 (KEY_RECORD) + Event code 168 (KEY_REWIND) + Event code 169 (KEY_PHONE) + Event code 171 (KEY_CONFIG) + Event code 172 (KEY_HOMEPAGE) + Event code 173 (KEY_REFRESH) + Event code 174 (KEY_EXIT) + Event code 176 (KEY_EDIT) + Event code 177 (KEY_SCROLLUP) + Event code 178 (KEY_SCROLLDOWN) + Event code 179 (KEY_KPLEFTPAREN) + Event code 180 (KEY_KPRIGHTPAREN) + Event code 181 (KEY_NEW) + Event code 182 (KEY_REDO) + Event code 183 (KEY_F13) + Event code 184 (KEY_F14) + Event code 185 (KEY_F15) + Event code 186 (KEY_F16) + Event code 187 (KEY_F17) + Event code 188 (KEY_F18) + Event code 189 (KEY_F19) + Event code 190 (KEY_F20) + Event code 191 (KEY_F21) + Event code 192 (KEY_F22) + Event code 193 (KEY_F23) + Event code 194 (KEY_F24) + Event code 206 (KEY_CLOSE) + Event code 207 (KEY_PLAY) + Event code 208 (KEY_FASTFORWARD) + Event code 209 (KEY_BASSBOOST) + Event code 210 (KEY_PRINT) + Event code 212 (KEY_CAMERA) + Event code 216 (KEY_CHAT) + Event code 217 (KEY_SEARCH) + Event code 219 (KEY_FINANCE) + Event code 223 (KEY_CANCEL) + Event code 224 (KEY_BRIGHTNESSDOWN) + Event code 225 (KEY_BRIGHTNESSUP) + Event code 228 (KEY_KBDILLUMTOGGLE) + Event code 229 (KEY_KBDILLUMDOWN) + Event code 230 (KEY_KBDILLUMUP) + Event code 231 (KEY_SEND) + Event code 232 (KEY_REPLY) + Event code 233 (KEY_FORWARDMAIL) + Event code 234 (KEY_SAVE) + Event code 235 (KEY_DOCUMENTS) + Event code 240 (KEY_UNKNOWN) + Event code 241 (KEY_VIDEO_NEXT) + Event code 244 (KEY_BRIGHTNESS_ZERO) + Event code 256 (BTN_0) + Event code 353 (KEY_SELECT) + Event code 354 (KEY_GOTO) + Event code 358 (KEY_INFO) + Event code 362 (KEY_PROGRAM) + Event code 366 (KEY_PVR) + Event code 370 (KEY_SUBTITLE) + Event code 372 (KEY_ZOOM) + Event code 374 (KEY_KEYBOARD) + Event code 375 (KEY_SCREEN) + Event code 376 (KEY_PC) + Event code 377 (KEY_TV) + Event code 378 (KEY_TV2) + Event code 379 (KEY_VCR) + Event code 380 (KEY_VCR2) + Event code 381 (KEY_SAT) + Event code 383 (KEY_CD) + Event code 384 (KEY_TAPE) + Event code 386 (KEY_TUNER) + Event code 387 (KEY_PLAYER) + Event code 389 (KEY_DVD) + Event code 392 (KEY_AUDIO) + Event code 393 (KEY_VIDEO) + Event code 396 (KEY_MEMO) + Event code 397 (KEY_CALENDAR) + Event code 398 (KEY_RED) + Event code 399 (KEY_GREEN) + Event code 400 (KEY_YELLOW) + Event code 401 (KEY_BLUE) + Event code 402 (KEY_CHANNELUP) + Event code 403 (KEY_CHANNELDOWN) + Event code 405 (KEY_LAST) + Event code 407 (KEY_NEXT) + Event code 408 (KEY_RESTART) + Event code 409 (KEY_SLOW) + Event code 410 (KEY_SHUFFLE) + Event code 412 (KEY_PREVIOUS) + Event code 416 (KEY_VIDEOPHONE) + Event code 417 (KEY_GAMES) + Event code 418 (KEY_ZOOMIN) + Event code 419 (KEY_ZOOMOUT) + Event code 420 (KEY_ZOOMRESET) + Event code 421 (KEY_WORDPROCESSOR) + Event code 422 (KEY_EDITOR) + Event code 423 (KEY_SPREADSHEET) + Event code 424 (KEY_GRAPHICSEDITOR) + Event code 425 (KEY_PRESENTATION) + Event code 426 (KEY_DATABASE) + Event code 427 (KEY_NEWS) + Event code 428 (KEY_VOICEMAIL) + Event code 429 (KEY_ADDRESSBOOK) + Event code 430 (KEY_MESSENGER) + Event code 431 (KEY_DISPLAYTOGGLE) + Event code 432 (KEY_SPELLCHECK) + Event code 433 (KEY_LOGOFF) + Event code 439 (KEY_MEDIA_REPEAT) + Event code 442 (KEY_IMAGES) + Event code 576 (KEY_BUTTONCONFIG) + Event code 577 (KEY_TASKMANAGER) + Event code 578 (KEY_JOURNAL) + Event code 579 (KEY_CONTROLPANEL) + Event code 580 (KEY_APPSELECT) + Event code 581 (KEY_SCREENSAVER) + Event code 582 (KEY_VOICECOMMAND) + Event code 583 (KEY_ASSISTANT) + Event code 585 (?) + Event code 586 (?) + Event code 587 (?) + Event code 588 (?) + Event code 589 (?) + Event code 592 (KEY_BRIGHTNESS_MIN) + Event code 593 (KEY_BRIGHTNESS_MAX) + Event type 2 (EV_REL) + Event code 6 (REL_HWHEEL) + Event code 12 (REL_HWHEEL_HI_RES) + Event type 3 (EV_ABS) + Event code 32 (ABS_VOLUME) + Value 0 + Min 0 + Max 668 + Event type 4 (EV_MSC) + Event code 4 (MSC_SCAN) +Key repeat handling: + Repeat type 20 (EV_REP) + Repeat code 0 (REP_DELAY) + Value 250 + Repeat code 1 (REP_PERIOD) + Value 33 +Properties: +Testing ... (interrupt to exit) diff --git a/howtos/requirements.txt b/howtos/requirements.txt new file mode 100644 index 0000000..b114ca1 --- /dev/null +++ b/howtos/requirements.txt @@ -0,0 +1,2 @@ +save: pip freeze > requirements.txt +install: pip install -r requirements.txt diff --git a/howtos/translations.txt b/howtos/translations.txt new file mode 100644 index 0000000..615f9c1 --- /dev/null +++ b/howtos/translations.txt @@ -0,0 +1,29 @@ +project/ +│ +├── locale/ # Translation files for Python +│ ├── en/ +│ │ └── LC_MESSAGES/ +│ │ └── messages.mo +│ └── de/ +│ └── LC_MESSAGES/ +│ └── messages.mo +│ +├── translations/ # Translation files for QML +│ ├── messages_de.ts +│ ├── messages_de.qm +│ +├── Main.py # Python application +├── Main.qml # Main QML file +└── ExtDisplay.qml # QML file for external display + +pip install translate-toolkit + +qm Flow + +.qml: Mark with qsTr() +lupdate . -recursive -locations none -ts translations_de.ts +ts2po translations_de.ts translations_de.po +translate .po +po2ts translations_de.po translations_de.ts +generate .qm +lrelease translations_de.ts diff --git a/howtos/venv.txt b/howtos/venv.txt new file mode 100644 index 0000000..9013a9a --- /dev/null +++ b/howtos/venv.txt @@ -0,0 +1,113 @@ + +Virtual environments (venv) in newer Linux releases are an integral part of managing Python dependencies in an isolated and efficient way. Here's a detailed overview: + +--- + +### 1. **What is a `venv`?** +- A **virtual environment** (created using the `venv` module) is a self-contained directory that contains a Python interpreter and its own set of libraries and packages. +- It allows you to work on multiple projects with different dependencies or Python versions without conflicts. + +--- + +### 2. **Why Use `venv`?** +- **Avoid Global Conflicts:** Prevent dependency clashes with system-wide or other project packages. +- **Reproducibility:** Keep dependencies for each project self-contained for easier deployment and version control. +- **Experimentation:** Safely test different package versions or Python features. + +--- + +### 3. **Creating a Virtual Environment** +The `venv` module is included in Python versions 3.3 and newer. + +#### Steps +1. **Ensure Python and `venv` are installed:** + On most Linux distributions, Python 3 and `venv` are pre-installed. If not: + ```bash + sudo apt-get install python3 python3-venv + ``` + +2. **Create the virtual environment:** + ```bash + python3 -m venv myenv --system-site-packages + ``` + - `myenv` is the directory where the virtual environment will be created. + - Inside `myenv`, you'll find subdirectories like `bin/`, `lib/`, and `pyvenv.cfg`. + +--- + +### 4. **Activating the Virtual Environment** +After creating the environment, activate it to use its Python interpreter and dependencies. + +#### Command +```bash +source myenv/bin/activate +``` + +#### Effect +- The shell prompt changes to indicate the active environment, e.g., `(myenv) user@host:~$`. +- Any Python or pip commands now use the virtual environment's versions. + +--- + +### 5. **Installing Packages** +Within the activated environment, use `pip` to install dependencies: +```bash +pip install +``` +These packages will only be available in this virtual environment. + +--- + +### 6. **Deactivating the Environment** +To stop using the virtual environment: +```bash +deactivate +``` +The shell prompt returns to normal, and global Python settings are restored. + +--- + +### 7. **Using `venv` Across Projects** +For multiple projects: +- Create a separate virtual environment for each project. +- Use a `.gitignore` file to exclude the `myenv/` directory from version control, as it's a local dependency manager. + +--- + +### 8. **Key Features in Newer Linux Releases** +- **Integrated Python Versions:** Many Linux distributions now bundle Python 3 as the default, with Python 2 being deprecated. +- **Improved `venv` Performance:** Enhanced compatibility with newer Python features. +- **System Package Isolation:** Virtual environments automatically isolate themselves from the system’s global site-packages, reducing conflicts. + +--- + +### 9. **Alternative Tools** +- **`virtualenv`:** An older but more feature-rich tool for creating virtual environments. Useful for Python 2 or custom requirements. +- **`pipenv`:** Combines `pip` and `venv` with added dependency management tools. +- **`conda`:** An environment manager not limited to Python, supporting multiple programming languages. + +--- + +### 10. **Common Tips** +- **Recreate Environments Easily:** + Save dependencies in a `requirements.txt` file: + ```bash + pip freeze > requirements.txt + ``` + Reinstall in a new environment: + ```bash + pip install -r requirements.txt + ``` + +- **Upgrade `venv` Tools:** + Ensure `pip` and `setuptools` are up-to-date: + ```bash + pip install --upgrade pip setuptools + ``` + +- **Activate Automatically:** + Use tools like [direnv](https://direnv.net) to auto-activate a virtual environment when entering a project directory. + +--- + +Let me know if you'd like more specifics! diff --git a/howtos/vlc_socket.txt b/howtos/vlc_socket.txt new file mode 100644 index 0000000..edfaedf --- /dev/null +++ b/howtos/vlc_socket.txt @@ -0,0 +1,52 @@ +Playback Commands +play: Start or resume playback. +pause: Pause playback (toggle if already paused). +stop: Stop playback. +next: Skip to the next item in the playlist. +prev: Skip to the previous item in the playlist. +clear: Clear the current playlist. +goto