
    	]j                     .    d Z ddlZddlmZ ddlmZ d Zy)zThis file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
    N   )
EXPORT_DIR)	find_filec                    ddl }d }d }|j                  d      }|j                  ddd	d
       |j                  dddd	d       |j                  dddd       |j                  ddd       |j                  dddd	dd       t        d      }|j                  ddd ||d!"       |j                  d#d$d%|d&'       |j                  d(d)d	d*       |j                  d+d,d-d./       |j                  d0d1g d2d3d45       |j                  d6d7g d8d9d:5       |j                  d;d<t        d=d>"       |j                  d?d@dAt
        dB'       |j                  dCdDt        dEdF"       |j                  dGdH|dI'       |j                  dJdK|dL'       |j                  dMdNdO       |j                  dPdQdEdRS       |j                  dTdUdEdVS       |j                  dWdXdEdYS       |j                  dZd[d	d\       |j                  d]d^d	d_       |j                  d`|ga      }|j                  dbdc      }d|_        |j                  ddd|ge       |j                  dfdg|ge       |j                  dhdi|ge      }|j                  djdk|dlm       |j                  dndodpd	dqd       |j                  drds|ge      }	|	j                  djdt|dEdlu       |	j                  dvdhd	dw       |j                  dxdy|ge       |j                  dzd{|ge       |j                  d|d}|ge      }
|
j                  d~ddd	d       |j                  dd|ge      }|j                  dd       |j                  dd       |j                  ddt               d}|j                  dd| d|       |j                  dd|ge       |j                  |       }t        |d%      sd|_        |S )z<Combine args with json config

    :return: config dict
    r   Nc                     t         j                  j                  t         j                  j                  |             }t         j                  j	                  |      r|S t        |       )N)ospathabspath
expanduserexistsFileNotFoundError)filepathr	   s     E/root/env/lib/python3.12/site-packages/label_studio/core/argparser.pyvalid_filepathz(parse_input_args.<locals>.valid_filepath   sC    wwrww11(;<77>>$K))    c                 @    t         j                  j                  |       S )z2Remove trailing / and leading ./ from project name)r   r	   normpath)raw_names    r   project_namez&parse_input_args.<locals>.project_name   s    ww))r   F)add_helpz	--versionversion
store_truezShow Label Studio version)destactionhelpz-bz--no-browser
no_browserz.Do not open browser when starting Label Studioz-dbz
--databasedatabasez4Database file path for storing tasks and annotations)r   r   z
--data-dirdata_dirz2Directory for storing all application related dataz-dz--debugdebugz
Debug mode)r   r   r   defaultzdefault_config.jsonz-cz--configconfig_pathzServer config)r   typer    r   z-lz--label-configlabel_configzLabel config file path)r   r"   r   z--skip-long-migrationsskip_long_migrationszSkip long migrations on startz--ml-backendsml_backends+zMachine learning backends URLs)r   nargsr   z
--samplingsampling)
sequentialuniformzprediction-score-minr)   z3Sampling type that defines order for labeling tasks)r   choicesr    r   z--log-level	log_level)DEBUGINFOWARNINGERRORr/   zLogging levelz--internal-hostinternal_hostz0.0.0.0z8Web server internal host, e.g.: "localhost" or "0.0.0.0"z-pz--portportzWeb server portz--hosthost a  Label Studio full hostname for generating imported task urls, sample task urls, static loading, etc.
Leave it empty to make all paths relative to the domain root, it's preferable for work for most cases.Examples: "https://77.42.77.42:1234", "http://ls.domain.com/subdomain/"z--cert	cert_filez*Certificate file for HTTPS (in PEM format)z--keykey_filez*Private key file for HTTPS (in PEM format)z--initial-project-descriptionproject_descz'Project description to identify projectz
--passwordpasswordzPassword for default user)r   r    r   z
--usernameusernamezUsername for default userz--user-token
user_tokenzUser token for API accessz--agree-fix-sqliteagree_fix_sqlitezEAgree to fix SQLite issues on python 3.6-3.8 on Windows automaticallyz--enable-legacy-api-tokenenable_legacy_api_tokenz&Enable legacy API token authenticationzLabel studio)descriptionparentscommandzAvailable commandszPrint version info)r   r>   userzPrint user infoinitzInitialize Label Studior   z9Path to directory where project state will be initialized?)r   r"   r'   z-qz--quiet
quiet_modezNQuiet (silence) mode for init when it does not ask about username and passwordstartzStart Label Studio serverzProject name)r   r"   r    r'   z--initz,Initialize if project is not initialized yetreset_passwordz&Reset password for a specific usernameshellzRun django shellcalculate_stats_all_orgsz&Calculate task counters and statisticsz--from-scratchfrom_scratchzRecalculate from scratch)r   r    r   r   exportz#Export project in a specific format
project_idz
Project ID)r   export_formatz(Export format (JSON, JSON_MIN, CSV, etc)z--export-pathzExport file path or directory)r   r    zP{"annotations__completed_by": {"only_id": null}, "interpolate_key_frames": true}z--export-serializer-contextz+Export serializer context, default value: ''annotations_fill_updated_byz)Fill the updated_by field for Annotations)argparseArgumentParseradd_argumentr   strintadd_subparsersrequired
add_parserr   
parse_argshasattrr#   )
input_argsrN   r   r   root_parserdefault_config_pathparser
subparsersparser_initparser_startrG   export_projectdefault_paramsargss                 r   parse_input_argsrb   	   s9   
 ** ))5)9K[yTop=   |*3i   \
AuvT97<Vblqr#$9:j}>K^et   ^.Og    #,	   _=RrsAB   5   G   T8&sIZ[R   {>j   j~<h   'nCl   \
BMhi\
BMhi^,QlmT	   #&5	   $$+$WF&&I<P&QJJ )*>V&'8;-P''5NYdXe'fKX_ksv   ]   ((7R]h\i(jLn>^`hklvl9g   *1Ydocpq'(:[MR)44")Q\g[h  5   ))~u\Xr * 
  **8:_juiv*wN<@6`a6U_ijgN%:>:J!L    %,Wbman   Z(D4( Kr   )__doc__r   settings.baser   utils.ior   rb    r   r   <module>rg      s    	 % fr   