Skip to content

Commit a014c63

Browse files
committed
[chore] fixed linting
1 parent 1999857 commit a014c63

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

examples/05-database-crud/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
def init_db():
1010
conn = sqlite3.connect(DB_PATH)
1111
cursor = conn.cursor()
12-
cursor.execute("""
12+
cursor.execute(
13+
"""
1314
CREATE TABLE IF NOT EXISTS notes (
1415
id INTEGER PRIMARY KEY AUTOINCREMENT,
1516
title TEXT NOT NULL,
1617
content TEXT,
1718
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
1819
)
19-
""")
20+
"""
21+
)
2022
conn.commit()
2123
conn.close()
2224

pytron/commands/init.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ def cmd_init(args: argparse.Namespace) -> int:
355355
app_jsx = target / "frontend" / "src" / "App.tsx"
356356

357357
if app_jsx.exists():
358-
app_jsx.write_text("""import { useState } from 'react'
358+
app_jsx.write_text(
359+
"""import { useState } from 'react'
359360
import pytron from 'pytron-client'
360361
import './App.css'
361362
@@ -387,7 +388,8 @@ def cmd_init(args: argparse.Namespace) -> int:
387388
}
388389
389390
export default App
390-
""")
391+
"""
392+
)
391393
log(
392394
"Injected React starter code with Pytron Client",
393395
style="success",
@@ -396,7 +398,8 @@ def cmd_init(args: argparse.Namespace) -> int:
396398
elif "vue" in args.template:
397399
app_vue = target / "frontend" / "src" / "App.vue"
398400
if app_vue.exists():
399-
app_vue.write_text("""<script setup>
401+
app_vue.write_text(
402+
"""<script setup>
400403
import { ref } from 'vue'
401404
import pytron from 'pytron-client'
402405
@@ -436,7 +439,8 @@ def cmd_init(args: argparse.Namespace) -> int:
436439
cursor: pointer;
437440
}
438441
</style>
439-
""")
442+
"""
443+
)
440444
log("Injected Vue starter code with Pytron Client", style="success")
441445

442446
except subprocess.CalledProcessError as e:

pytron/commands/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
try:
2323
from watchfiles import DefaultFilter
2424
except ImportError:
25+
2526
class DefaultFilter:
2627
def __init__(self, **kwargs):
2728
pass

pytron/platforms/linux_ops/system.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ def register_protocol(scheme):
197197

198198
# Update mime database and register
199199
try:
200-
subprocess.run(["update-desktop-database", apps_dir], capture_output=True) # nosec B603
200+
subprocess.run(
201+
["update-desktop-database", apps_dir], capture_output=True
202+
) # nosec B603
201203

202204
subprocess.run(
203205
["xdg-mime", "default", desktop_filename, f"x-scheme-handler/{scheme}"],

tests/test_plugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ def create_plugin(base_dir, name, setup_code=None, manifest_extra=None):
3535
with open(os.path.join(p_dir, "manifest.json"), "w") as f:
3636
json.dump(manifest, f)
3737

38-
code = setup_code or """
38+
code = (
39+
setup_code
40+
or """
3941
def init(app):
4042
return "initialized"
4143
"""
44+
)
4245
with open(os.path.join(p_dir, "main.py"), "w") as f:
4346
f.write(code)
4447

0 commit comments

Comments
 (0)