GithubHelp home page GithubHelp logo

unofficial-memsource / memsource-cli-client Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 2.0 1.04 MB

This is an unofficial memsource-cli-client project.

Home Page: http://www.memsource-cli.org

License: Apache License 2.0

Python 100.00%
memsource translation-management translations localization

memsource-cli-client's Introduction

Unofficial Memsource CLI client

GitHub Coverage Status Build Status PyPI version GitHub release (latest by date) Unofficial Memsource CLI Telegram Group Google group : Unofficial Memsource CLI Forum Quality Gate Status Codacy Badge

Table of contents

Introduction

Memsource CLI is a framework to help with automation of Memsource related tasks. This empowers you to automate repetitive tasks such as project, job creation, analysis runs and others. The framework is cabable to talk to Memsource API using REST client and show you the results of the execution on the screen.

Please if you have any idea on any improvements please do not hesitate to open an issue.

Releases

Highlights

  • Extensions are written in Python
  • Allows you to use formatter -f to choose one of many different formats: csv,json,table,value,yaml
  • You can sort by any individual columns or multiple columns using --sort-column
  • Specify the columns that you are interested in using -c

Framework will download additional packages:

  • cliff
  • certifi>=2017.4.17
  • python-dateutil>=2.1
  • six>=1.10
  • urllib3>=1.23

What's new

Version 0.3.8

Fixed #25 and #26 [FEATURE] Added metadata such as total_pages and others into job list output

Version 0.3.7

Added new feature such as

Version 0.3.6

Added new feature such as

Version 0.3.4

Added new features such as

Version 0.3.3

Fixed #20 [BUG] memsource job create --debug displays empty output
Fixed #23 [BUG] memsource job download didn't display help

Version 0.3.2

[0.3.2] Fixed user.py syntax error for python2

Version 0.3.1

Fixed #19 [BUG] List users
Fixed #12 [BUG] Assign jobs to poviders
Fixed #15 [BUG] 'charmap' error on bilingual download
[0.3.1] Add new command 'memsource use list'
[0.3.1] Add new command 'memsource job edit'
[0.3.1] memsource job download can work on multiple job_uids
[0.3.1] force directory creation with --output-dir on job download
[0.3.1] Add Memsource custom base url

Added new features such as

Option to use custom URL:

  --ms-auth-url <auth-url>
                        Authentication URL (Env: MEMSOURCE_URL)

or add to your memsourcerc file:

export MEMSOURCE_URL="https://cloud.memsource.com/web"

Version 0.3

[0.3] Adding feature project template list
[0.3] Move memsource project template create to project create --template-id

Version 0.2.10

[0.2.10] Adding feature template show

Added new features such as

Version 0.2.9

[0.2.9] Adding feature job translations delete all
[0.2.9] Job download renamed
[0.2.9] Add Translation pre-translate option
[0.2.9] Customized output directory for file downloads
[0.2.9] Fix to datetime JSON serialization
[0.2.9] Minor fix: invalid JSON in references in memsource project list

Added features such as

Version 0.2.8

Fixed #6 [BUG] A CLI returns invalid JSON with single-quotes bug low triaged

Version 0.2.6 contains features such as:

Version 0.2.5 contains features such as:

For more information see CHANGELOG.md

How does it looks like?

Check how does it look in an execution at: asciicast

Collaborate

Usage

