Skip to content

Commit

Permalink
chore: remove unused funtions
Browse files Browse the repository at this point in the history
Signed-off-by: jingfelix <[email protected]>
  • Loading branch information
jingfelix committed Aug 26, 2024
1 parent e6ba43f commit f65585c
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 748 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# ppatch
# Patche

A tool to analyze and patches between different Linux Kernel versions.
Modern patch, written in Python.

## Config

`ppatch` loads the configuration from a file named `.ppatch.env` in `$HOME`.
`patche` loads the configuration from a file named `.patche.env` in `$HOME`.

```shell
base_dir = "/home/laboratory/workspace/exps/ppatch" # The base directory to store the patches
patch_store_dir = "_patches" # The directory to store the patches
max_diff_lines = 3
```

By default, base_dir is the base directory where `ppatch` is installed.

## Development

`ppatch` uses `pdm` as package manager. To install the dependencies in your workspace, run:
`patche` uses `pdm` as package manager. To install the dependencies in your workspace, run:

```bash
pdm install --prod

# If you want to trace ppatch execution
# If you want to trace patche execution
pdm install
```

Expand Down
285 changes: 0 additions & 285 deletions docs/note.md

This file was deleted.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "ppatch"
version = "0.0.5b3"
description = "Universal tool to analysis patches, bulit for Linux Kernel."
name = "Patche"
version = "0.0.1"
description = "Modern Patch in Python"
authors = [
{name = "jingfelix", email = "[email protected]"},
]
Expand All @@ -22,7 +22,7 @@ requires = ["pdm-backend"]
build-backend = "pdm.backend"

[project.scripts]
ppatch = "ppatch.__init__:app"
patche = "Patche.__init__:app"

[tool.pdm]
distribution = true
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 5 additions & 9 deletions src/ppatch/app.py → src/Patche/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
logging.basicConfig(level=logging.INFO, handlers=[RichHandler()], format="%(message)s")
logger = logging.getLogger()

from ppatch.utils.common import post_executed
from Patche.utils.common import post_executed

__version__ = "0.0.5b3"

Expand All @@ -24,14 +24,10 @@ def callback(verbose: bool = False, version: bool = False):

if version:
console = Console()
console.print(f"ppatch version {__version__}")
console.print(f"patche version {__version__}")
raise typer.Exit()


from ppatch.commands.apply import apply
from ppatch.commands.auto import auto
from ppatch.commands.get import getpatches
from ppatch.commands.help import show_settings
from ppatch.commands.show import show
from ppatch.commands.symbol import getsymbol_command
from ppatch.commands.trace import trace
from Patche.commands.apply import apply
from Patche.commands.help import show_settings
from Patche.commands.show import show
9 changes: 4 additions & 5 deletions src/ppatch/commands/apply.py → src/Patche/commands/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
from typing import Annotated

import typer
import whatthepatch

from ppatch.app import app, logger
from ppatch.model import File
from ppatch.utils.parse import parse_patch
from ppatch.utils.resolve import apply_change
from Patche.app import app, logger
from Patche.model import File
from Patche.utils.parse import parse_patch
from Patche.utils.resolve import apply_change


@app.command()
Expand Down
7 changes: 5 additions & 2 deletions src/ppatch/commands/help.py → src/Patche/commands/help.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from rich import print

from ppatch.app import app
from ppatch.config import settings
from Patche.app import app
from Patche.config import settings


@app.command("settings")
def show_settings():
"""
Show current settings
"""
print(settings.model_dump_json())
Loading

0 comments on commit f65585c

Please sign in to comment.