Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tabcmd/commands/datasources_and_workbooks/publish_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ def run_command(cls, args):
if args.db_username:
creds = TSC.models.ConnectionCredentials(args.db_username, args.db_password, embed=args.save_db_password)
workbook_connections = TSC.ConnectionItem()
workbook_connections.server_address = args.db_server
workbook_connections.connection_credentials = creds
Comment on lines 69 to 73
datasource_credentials = creds
elif args.oauth_username:
creds = TSC.models.ConnectionCredentials(args.oauth_username, None, embed=False, oauth=args.save_oauth)
workbook_connections = TSC.ConnectionItem()
workbook_connections.server_address = args.db_server
workbook_connections.connection_credentials = creds
datasource_credentials = creds
else:
Expand Down Expand Up @@ -183,7 +185,7 @@ def publish_workbook_file(args, logger, server, project_id, str_filename, publis
publish_mode,
# args.thumbnail_username, not yet implemented in tsc
# args.thumbnail_group,
connections=credentials,
connections=[credentials] if credentials else None,
as_job=False,
skip_connection_check=args.skip_connection_check,
)
Expand Down
1 change: 1 addition & 0 deletions tabcmd/execution/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def set_publish_args(parser):
creds.add_argument("--db-username", help=_("publish.options.db-username"))
parser.add_argument("--save-oauth", action="store_true", help=_("publish.options.save-oauth"))

parser.add_argument("--db-server", help=_("publish.options.db-server"))
parser.add_argument("--db-password", help=_("publish.options.db-password"))
parser.add_argument("--save-db-password", action="store_true", help=_("publish.options.save-db-password"))