$ memsource --help
usage: memsource [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
                 [--ms-username <auth-username>]
                 [--ms-password <auth-password>] [--ms-token <auth-token>]
                 [--ms-auth-url <auth-url>]

Unofficial Memsource CLI client

optional arguments:
  --version             show program's version number and exit
  -v, --verbose         Increase verbosity of output. Can be repeated.
  -q, --quiet           Suppress output except warnings and errors.
  --log-file LOG_FILE   Specify a file to log output. Disabled by default.
  -h, --help            Show help message and exit.
  --debug               Show tracebacks on errors.
  --ms-username <auth-username>
                        Authentication username (Env: MEMSOURCE_USERNAME)
  --ms-password <auth-password>
                        Authentication password (Env: MEMSOURCE_PASSWORD)
  --ms-token <auth-token>
                        Authentication token (Env: MEMSOURCE_TOKEN)
  --ms-auth-url <auth-url>
                        Authentication URL (Env: MEMSOURCE_URL)

Commands:
  analyse create  Create analysis
  analyse delete  Delete analysis
  analyse language create  Create analyses by languages
  analyse project list  List analyses by project
  analyse show   Get Analysis
  auth login     Login
  auth whoami    Who am I
  complete       print bash completion command (cliff)
  help           print detailed help for another command (cliff)
  job create     Creates job in project
  job delete     Delete jobs
  job download   Download job file
  job edit       Edit job
  job list       List jobs in project
  job show       Get job
  job translations delete  Delete translations
  jobs edit      Edit jobs
  project assign providers  Assigns providers from template
  project create  Create new project
  project delete  Deletes a project
  project list   List projects
  project show   Get project
  template list  List templates
  template show  Show template
  translation memory download  Download Translation Memory
  translation memory export  Export Translation Memory
  translation memory import  Import segments
  translation memory list  List Translation Memories
  translation memory search  Wildcard Search Translation Memory
  translation pre-translate  Pre-translate job
  user create    Create user
  user get       Get user
  user list      List users

Getting Started

Requirements for python2 environments:

  • package python-virtualenv

Install from PyPI (Red Hat Enterprise Linux derivatives)

DIRECTORY="${HOME}/git/memsource-cli-client/"
if [[ ! -d ${DIRECTORY} ]]; then
  mkdir -p ${DIRECTORY}
fi
cd $DIRECTORY

if [[ -f $(which python3) ]];
then
  python3 -m venv --system-site-packages .memsource
else
  if [[ ! -f $(which virtualenv) ]];
  then
    sudo yum -y install python-virtualenv
  fi
  virtualenv --system-site-packages .memsource
fi

source .memsource/bin/activate
pip install -U pip
pip install -U setuptools
pip install memsource-cli

clear
memsource --help

Install from PyPI (Windows)

  • Download the executable for Python 3.7.0 from here
  • Run the executable
  • Make sure you select the Install launcher for all users and Add Python 3.7 to PATH checkboxes.
  • Make sure to Disable path length limit.
  • Open up a terminal Command Prompt
  • Type python --version You should see:
C:\Users\Robin>python --version
Python 3.7.0
  • Run following to create virtual environment and install memsource-cli
md %systemdrive%%homepath%\VirtualEnvironments
cd %systemdrive%%homepath%\VirtualEnvironments
python -m venv memsource
.\memsource\Scripts\activate
%systemdrive%%homepath%\VirtualEnvironments\memsource\scripts\python.exe -m pip install --upgrade pip setuptools
%systemdrive%%homepath%\VirtualEnvironments\memsource\scripts\python.exe -m pip install memsource-cli

Install from Github (Red Hat Enterprise Linux derivatives)

DIRECTORY="$HOME/git/"

if [[ ! -d ${DIRECTORY} ]]; then
  mkdir ${DIRECTORY}
fi
cd ${DIRECTORY}
if [[ ! -d ${DIRECTORY}/memsource-cli-client ]]; then
  git clone https://github.com/unofficial-memsource/memsource-cli-client.git
  cd memsource-cli-client/
  if [[ -f $(which python3) ]];
  then
    python3 -m venv --system-site-packages .memsource
  else
    if [[ ! -f $(which virtualenv) ]];
    then
      sudo yum -y install python-virtualenv
    fi
    virtualenv --system-site-packages .memsource
    for py in $(find memsource_cli -name "*.py"); do sed -i -e 's#/usr/bin/env python3#/usr/bin/env python#' $py; done
  fi
  source .memsource/bin/activate
  pip install -U pip
  pip install -U setuptools
  pip install -e .
  deactivate
else
  cd memsource-cli-client/
  rm -Rf .memsource
  if [[ -f $(which python3) ]];
  then
    python3 -m venv --system-site-packages .memsource
  else
    if [[ ! -f $(which virtualenv) ]];
    then
      sudo yum -y install python-virtualenv
    fi
    virtualenv --system-site-packages .memsource
    for py in $(find memsource_cli -name "*.py"); do sed -i -e 's#/usr/bin/env python3#/usr/bin/env python#' $py; done
  fi
  source .memsource/bin/activate
  git checkout master
  git reset --hard
  git pull
  if [[ ! -f $(which python3) ]];
  then
    for py in $(find memsource_cli -name "*.py"); do sed -i -e 's#/usr/bin/env python3#/usr/bin/env python#' $py; done
  fi
  source .memsource/bin/activate
  pip install -e .
  deactivate
fi
source ${DIRECTORY}/memsource-cli-client/.memsource/bin/activate
clear
memsource --help

And that's it!

Install from Github (Older Fedora with Python2 and Python 3.5)

First you need to force install with Python 2

DIRECTORY="$HOME/git/"

if [[ ! -d ${DIRECTORY} ]]; then
  mkdir ${DIRECTORY}
fi
cd ${DIRECTORY}
if [[ ! -d ${DIRECTORY}/memsource-cli-client ]]; then
  git clone https://github.com/unofficial-memsource/memsource-cli-client.git
  cd memsource-cli-client/
  if [[ ! -f $(which virtualenv) ]];
  then
    sudo yum -y install python-virtualenv
  fi
  virtualenv --system-site-packages .memsource
  for py in $(find memsource_cli -name "*.py"); do sed -i -e 's#/usr/bin/env python3#/usr/bin/env python#' $py; done
  source .memsource/bin/activate
  pip install -U pip
  pip install -U setuptools
  pip install -e .
  deactivate
else
  cd memsource-cli-client/
  rm -Rf .memsource
  if [[ ! -f $(which virtualenv) ]];
  then
    sudo yum -y install python-virtualenv
  fi
  virtualenv --system-site-packages .memsource
  for py in $(find memsource_cli -name "*.py"); do sed -i -e 's#/usr/bin/env python3#/usr/bin/env python#' $py; done
  source .memsource/bin/activate
  git checkout master
  git reset --hard
  git pull
  for py in $(find memsource_cli -name "*.py"); do sed -i -e 's#/usr/bin/env python3#/usr/bin/env python#' $py; done
  source .memsource/bin/activate
  pip install -e .
  deactivate
fi
source ${DIRECTORY}/memsource-cli-client/.memsource/bin/activate
memsource --help

You may get the following error:

ERROR: Package 'setuptools' requires a different Python: 2.7.13 not in '>=3.5'

You need to downgrade setuptools in order to make it working with Python2:

pip install --upgrade 'setuptools<45.0.0'

And that's it!

Configuration (Red Hat Enterprise Linux derivatives)

This way you can configure your username/password and set up memsource token for faster authentication:

source ${HOME}/git/memsource-cli-client/.memsource/bin/activate
export MEMSOURCE_URL="https://cloud.memsource.com/web"
export MEMSOURCE_USERNAME=<username>
export MEMSOURCE_PASSWORD=<password>
export MEMSOURCE_TOKEN=$(memsource auth login --user-name $MEMSOURCE_USERNAME --password "${MEMSOURCE_PASSWORD}" -c token -f value)

Or you can create a file:

Edit file with vi ~/.memsourcerc and paste following content:

source ${HOME}/git/memsource-cli-client/.memsource/bin/activate
export MEMSOURCE_URL="https://cloud.memsource.com/web"
export MEMSOURCE_USERNAME=<username>
export MEMSOURCE_PASSWORD=<password>
export MEMSOURCE_TOKEN=$(memsource auth login --user-name $MEMSOURCE_USERNAME --password "${MEMSOURCE_PASSWORD}" -c token -f value)

Then only source that file to start using memsource-cli:

source ~/.memsourcerc

Requirements:

  • jq

How to install in RHEL/CentOS

sudo yum -y install jq

Configuration (Windows)

Now you can create a memsourcerc.bat script with following to start using your memsource-cli

@echo off
SET MEMSOURCE_URL=https://cloud.memsource.com/web
SET MEMSOURCE_USERNAME="username"
SET MEMSOURCE_PASSWORD="password"
cd %systemdrive%%homepath%\VirtualEnvironments
.\memsource\Scripts\activate && memsource auth login --user-name %MEMSOURCE_USERNAME% --password %MEMSOURCE_PASSWORD% -c token -f value >> tmp.txt && SET /p MEMSOURCE_TOKEN=<tmp.txt && DEL tmp.txt

Then only call that file to start using memsource-cli:

.\memsourcerc.bat

Autocompletion

To add autocompletion to your shell so you can type:

mem[tab] pr[tab] cr[tab] which will translate to:

memsource project create

memsource complete | sudo tee /etc/bash_completion.d/memsource > /dev/null
. /etc/bash_completion.d/memsource

Now you should be fine to use memsource

Contact us!

This project is maintained on Github.

memsource-cli-client's People

Contributors

ludekjanda avatar robincernin avatar zerodayz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

florkbr hyamanak

memsource-cli-client's Issues

[BUG] No module named 'memsource_cli.memsource - unable to run memsource now

Describe the bug
I updated my resource with the Install from Git script.

$ memsource --help
Traceback (most recent call last):
File "/home/ljanda/git/memsource-cli-client/.memsource/bin/memsource", line 11, in
load_entry_point('memsource-cli', 'console_scripts', 'memsource')()
File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/init.py", line 2852, in load_entry_point
return ep.load()
File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/init.py", line 2443, in load
return self.resolve()
File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/init.py", line 2449, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
ImportError: No module named 'memsource_cli.memsource'

Affected version
Latest

To Reproduce
Update with the script Install from Git from README


$ memsource --help
Traceback (most recent call last):
  File "/home/ljanda/git/memsource-cli-client/.memsource/bin/memsource", line 11, in <module>
    load_entry_point('memsource-cli', 'console_scripts', 'memsource')()
  File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/home/ljanda/git/memsource-cli-client/.memsource/lib64/python3.5/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named 'memsource_cli.memsource'

[BUG][x.y.z] Unable to create Job

Describe the bug
Unable to create job because of invalid projectUid even if the projectUid exists
memsource job create --filenames csv_example.csv virt-who.xml --project-id s0sRdE0aIvzxLQfhGUEU6e

Affected version
0.3.1

To Reproduce
memsource job create --filenames csv_example.csv virt-who.xml --project-id s0sRdE0aIvzxLQfhGUEU6e

Expected behavior
A job is created.

Screenshots or Traceback
image

[FEATURE] JIRA task integration

Is your feature request related to a problem? Please describe.
For the purpose of Automation. It should be possible to create JIRA task from memsource CLI.

Describe the solution you'd like
I would like to be able to create task from memsource client like this:

memsource jira task create --jira-url <String> --summary <String> \
--components <Objects> --affects-versions <Objects> \
--fix-versions <Objects> --description <String> \
--original-estimate <String> --labels <List> --epic <String> \
--story-points <Int> --sprint <String>

Describe alternatives you've considered
Not available

Additional context
By default we use kerberos for authentication, requests with negotiate will be sufficient.

[FEATURE] Display total page counts in a job list

Is your feature request related to a problem? Please describe.
We need to have a way to display total page counts when working with larger projects. Use case is explained in this bug report: #25

Describe the solution you'd like
memsource job list --project-id tCQYoSuMvoUxatSpkj0On3 --target-lang 'ja' -f value -c totalPages

Describe alternatives you've considered
We used a workaround bash script to reiterate through all jobs. Details in #25

Additional context
n/a

[BUG][0.2.8] json is not serializable

To Reproduce
$ memsource project show --project-id oRaSApUSHBb0daKrmp4Ao0 -f json
{
"domain": null,
"id": "15096813",
"internal_id": 1099,
datetime.datetime(2019, 10, 11, 5, 53, 17, tzinfo=tzutc()) is not JSON serializable

Affected version

To Reproduce
Steps to reproduce the behavior

[FEATURE] Download multiple jobs at once as ZIP (mxliff)

Is your feature request related to a problem? Please describe.
My understanding is that the current "memsource file download" downloads jobs one by one.
However the standard way to download multiple files from Memsource is a bulk download in ZIP format at once.

The reason is that if the translation project has some folder structure, the only way to preserve it is with ZIP file on upload to Memsource and on download. You basically select all jobs, after you click Download, they are compressed in ZIP and downloaded.

Also a typical download scenario for the output bilingual MXLIFF format is to download multiple jobs at once so that they can be open at once in one Editor screen.

Describe the solution you'd like
I'd like the parameter "job-id" to accept multiple values:

ex: memsource job file download --project-id SOMETHING --job-id ID,ID,ID,ID --type target

Additional context
Now getting this error on trying to pass multiple IDs:

{"errorCode":"Invalid parameters","errorDescription":"Job "1ItXs2W3pcRk1Q4CjB0SH7,o6bfVjyk2hXE39Y5zgXX33" not imported correctly or import is in progress"}

[BUG][0.3.1] memsource job create --debug has empty output

Describe the bug

memsource job create --debug has empty output

Affected version
<0.3.1

To Reproduce
$ memsource job create --debug

Result: nothing

Expected behavior
A log should be displayed.

Screenshots or Traceback
n/a

Additional context
n/a

[BUG] egg info directory version number does not match release number

Describe the bug
Egg info directory version number does not match release number

Affected version
0.2

To Reproduce

  1. Build memsource-cli-client
  2. Look in /usr/lib/python3.6/site-packages/
  3. Find egg info at memsource_cli-0.9-py3.6.egg-info

Expected behavior
Egg info should be at memsource_cli-0.2-py3.6.egg-info to match version number

Screenshots or Traceback
N/A

Additional context
N/A

[BUG] A CLI returns invalid JSON with single-quotes

Describe the bug
A CLI returns invalid JSON with single-quotes:

 {'first_name': 'Robin', 'last_name': 'Cernin', 'user_name': 'robincernin', 'email': '[email protected]', 'role': 'ADMIN', 'id': '380294', 'uid': 'i0joEXVYjvh6821clw6Qm5'}

Affected version
0.2.6

To Reproduce

$ memsource project list -f value -c owner | jq .first_name
parse error: Invalid numeric literal at line 1, column 14

Expected behavior

$ memsource project list -f value -c owner | tr  "\'" "\""| jq -r .first_name
Robin

Additional context
Solve by modifying the output before displaying to the user:

str.replace(/'/g, '"')

'charmap' error on bilingual download

Running the bilingual download command generates a 'charmap' error:

$ memsource job download --type bilingual --project-id v013uZqRPSF1aFNPpWilvx --job-id VRLp9v1BAVgZgaUngvoHW1 --bilingual-format XLIFF
'charmap' codec can't encode characters in position 775-778: character maps to

Using Python3.6

ENV has:
PYTHONIOENCODING=UTF8
chcp 65001

[FEATURE] job file download -- allow custom dowload location

Is your feature request related to a problem? Please describe.
Whenever I download bilingual file, it is being saved into /tmp directory.

Describe the solution you'd like
I would like to be able to customize this location.

Describe alternatives you've considered
The workaround is moving the file out of /tmp as part of running script.

Additional context

[BUG] Job list command is limited to 50 items

Describe the bug
The job list command is limited to 50 items. We regularly have more than 50 jobs in a project.

I see that the Memsource API limits you to 50 items per page, but at least it lets you see the total number of elements and total number of pages (i.e. ..."numberOfElements":50,"totalElements":91,"pageSize":50,"totalPages":2}). The Memsource CLI client doesn't seem to provide this information.

I'm working on a tool to automate job downloads. I can increment the number of pages I request until I get back an empty array, but it's a pain and not what I expected initially (I was unfamiliar with this Memsource API limitation).

Affected version
Latest.

To Reproduce
memsource job download --project-id tCQYoSuMvoUxatSpkj0On3 --output-dir downloaded_po_files/ja --job-id $(memsource job list --project-id tCQYoSuMvoUxatSpkj0On3 --target-lang 'ja' -f value -c uid | tr '\n' ' ')

I used https://cloud.memsource.com/web/api2/v2/projects/tCQYoSuMvoUxatSpkj0On3/jobs?targetLang=ja to find the total number of pages/elements.

Expected behavior
It should return all jobs, not just the first 50, or at least give the user information on how many additional items and/or pages there are.

[BUG] Token should be hidden in debug logs

Describe the bug
--debug option generates a log that contains token

Affected version
All

To Reproduce
Run any command with --debug option . There is a line with the API call and "token=".

Expected behavior
Token should be hidden.

Screenshots or Traceback
n/a

Additional context
n/a

[BUG] 0.2.4 -- setup.py fails due to mismatch in package name/version

Describe the bug
setup.py fails due to mismatch in package name/version

Affected version
0.2.4

To Reproduce
Steps to reproduce the behavior:
Run:
python3 setup.py build '--executable=/usr/bin/python3 -s'

Expected behavior
setup.py succeeds and framework builds

Screenshots or Traceback

/usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
/usr/lib/python3.6/site-packages/setuptools/dist.py:47: DistDeprecationWarning: Do not call this function
warnings.warn("Do not call this function", DistDeprecationWarning)
ERROR:root:Error parsing
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/pbr/core.py", line 111, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
File "/usr/lib/python3.6/site-packages/pbr/util.py", line 249, in cfg_to_args
pbr.hooks.setup_hook(config)
File "/usr/lib/python3.6/site-packages/pbr/hooks/init.py", line 25, in setup_hook
metadata_config.run()
File "/usr/lib/python3.6/site-packages/pbr/hooks/base.py", line 27, in run
self.hook()
File "/usr/lib/python3.6/site-packages/pbr/hooks/metadata.py", line 26, in hook
self.config['name'], self.config.get('version', None))
File "/usr/lib/python3.6/site-packages/pbr/packaging.py", line 755, in get_version
name=package_name))
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name memsource_cli was given, but was not able to be found.
error in setup command: Error parsing memsource-cli-client-0.2.4/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name memsource_cli was given, but was not able to be found.

