How to create project by api, cli or management commands - weblate

I need programatically create new empty (or not) project. How can i do that?
Then i use import-json to create components.
The documentation has import-project command, but
< project > names an existing project, into which the components should be imported.

I can do that with weblate shell or ./manage.py shell
from weblate.trans.models import Project
project = Project.objects.create(
name='Test',
slug='test',
web='https://weblate.org/'
)
project.save()
Also you can exec script from file
weblate shell < create_project.py

Related

mix: create new module in existing project

Is there any handy mix command to add a new module to an existing elixir project?
I use elixir 1.10.3 and I have such project structure:
apps
--api
----mix.exs
----lib
----test
--inventory
----mix.exs
----lib
----test
--mix.exs
I would like to add a monitoring module.
There is no command to create new modules, just add a file in the correct folder.

Golang / GO : I want to read data from oracle database in golang but outside TDM-GCC-64 folder in short in my curent working directory

I am new on golang and currently, I am trying to read data from Oracle DB, but when I try to import library goracle.v2 it gives error exec: gcc": executable file not found in %PATH%, so, for now, I have downloaded TDM-GCC-64 complier and currently created one working directory there and it is also working
But I need the same functionality should work when I write a project in some other directory.
Finally got the answer it is actually simple
1) you just have to add "TDM-GCC-64" 's bin folder path into Environment variable in my case it is “C:\TDM-GCC-64\bin"
2) Open a new command prompt and then check gcc version using command gcc --version if it shows version then you have done with it.
Now you just need to import --> go get gopkg.in/goracle.v2 and it will work

Intellij open directory with ansible playbook scripts/yaml files as project

I want to open a directory as a project in Intellij. The directory contains automation/ansible scripts (yaml/sh/etc) files. Tried to search for solution but with no result. How can I do this in IntelliJ?
On Mac OS, do
$ cd /path/to/the/project/root/directory
$ open -a 'IntelliJ IDEA 2018.2' &
Project will be automatically created.
The following steps works for me. I am using Ultimate 2018.2 with YAML/Ansible support plugin installed.
File>New>Project from Existing Sources or if adding as a module in existing project(s) File>New>Module from Existing Sources, then select the folder that contains the scripts.
In next window, select the Create project from existing sources option. The click Next in succeeding windows then Finish.

How to add new file to Go project

I am using the Go plugin for IntelliJ Idea.
I'm not sure how I got my project working like this but I am able to run my Main.go file and it includes all my other files in the project that I can reference. That is perfect.
The problem now is that when I go and create a new "*.go" file it's not included in the IDE build and I get compiled errors wherever I refer to the contents of that file.
How can I fix this?
i think you can set GOPATH in the ~/.bash_profile, e.g.
GOPATH=~/code/go
export GOPATH
and source ~/.bash_profile or restart the terminal. it will go to effect;
then put *.go or go project related with the main.go under the GOPATH.
finally, main.go will find the *.go.
There are two types of run configurations for Go applications:
- Go Single file -> which is the equivalent of go run file.go
- Go Application -> which is the equivalent of go build file / package and run the binary
By the sound of it, you want to run a Go Application with Run kind set to package. There you'll need to type the full package name, for example: github.com/dlsniper/demo/cmd/democmd
At the moment support for running multiple files / building a directory is not present (there are some issues opened for it)

how do I move a node express project to cloud 9 IDE?

I have an existing node express project and wanted to easily move it to cloud 9 ide.
Is there a way that I can bulk upload the folders or the entire folder tree rather than dragging individual files to the browser?
Also, I noticed that the create express app command does not work in the console, e.g.
$ express /tmp/foo && cd /tmp/foo
You could use FTP to move you stuff over to C9 or move your stuff to Git and then pull it from Git into C9.
Hi you can also use GitHub or BitBucket to store your project and to access your it by cloning it into Cloud9.
Furthermore, we will soon introduce file-upload, which enables you to drag and drop entire folders/ projects in the editor.
When you want to use the express app command in console please read this article: http://support.cloud9ide.com/entries/20908531-run-express-in-cloud9-ide