Expand Down
Binary file modified tabcmd/locales/de/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/de/tabcmd_messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Unerwartete Antwort vom Server: {0}
publish.errors.server_resource_not_found=Die von Ihnen angegebene Ressource exisitiert nicht oder Sie haben nicht die Berechtigung, sie einzusehen. Prüfen Sie Ihren Projektnamen und Ihre Berechtigungen.
publish.options.append=Extraktdatei an vorhandene Datenquelle anfügen
publish.options.db-password=Datenbankkennwort für alle Datenquellen
publish.options.db-server=Serveradresse der Datenbank, die den eingebetteten Verbindungsanmeldeinformationen zugeordnet werden soll. Erforderlich bei Verwendung von --db-username oder --oauth-username zum Veröffentlichen einer Arbeitsmappe.
publish.options.db-username=Datenbankbenutzername für alle Datenquellen
publish.options.encrypt_extracts=Extrakte auf dem Server verschlüsseln
publish.options.name=Arbeitsmappen-/Datenquellenname auf dem Server. Wenn keine Angabe erfolgt, wird die Arbeitsmappe/Datenquelle nach dem Dateinamen ohne die Erweiterung twb(x), tds(x) oder tde benannt. Durch das Veröffentlichen einer .tde-Datei wird eine Datenquelle erstellt
Expand Down
1 change: 1 addition & 0 deletions tabcmd/locales/en/tabcmd_messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Unexpected response from the server: {
publish.errors.server_resource_not_found=The resource you specified does not exist, or you do not have permission to see it. Check your project name and permissions
publish.options.append=Append extract file to existing data source
publish.options.db-password=Database password for all data sources
publish.options.db-server=Server address of the database to associate with the embedded connection credentials. Required when using --db-username or --oauth-username to publish a workbook.
publish.options.db-username=Database username for all data sources
publish.options.encrypt_extracts=Encrypt extracts in the workbook or datasource being published to the server.
publish.options.name=Workbook or data source name on the server. If omitted, the workbook or data source will be named after the file name, without the twb(x), tds(x), or tde extension. Publishing a .tde file will create a data source
Expand Down
Binary file modified tabcmd/locales/es/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/es/tabcmd_messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Respuesta inesperada del servidor: {0}
publish.errors.server_resource_not_found=El recurso que ha especificado no existe o no tiene permiso para verlo. Compruebe el nombre del proyecto y sus permisos
publish.options.append=Adjuntar archivo de extracción a fuente de datos existente
publish.options.db-password=Contraseña de base de datos para todas las fuentes de datos
publish.options.db-server=Dirección del servidor de la base de datos que se asociará con las credenciales de conexión incrustadas. Obligatorio cuando se usa --db-username o --oauth-username para publicar un libro de trabajo.
publish.options.db-username=Nombre de usuario de base de datos para todas las fuentes de datos
publish.options.encrypt_extracts=Cifrar extracciones en el servidor
publish.options.name=Nombre del libro de trabajo o la fuente de datos en el servidor. Si se omite, el libro de trabajo o la fuente de datos recibirá un nombre tras el nombre de archivo, sin la extensión twb(x), tds(x) o tde. La publicación de un archivo .tde dará lugar a la creación de una fuente de datos
Expand Down
Binary file modified tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/fr/tabcmd_messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Réponse imprévue du serveur : {0}
publish.errors.server_resource_not_found=La ressource spécifiée n’existe pas, ou vous n’êtes pas autorisé à la voir. Consultez le nom de votre projet et les autorisations.
publish.options.append=Ajout d’un fichier d’extrait à une source de données existante
publish.options.db-password=Mot de passe de base de données pour toutes les sources de données.
publish.options.db-server=Adresse du serveur de la base de données à associer aux informations d’identification de connexion intégrées. Obligatoire lors de l’utilisation de --db-username ou --oauth-username pour publier un classeur.
publish.options.db-username=Nom d’utilisateur de base de données pour toutes les sources de données.
publish.options.encrypt_extracts=Crypter les extraits sur le serveur
publish.options.name=Nom du classeur/de la source de données sur le serveur. S’il est omis, le classeur/la source de données prend le nom du fichier sans l’extension twb(x), tds(x) ou tde. La publication d’un fichier .tde crée une source de données
Expand Down
Binary file modified tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/ga/tabcmd_messages_ga.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=dbf6-表:Unexpected response from the
publish.errors.server_resource_not_found=b7e8-表:The resource you specified does not exist, or you do not have permission to see it. Check your project name and permissions|桜
publish.options.append=6393-表:Append extract file to existing data source|桜
publish.options.db-password=ab47-表:Database password for all data sources|桜
publish.options.db-server=3166-表:Server address of the database to associate with the embedded connection credentials. Required when using --db-username or --oauth-username to publish a workbook.|桜
publish.options.db-username=139f-表:Database username for all data sources|桜
publish.options.encrypt_extracts=cfbc-表:Encrypt extracts on the server|桜
publish.options.name=b1bc-表:Workbook/data source name on the server. If omitted, the workbook/data source will be named after the file name, without the twb(x), tds(x), or tde extension. Publishing a .tde file will create a data source|桜
Expand Down
Binary file modified tabcmd/locales/it/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/it/tabcmd_messages_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Risposta inaspettata dal server: {0}
publish.errors.server_resource_not_found=La risorsa specificata non esiste o non si ha l’autorizzazione a visualizzarla. Controlla il nome del progetto e le autorizzazioni
publish.options.append=Aggiungi un file di estrazione all’origine dati esistente
publish.options.db-password=Password del database per tutte le origini dati
publish.options.db-server=Indirizzo del server del database da associare alle credenziali di connessione incorporate. Obbligatorio quando si usa --db-username o --oauth-username per pubblicare una cartella di lavoro.
publish.options.db-username=Nome utente del database per tutte le origini dati
publish.options.encrypt_extracts=Crittografare le estrazioni su un server
publish.options.name=Cartella di lavoro/nome dell’origine dati sul server. Se omessa, la cartella di lavoro/origine dati sarà rinominata secondo il nome del file, senza l’estensione twb(x), tds(x) o tde. La pubblicazione di un file .tde creerà un’origine dati
Expand Down
Binary file modified tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/ja/tabcmd_messages_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=サーバーからの予期しない
publish.errors.server_resource_not_found=指定されたリソースは存在しないか、そのリソースを表示できるパーミッションがありません。プロジェクト名とパーミッションを確認してください。
publish.options.append=抽出ファイルを既存のデータ ソースに追加
publish.options.db-password=すべてのデータ ソースのデータベース パスワード
publish.options.db-server=埋め込まれた接続資格情報に関連付けるデータベースのサーバー アドレス。ワークブックの発行時に --db-username または --oauth-username を使用する場合は必須です。
publish.options.db-username=すべてのデータ ソースのデータベース ユーザー名
publish.options.encrypt_extracts=サーバーで抽出を暗号化する
publish.options.name=サーバー上のワークブック/データ ソース名。省略した場合は、ファイル名から twb(x)、tds(x)、または tde 拡張子を除いた名前に従ってワークブック/データ ソースの名前が付けられます。.tde ファイルをパブリッシュすると、データ ソースが作成されます
Expand Down
Binary file modified tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/ko/tabcmd_messages_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=서버의 예기치 않은 응답: {0}
publish.errors.server_resource_not_found=지정한 리소스가 존재하지 않거나 사용자에게 리소스를 볼 수 있는 권한이 없습니다. 프로젝트 이름 및 사용 권한을 확인하십시오.
publish.options.append=기존 데이터 원본에 추출 파일 추가
publish.options.db-password=모든 데이터 원본에 대한 데이터베이스 비밀번호
publish.options.db-server=포함된 연결 자격 증명과 연결할 데이터베이스의 서버 주소입니다. 워크북을 게시할 때 --db-username 또는 --oauth-username을 사용하는 경우 필수입니다.
publish.options.db-username=모든 데이터 원본에 대한 데이터베이스 사용자 이름
publish.options.encrypt_extracts=서버에서 추출 암호화
publish.options.name=서버에 있는 통합 문서/데이터 원본 이름입니다. 생략된 경우 통합 문서/데이터 원본의 이름은 twb(x), tds(x) 또는 tde 확장명을 제외한 파일 이름으로 지정됩니다. .tde 파일을 게시하면 데이터 원본이 만들어집니다.
Expand Down
Binary file modified tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/pt/tabcmd_messages_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Resposta inesperada do servidor: {0}
publish.errors.server_resource_not_found=O recurso especificado não existe ou você não tem permissão para vê-lo. Verifique o nome e as permissões do projeto
publish.options.append=Anexe o arquivo de extração à fonte de dados existente
publish.options.db-password=Senha do banco de dados para todas as fontes de dados
publish.options.db-server=Endereço do servidor do banco de dado associado as credenciais. Obrigatório ao usar --db-username ou --oauth-username.
publish.options.db-username=Nome de usuário do banco de dados para todas as fontes de dados
publish.options.encrypt_extracts=Criptografar extrações no servidor
publish.options.name=O nome da pasta de trabalho/fonte de dados no servidor. Se omitido, a pasta de trabalho/fonte de dados será nomeado de acordo com nome de arquivo, sem a extensão twb(x), tds(x) ou tde. Publicar um arquivo .tde criará uma fonte de dados
Expand Down
Binary file modified tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/sv/tabcmd_messages_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Oväntat svar från servern: {0}
publish.errors.server_resource_not_found=Den resurs du angav finns inte, eller så har du inte behörighet att se den. Kontrollera ditt projektnamn och dina behörigheter
publish.options.append=Lägg till extraktfil till befintlig datakälla
publish.options.db-password=Databaslösenord för alla datakällor
publish.options.db-server=Serveradress för databasen som ska associeras med de inbäddade anslutningsuppgifterna. Krävs när --db-username eller --oauth-username används för att publicera en arbetsbok.
publish.options.db-username=Databasanvändarnamn för alla datakällor
publish.options.encrypt_extracts=Kryptera extrakt på servern
publish.options.name=Arbetsbokens/datakällans namn på servern. Om det inte anges namnges arbetsboken/datakällan efter filnamnet, utan filnamnstillägget twb(x), tds(x) eller tde. Om du publicerar en .tde-fil skapas en datakälla
Expand Down
Binary file modified tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo
Binary file not shown.
1 change: 1 addition & 0 deletions tabcmd/locales/zh/tabcmd_messages_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=来自服务器的意外响应: {0}
publish.errors.server_resource_not_found=指定的资源不存在,或者您没有查看该资源的权限。请检查您的项目名称和权限
publish.options.append=将数据提取文件追加到现有数据源
publish.options.db-password=用于所有数据源的数据库密码
publish.options.db-server=要与嵌入式连接凭据关联的数据库的服务器地址。使用 --db-username 或 --oauth-username 发布工作簿时必需。
publish.options.db-username=用于所有数据源的数据库用户名
publish.options.encrypt_extracts=在服务器上对数据提取进行加密
publish.options.name=服务器上的工作簿/数据源名称。如果省略,将使用文件名作为工作簿/数据源名称(无 twb(x)、tds(x) 或 tde 扩展名)。发布 .tde 文件将会创建数据源
Expand Down
39 changes: 39 additions & 0 deletions tests/commands/test_publish_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_publish_with_creds(self, mock_path, mock_glob, mock_session):

mock_args.db_username = "username"
mock_args.db_password = "oauth_u"
mock_args.db_server = "db.example.com"
mock_args.save_db_password = True
mock_args.oauth_username = None
mock_args.embed = False
Expand All @@ -66,6 +67,44 @@ def test_publish_with_creds(self, mock_path, mock_glob, mock_session):
PublishCommand.run_command(mock_args)
mock_session.internal_server.workbooks.publish.assert_called()

call_kwargs = mock_session.internal_server.workbooks.publish.call_args.kwargs
connections = call_kwargs["connections"]
self.assertEqual(len(connections), 1)
self.assertEqual(connections[0].server_address, "db.example.com")

def test_publish_with_creds_no_db_server(self, mock_path, mock_glob, mock_session):
set_up_mock_server(mock_session)
mock_path = set_up_mock_path(mock_path)

mock_args.overwrite = False
mock_args.append = True
mock_args.replace = False

mock_args.filename = "existing_file.twbx"
mock_args.project_name = "project-name"
mock_args.parent_project_path = "projects"
mock_args.name = ""
mock_args.tabbed = True

mock_args.db_username = "username"
mock_args.db_password = "oauth_u"
mock_args.db_server = None
mock_args.save_db_password = True
mock_args.oauth_username = None
Comment on lines +89 to +93
mock_args.embed = False

mock_args.thumbnail_username = None
mock_args.thumbnail_group = None
mock_args.skip_connection_check = False

PublishCommand.run_command(mock_args)
mock_session.internal_server.workbooks.publish.assert_called()

call_kwargs = mock_session.internal_server.workbooks.publish.call_args.kwargs
connections = call_kwargs["connections"]
self.assertEqual(len(connections), 1)
self.assertIsNone(connections[0].server_address)

def test_get_files_to_publish_twbx(self, mock_path, mock_glob, mock_session):
set_up_mock_server(mock_session)
mock_path = set_up_mock_path(mock_path)
Expand Down