Additional context
Add any other context about the problem here.

[FEATURE] Multiple job support for "memsource job edit" command

According to the wiki page, some commands (such as "memsource job download") support using multiple job ids or an argument that list all job ids but "memsource job edit" command doesn't support this. For example this command runs successfully:

memsource job download --project-id <PROJECTID>--output-dir output --job-id $(memsource job list --project-id <PROJECTID> -f value -c uid | tr '\n' ' ')

But this command fails:

memsource job edit --status ACCEPTED --project-id <PROJECTID> --job-id $(memsource job list --project-id <PROJECTID> -f value -c uid | tr '\n' ' ')

This one fails too:

memsource job edit --status ACCEPTED --project-id <PROJECTID> --job-id <JOBID> <JOBID> <JOBID> <JOBID> <JOBID>

The error is:

memsource job edit: error: unrecognized arguments: <list of job ids in the project, all jobs except the first one, I believe this is because the command only accepts one argument>

What I need to do is to change the status of all jobs in a specific project where I know the project id but not the job ids. If there is a workaround for this, I would be happy to hear but I don't have deep knowledge in coding so please keep it simple. I am tagging you, @ludekjanda since Robin said you would be able to look into this one.

Many thanks in advance!

[BUG] Job download does not display info about required arguments

Describe the bug
"$ memsource job download" does not display info about missing arguments but gives a valid result

