Skip to content

Commit

Permalink
Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarcireau committed Apr 28, 2023
1 parent 2555e54 commit 5afc27a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,46 @@ It supports Python 3.9, 3.10, and 3.11.
- **Debian / Ubuntu**

```sh
sudo apt install ffmpeg
sudo apt install ffmpeg python3 python3-pip vlc
```

- **macOS**

1. Install Homebrew (https://brew.sh)
2. Run in a terminal
```sh
brew install ffmpeg
brew install ffmpeg python3
```

- **Windows**
1. Install Chocolatey (https://chocolatey.org/)
2. Open Powershell as administrator and run
```sh
choco install -y ffmpeg
```

Run in an elevated Powershell (right-click > Run as Administrator)
```powershell
winget install python3 --scope machine
winget install ffmpeg --scope machine
```

## Get started

1. Install the Python package

```sh
python3 -m pip install charidotella
```
- **Debian / Ubuntu**
```sh
sudo python3 -m pip install charidotella
```

- **macOS**
```sh
python3 -m pip install charidotella
```

- **Windows**

Run in an elevated Powershell (right-click > Run as Administrator)
```powershell
& 'C:\Program Files\Python311\python.exe' -m pip install charidotella
```


2. Create a directory _my-wonderful-project_ with the following structure (the file names do not matter as long as their extension is _.es_)

Expand Down
20 changes: 12 additions & 8 deletions charidotella/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ def configuration_schema():

def load_parameters(path: pathlib.Path):
if path.is_file():
with open(path) as file:
with open(path, "r", encoding="utf-8") as file:
return toml.load(file)
return None

def save_parameters(path: pathlib.Path, parameters: dict[str, typing.Any]):
with open(path.with_suffix(".part"), "w") as file:
with open(path.with_suffix(".part"), "w", encoding="utf-8") as file:
toml.dump(parameters, file)
path.with_suffix(".part").rename(path)

Expand Down Expand Up @@ -387,7 +387,9 @@ def run_generators(configuration: dict[str, typing.Any]):
}
)
with open(
utilities.with_suffix(configuration_path, ".part"), "w"
utilities.with_suffix(configuration_path, ".part"),
"w",
encoding="utf-8",
) as configuration_file:
configuration_file.write("# output directory\n")
toml.dump({"directory": "renders"}, configuration_file, encoder=Encoder())
Expand Down Expand Up @@ -477,7 +479,7 @@ def run_generators(configuration: dict[str, typing.Any]):
"icon": "🎬",
"frametime": utilities.timestamp_to_timecode(20000),
"tau": utilities.timestamp_to_timecode(200000),
"style": "cumulative",
"style": "exponential",
"on_color": "#F4C20D",
"off_color": "#1E88E5",
"idle_color": "#191919",
Expand Down Expand Up @@ -646,7 +648,9 @@ def run_generators(configuration: dict[str, typing.Any]):
encoder=Encoder(),
)
with open(
utilities.with_suffix(configuration_path, ".part")
utilities.with_suffix(configuration_path, ".part"),
"r",
encoding="utf-8",
) as configuration_file:
jsonschema.validate(
toml.load(configuration_file),
Expand All @@ -657,7 +661,7 @@ def run_generators(configuration: dict[str, typing.Any]):

if args.command == "run":
configuration_path = pathlib.Path(args.configuration).resolve()
with open(configuration_path) as configuration_file:
with open(configuration_path, "r", encoding="utf-8") as configuration_file:
configuration = toml.load(configuration_file)
jsonschema.validate(configuration, configuration_schema())
if not "filters" in configuration:
Expand Down Expand Up @@ -906,7 +910,7 @@ def run_generators(configuration: dict[str, typing.Any]):

if args.command == "resolve":
configuration_path = pathlib.Path(args.configuration).resolve()
with open(configuration_path) as configuration_file:
with open(configuration_path, "r", encoding="utf-8") as configuration_file:
configuration = toml.load(configuration_file)
jsonschema.validate(configuration, configuration_schema())
if not "filters" in configuration:
Expand All @@ -919,7 +923,7 @@ def run_generators(configuration: dict[str, typing.Any]):
configuration["attachments"] = []
run_generators(configuration)
jsonschema.validate(configuration, configuration_schema())
with open(pathlib.Path(args.output), "w") as output_file:
with open(pathlib.Path(args.output), "w", encoding="utf-8") as output_file:
json.dump(configuration, output_file, indent=4)


Expand Down
2 changes: 1 addition & 1 deletion charidotella/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8"
__version__ = "0.9"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

setuptools.setup(
name="charidotella",
version=__version__, # type: ignore
version=__version__, # type: ignore
url="https://github.com/neuromorphicsystems/charidotella",
author="Alexandre Marcireau",
author_email="alexandre.marcireau@gmail.com",
Expand All @@ -115,6 +115,7 @@
"event_stream",
"jsonschema",
"matplotlib",
"pillow >= 9.5",
"scipy",
"toml",
],
Expand Down

0 comments on commit 5afc27a

Please sign in to comment.