Compare commits

...

7 Commits

10 changed files with 16 additions and 13 deletions

View File

@ -38,16 +38,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1685566663, "lastModified": 1717179513,
"narHash": "sha256-btHN1czJ6rzteeCuE/PNrdssqYD2nIA4w48miQAFloM=", "narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4ecab3273592f27479a583fb6d975d4aba3486fe", "rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "23.05", "ref": "24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -2,7 +2,7 @@
description = "A personal feed aggregator"; description = "A personal feed aggregator";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/23.05"; nixpkgs.url = "github:NixOS/nixpkgs/24.05";
# Included to support default.nix and shell.nix # Included to support default.nix and shell.nix
flake-compat = { flake-compat = {
url = "github:edolstra/flake-compat"; url = "github:edolstra/flake-compat";
@ -31,7 +31,7 @@
devShells.${system} = { devShells.${system} = {
default = let default = let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
pythonEnv = pkgs.python38.withPackages (pypkgs: with pypkgs; [ flask black pytest ]); pythonEnv = pkgs.python3.withPackages (pypkgs: with pypkgs; [ flask black pytest ]);
in pkgs.mkShell { in pkgs.mkShell {
packages = [ packages = [
pythonEnv pythonEnv
@ -46,11 +46,11 @@
}; };
overlays.default = final: prev: { overlays.default = final: prev: {
intake = final.python38Packages.buildPythonPackage { intake = final.python3Packages.buildPythonPackage {
name = "intake"; name = "intake";
src = builtins.path { path = ./.; name = "intake"; }; src = builtins.path { path = ./.; name = "intake"; };
format = "pyproject"; format = "pyproject";
propagatedBuildInputs = with final.python38Packages; [ flask setuptools ]; propagatedBuildInputs = with final.python3Packages; [ flask setuptools ];
}; };
}; };

View File

@ -253,7 +253,7 @@ def action(source_name, item_id, action):
data_path: Path = current_app.config["INTAKE_DATA"] data_path: Path = current_app.config["INTAKE_DATA"]
source = LocalSource(data_path, source_name) source = LocalSource(data_path, source_name)
item = execute_action(source, item_id, action) item = execute_action(source, item_id, action)
return jsonify(item) return jsonify(item._item)
@app.route("/edit/source/<string:name>", methods=["GET", "POST"]) @app.route("/edit/source/<string:name>", methods=["GET", "POST"])

View File

@ -172,7 +172,7 @@ def cmd_action(cmd_args):
source = LocalSource(data_path, args.source) source = LocalSource(data_path, args.source)
try: try:
item = execute_action(source, args.item, args.action, 5) item = execute_action(source, args.item, args.action, 5)
print("Item:", item, file=sys.stderr) print("Item:", item._item, file=sys.stderr)
except InvalidConfigException as ex: except InvalidConfigException as ex:
print("Could not fetch", args.source, file=sys.stderr) print("Could not fetch", args.source, file=sys.stderr)
print(ex, file=sys.stderr) print(ex, file=sys.stderr)

0
intake/source.py Executable file → Normal file
View File

View File

@ -35,6 +35,7 @@ article {
} }
article img { article img {
max-width: 100%; max-width: 100%;
height: auto;
} }
article textarea { article textarea {
width: 100%; width: 100%;

View File

@ -35,6 +35,7 @@ article {
} }
article img { article img {
max-width: 100%; max-width: 100%;
height: auto;
} }
button, summary { button, summary {
cursor: pointer; cursor: pointer;

View File

@ -19,6 +19,7 @@ article {
} }
article img { article img {
max-width: 100%; max-width: 100%;
height: auto;
} }
button, summary { button, summary {
cursor: pointer; cursor: pointer;
@ -53,7 +54,7 @@ summary:focus {
</article> </article>
<article> <article>
<details open> <details>
<summary><span class="item-title">Sources</span></summary> <summary><span class="item-title">Sources</span></summary>
{% if not sources %} {% if not sources %}
<p>No sources found.</p> <p>No sources found.</p>

View File

@ -57,7 +57,7 @@ in {
let let
# Define the intake package and a python environment to run it from # Define the intake package and a python environment to run it from
intake = intakeCfg.package; intake = intakeCfg.package;
pythonEnv = pkgs.python38.withPackages (pypkgs: [ intake ]); pythonEnv = pkgs.python3.withPackages (pypkgs: [ intake ]);
# Assign each user an internal port for their personal intake instance # Assign each user an internal port for their personal intake instance
enabledUsers = filterAttrs (userName: userCfg: userCfg.enable) intakeCfg.users; enabledUsers = filterAttrs (userName: userCfg: userCfg.enable) intakeCfg.users;

View File

@ -1,6 +1,6 @@
[project] [project]
name = "intake" name = "intake"
version = "1.0.4" version = "1.1.0"
[project.scripts] [project.scripts]
intake = "intake.cli:main" intake = "intake.cli:main"