Affected version
Alll

To Reproduce
$ memsource job download
+--------+----------+
| Field | Value |
+--------+----------+
| type | target |
| format | ORIGINAL |
| path | [] |
+--------+----------+

Expected behavior

Usage + error with required arguments

Something like:
usage: memsource user get [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN]
[--noindent] [--max-width ] [--fit-width]
[--print-empty] [--prefix PREFIX] --user-id USER_ID
memsource user get: error: the following arguments are required: --user-id

[FEATURE] Show template values

Is your feature request related to a problem? Please describe.

I need a way to get defined values for a specific template.

It happened to me that I created a project with "zh" while the supposed language meant to be "zh_cn".

$ memsource project template create -f value -c uid --name "SOMETHING" --template-id SOMENUMBER --target-langs ja fr zh_cn

This API call gives that information:
https://cloud.memsource.com/web/docs/api#operation/getProjectTemplate

Describe the solution you'd like

$ memsource project template show --template-id SOMENUMBER -f value -c targetLangs

Describe alternatives you've considered

Additional context

[BUG][0.3.9] Authentication method concern due to deprecation of token in API’s query string for Memsource TMS APIs

Describe the bug
Find out the impact of the deprecation and how to change the authentication method to one of the supported ones.

Affected version

To Reproduce
Steps to reproduce the behavior

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or Traceback
If applicable, add screenshots or Traceback to help explain your problem.

