📁
SKYSHELL MANAGER
PHP v8.2.30
Create
Create
Path:
root
/
home
/
qooetu
/
costes.qooetu.com
/
Name
Size
Perm
Actions
📁
.well-known
-
0755
🗑️
🏷️
🔒
📁
2e19d9
-
0755
🗑️
🏷️
🔒
📁
6b114
-
0755
🗑️
🏷️
🔒
📁
Modules
-
0755
🗑️
🏷️
🔒
📁
app
-
0755
🗑️
🏷️
🔒
📁
assets
-
0755
🗑️
🏷️
🔒
📁
bootstrap
-
0755
🗑️
🏷️
🔒
📁
cgi-bin
-
0755
🗑️
🏷️
🔒
📁
config
-
0755
🗑️
🏷️
🔒
📁
css
-
0755
🗑️
🏷️
🔒
📁
database
-
0755
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
js
-
0755
🗑️
🏷️
🔒
📁
nbproject
-
0755
🗑️
🏷️
🔒
📁
public
-
0755
🗑️
🏷️
🔒
📁
resources
-
0755
🗑️
🏷️
🔒
📁
routes
-
0755
🗑️
🏷️
🔒
📁
storage
-
0755
🗑️
🏷️
🔒
📁
tests
-
0755
🗑️
🏷️
🔒
📁
uploads
-
0755
🗑️
🏷️
🔒
📁
vendor
-
0755
🗑️
🏷️
🔒
📁
wp-admin
-
0755
🗑️
🏷️
🔒
📁
wp-content
-
0755
🗑️
🏷️
🔒
📁
wp-includes
-
0755
🗑️
🏷️
🔒
📄
.htaccess
0.23 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
COOKIE.txt
0.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
X7ROOT.txt
0.27 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
defaults.php
1.29 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
engine.php
0 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
error_log
813.08 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
features.php
11.28 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
googlecfb82e09419fc0f6.html
0.05 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php0
1.56 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
inputs.php
0.12 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
kurd.html
1.07 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
library.php
0 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
min.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
p.php
2.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
php.ini
0.04 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
product.php
1.78 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
qpmwztts.php
0.74 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
robots.txt
0.32 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
tovmbkwh.php
0.74 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
tyyffovi.php
0.74 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
veoxv.html
1.23 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
Edit: cli.py
"""CLI integration.""" from __future__ import annotations import logging import re import sys from pathlib import Path from typing import TYPE_CHECKING, List, Optional, Pattern, Union import click from playhouse.db_url import connect from .logs import logger from .models import MIGRATE_TABLE from .router import Router if TYPE_CHECKING: from peewee_migrate.types import TParams CLEAN_RE: Pattern = re.compile(r"\s+$", re.M) VERBOSE: List[str] = ["WARNING", "INFO", "DEBUG", "NOTSET"] def get_router( directory: Optional[Union[str, Path]] = None, database: Optional[str] = None, migratetable: str = MIGRATE_TABLE, verbose: int = 0, ) -> Router: """Load and initialize a router.""" config: TParams = {} logging_level: str = VERBOSE[verbose] ignore = schema = None if directory: directory = Path(directory) try: with directory.joinpath("conf.py").open() as cfg: code = compile(cfg.read(), "<string>", "exec", dont_inherit=True) exec(code, config, config) database = config.get("DATABASE", database) ignore = config.get("IGNORE", ignore) schema = config.get("SCHEMA", schema) migratetable = config.get("MIGRATE_TABLE", migratetable) logging_level = config.get("LOGGING_LEVEL", logging_level).upper() except IOError: pass if isinstance(database, str): database = connect(database) logger.setLevel(logging_level) if not database: logger.error("Database is undefined") return sys.exit(1) try: return Router( database, migrate_table=migratetable, migrate_dir=directory, ignore=ignore, schema=schema, ) except RuntimeError: logger.exception("Failed to initialize router") return sys.exit(1) @click.group() def cli(): """Migrate database with Peewee ORM.""" logging.basicConfig(level=logging.INFO) @cli.command() @click.option("--name", default=None, help="Select migration") @click.option("--database", default=None, help="Database connection") @click.option("--directory", default="migrations", help="Directory where migrations are stored") @click.option("--fake", is_flag=True, default=False, help="Run migration as fake.") @click.option("--migratetable", default="migratehistory", help="Migration table.") @click.option("-v", "--verbose", count=True) def migrate( # noqa: PLR0913 name: Optional[str] = None, database: Optional[str] = None, directory: Optional[str] = None, migratetable: str = MIGRATE_TABLE, verbose: int = 0, *, fake: bool = False, ): """Migrate database.""" router = get_router(directory, database, migratetable, verbose) click.secho("Migrating %s" % router.database.database, fg="blue") for mgr in router.run(name, fake=fake): click.echo("- [x] %s" % mgr) click.echo("OK") @cli.command() @click.argument("name") @click.option( "--auto", default=False, is_flag=True, help="Scan sources and create db migrations automatically. Supports autodiscovery.", ) @click.option( "--auto-source", default=None, help=( "Set to python module path for changes autoscan (e.g. 'package.models'). " "Current directory will be recursively scanned by default." ), ) @click.option("--database", default=None, help="Database connection") @click.option("--directory", default="migrations", help="Directory where migrations are stored") @click.option("--migratetable", default="migratehistory", help="Migration table.") @click.option("-v", "--verbose", count=True) def create( # noqa: PLR0913 name: Optional[str] = None, database: Optional[str] = None, directory: Optional[str] = None, migratetable: Optional[str] = None, verbose: int = 0, *, auto: bool = False, auto_source: Optional[str] = None, ): """Create a migration.""" router: Router = get_router(directory, database, migratetable or MIGRATE_TABLE, verbose) router.create(name or "auto", auto=auto_source if auto and auto_source else auto) @cli.command() @click.option( "--count", required=False, default=1, type=int, help="Number of last migrations to be rolled back.Ignored in case of non-empty name", ) @click.option("--database", default=None, help="Database connection") @click.option("--directory", default="migrations", help="Directory where migrations are stored") @click.option("--migratetable", default="migratehistory", help="Migration table.") @click.option("-v", "--verbose", count=True) def rollback( database: Optional[str] = None, directory: Optional[str] = None, migratetable: Optional[str] = None, verbose: int = 0, count: int = 1, ): """Rollback a migration with the given steps --count of last migrations as integer number""" router: Router = get_router(directory, database, migratetable or MIGRATE_TABLE, verbose) if len(router.done) < count: raise RuntimeError( "Unable to rollback %s migrations from %s: %s" % (count, len(router.done), router.done) ) for _ in range(count): router.rollback() @cli.command() @click.option("--database", default=None, help="Database connection") @click.option("--directory", default="migrations", help="Directory where migrations are stored") @click.option("--migratetable", default="migratehistory", help="Migration table.") @click.option("-v", "--verbose", count=True) def list( # noqa: A001 database: Optional[str] = None, directory: Optional[str] = None, migratetable: Optional[str] = None, verbose: int = 0, ): """List migrations.""" router: Router = get_router(directory, database, migratetable or MIGRATE_TABLE, verbose) click.secho("List of migrations:\n", fg="blue") for migration in router.done: click.echo(f"- [x] {migration}") for migration in router.diff: click.echo(f"- [ ] {migration}") click.secho(f"\nDone: {len(router.done)}, Pending: {len(router.diff)}", fg="blue") @cli.command() @click.option("--database", default=None, help="Database connection") @click.option("--directory", default="migrations", help="Directory where migrations are stored") @click.option("--migratetable", default="migratehistory", help="Migration table.") @click.option("-v", "--verbose", count=True) def merge( database: Optional[str] = None, directory: Optional[str] = None, migratetable: Optional[str] = None, verbose: int = 0, ): """Merge migrations into one.""" router: Router = get_router(directory, database, migratetable or MIGRATE_TABLE, verbose) router.merge()
Save