Additional context
Add any other context about the problem here.

[BUG] Unable to login from windows

Describe the bug
Unable to login to memsource in Windows command line

Affected version

To Reproduce
C:\Windows\system32>memsource auth login --user-name "USERNAME" --password "PASSWORD" -c token -f value --debug
2019-12-30 13:09:29,172 DEBUG Starting new HTTP connection (1): "https:80
2019-12-30 13:09:29,179 DEBUG Incremented Retry for (url='//qa.memsource.com/web%22/api2/v1/auth/login'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
2019-12-30 13:09:29,180 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object
at 0x0000007D2C6CB7F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': //qa.memsource.com/web%22/api2/v1/auth/login
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000007D2C6CB7F0>: Failed
to establish a new connection: [Errno 11001] getaddrinfo failed')': //qa.memsource.com/web%22/api2/v1/auth/login
2019-12-30 13:09:29,183 DEBUG Starting new HTTP connection (2): "https:80
2019-12-30 13:09:29,184 DEBUG Incremented Retry for (url='//qa.memsource.com/web%22/api2/v1/auth/login'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
2019-12-30 13:09:29,185 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object
at 0x0000007D2C6CBA90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': //qa.memsource.com/web%22/api2/v1/auth/login
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000007D2C6CBA90>: Failed
to establish a new connection: [Errno 11001] getaddrinfo failed')': //qa.memsource.com/web%22/api2/v1/auth/login
2019-12-30 13:09:29,188 DEBUG Starting new HTTP connection (3): "https:80
2019-12-30 13:09:29,190 DEBUG Incremented Retry for (url='//qa.memsource.com/web%22/api2/v1/auth/login'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
2019-12-30 13:09:29,191 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object
at 0x0000007D2C6CBC10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': //qa.memsource.com/web%22/api2/v1/auth/login
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000007D2C6CBC10>: Failed
to establish a new connection: [Errno 11001] getaddrinfo failed')': //qa.memsource.com/web%22/api2/v1/auth/login
2019-12-30 13:09:29,194 DEBUG Starting new HTTP connection (4): "https:80
HTTPConnectionPool(host='"https', port=80): Max retries exceeded with url: //qa.memsource.com/web%22/api2/v1/auth/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00
00007D2CEF5310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Traceback (most recent call last):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connection.py", line 156, in _new_conn
conn = connection.create_connection(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1004, in _send_output
self.send(msg)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 944, in send
self.connect()
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connection.py", line 184, in connect
conn = self._new_conn()
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connection.py", line 168, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000007D2CEF5310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\cliff\app.py", line 400, in run_subcommand
result = cmd.run(parsed_args)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\cliff\display.py", line 116, in run
column_names, data = self.take_action(parsed_args)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\auth\v1\login.py", line 30, in take_action
response = api.login(body=vars(parsed_args))
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api\authentication_api.py", line 55, in login
(data) = self.login_with_http_info(**kwargs) # noqa: E501
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api\authentication_api.py", line 115, in login_with_http_info
return self.api_client.call_api(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api_client.py", line 326, in call_api
return self.__call_api(resource_path, method,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api_client.py", line 158, in __call_api
response_data = self.request(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api_client.py", line 368, in request
return self.rest_client.POST(url,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\rest.py", line 272, in POST
return self.request("POST", url,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\rest.py", line 162, in request
r = self.pool_manager.request(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\request.py", line 79, in request
return self.request_encode_body(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\request.py", line 171, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\poolmanager.py", line 330, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen
return self.urlopen(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen
return self.urlopen(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen
return self.urlopen(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 719, in urlopen
retries = retries.increment(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\util\retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='"https', port=80): Max retries exceeded with url: //qa.memsource.com/web%22/api2/v1/auth/login (Caused by NewConnectionError('<urllib3.connec
tion.HTTPConnection object at 0x0000007D2CEF5310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Traceback (most recent call last):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connection.py", line 156, in _new_conn
conn = connection.create_connection(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 1004, in _send_output
self.send(msg)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\http\client.py", line 944, in send
self.connect()
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connection.py", line 184, in connect
conn = self._new_conn()
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connection.py", line 168, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000007D2CEF5310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\jiri.westrmaier\AppData\Local\Programs\Python\Python38\Scripts\memsource.exe_main
.py", line 7, in
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\memsource.py", line 105, in main
return memsource.run(argv)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\cliff\app.py", line 279, in run
result = self.run_subcommand(remainder)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\cliff\app.py", line 400, in run_subcommand
result = cmd.run(parsed_args)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\cliff\display.py", line 116, in run
column_names, data = self.take_action(parsed_args)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\auth\v1\login.py", line 30, in take_action
response = api.login(body=vars(parsed_args))
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api\authentication_api.py", line 55, in login
(data) = self.login_with_http_info(**kwargs) # noqa: E501
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api\authentication_api.py", line 115, in login_with_http_info
return self.api_client.call_api(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api_client.py", line 326, in call_api
return self.__call_api(resource_path, method,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api_client.py", line 158, in __call_api
response_data = self.request(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\api_client.py", line 368, in request
return self.rest_client.POST(url,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\rest.py", line 272, in POST
return self.request("POST", url,
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\memsource_cli\rest.py", line 162, in request
r = self.pool_manager.request(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\request.py", line 79, in request
return self.request_encode_body(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\request.py", line 171, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\poolmanager.py", line 330, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen
return self.urlopen(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen
return self.urlopen(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen
return self.urlopen(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\connectionpool.py", line 719, in urlopen
retries = retries.increment(
File "c:\users\jiri.westrmaier\appdata\local\programs\python\python38\lib\site-packages\urllib3\util\retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='"https', port=80): Max retries exceeded with url: //qa.memsource.com/web%22/api2/v1/auth/login (Caused by NewConnectionError('<urllib3.connec
tion.HTTPConnection object at 0x0000007D2CEF5310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

[BUG] 0.2 fails unit test

Describe the bug
Automated unit test for test_vendor fails.

Affected version
0.2

To Reproduce
Run unit tests

Expected behavior
Unit tests pass

Screenshots or Traceback
test.test_vendor (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: test_vendor (unittest.loader._FailedTest)

ImportError: Failed to import test module: test_vendor
Traceback (most recent call last):
File "/usr/lib64/python3.6/unittest/loader.py", line 153, in loadTestsFromName
module = import(module_name)
File "/home/rlandmann/rpmbuild/BUILD/memsource-cli-client-0.2/test/test_vendor.py", line 19, in
from memsource_cli.models.vendor import VENDOR # noqa: E501
ImportError: cannot import name 'VENDOR'

======================================================================
ERROR: test.test_vendor (unittest.loader._FailedTest)

ImportError: Failed to import test module: test.test_vendor
Traceback (most recent call last):
File "/usr/lib64/python3.6/unittest/loader.py", line 428, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib64/python3.6/unittest/loader.py", line 369, in _get_module_from_name
import(name)
File "/home/rlandmann/rpmbuild/BUILD/memsource-cli-client-0.2/test/test_vendor.py", line 19, in
from memsource_cli.models.vendor import VENDOR # noqa: E501
ImportError: cannot import name 'VENDOR'

Additional context
Changing VENDOR to Vendor throughout test_vendor.py fixes the problem

[FEATURE] Add option to define memsource base url

Describe the bug
Unable to create job because of invalid projectUid even if the projectUid exists
memsource job create --filenames csv_example.csv virt-who.xml --project-id s0sRdE0aIvzxLQfhGUEU6e

Affected version
0.3.1

To Reproduce
memsource job create --filenames csv_example.csv virt-who.xml --project-id s0sRdE0aIvzxLQfhGUEU6e

Expected behavior
A job is created.

Screenshots or Traceback
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.