This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import os | |
import sys | |
import StringIO | |
import psycopg2 | |
import psycopg2.extensions | |
from optparse import OptionParser | |
from ConfigParser import SafeConfigParser | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
; This is the password that allows database operations: | |
; admin_passwd = admin | |
db_host = False | |
db_port = False | |
db_user = <db_user> | |
db_password = <db_password> | |
addons_path = /opt/odoo10/addons,/opt/<your_project_folder> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_new_user_id(self,token,zone_id): | |
password = get_random_password_string(13) | |
self.email = "[email protected]" | |
self.firstname = "firstname" | |
self.lastname = "lastname" | |
self.company_name = "company_name" | |
userdata = { | |
"Email": self.email, | |
"FirstName":self.firstname, | |
"LastName":self.lastname, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_sharefile_link(self): | |
self.create_user_sharelink() | |
config_obj = self.env['ir.config_parameter'] | |
parent_id = config_obj.sudo().get_param('sharefile.sharefile_parent_id') # for Odoo | |
parent_id = "123" | |
folder_name = "Test" | |
folder_desc = "Test desc" | |
hostname, username, password, client_id, client_secret = self.get_config_data() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_folder_with_query_parameters(self,token, item_id,folder_name): | |
uri_path = '/sf/v3/Users/AllSharedFolders' | |
headers = self.get_authorization_header(token) | |
http = httplib.HTTPSConnection(self.get_hostname(token)) | |
http.request('GET', uri_path, headers=headers) | |
response = http.getresponse() | |
if response.status == 200: | |
data = json.loads(response.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def download_item(): | |
uri_path = "/sf/v3/Items(%s)/Download" % (item_id) | |
http = httplib.HTTPSConnection(self.get_hostname(token)) | |
http.request("GET", uri_path, headers=self.get_authorization_header(token)) | |
response = http.getresponse() | |
location = response.getheader("location") | |
if location: | |
urllib.request.urlretrieve(location, "/home/Downloads/item.zip") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
RUN apt-get update -y && \ | |
apt-get install -y python3-pip python3-dev | |
COPY ./requirements.txt /app/requirements.txt | |
WORKDIR /app | |
RUN pip3 install pika && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
RUN apt-get update -y && \ | |
apt-get install -y python3-pip python3-dev | |
RUN pip3 install pika | |
WORKDIR /app | |
COPY . /app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
rabbitmq: | |
image: 'rabbitmq:3-management' | |
ports: | |
- '5672:5672' | |
- '15672:15672' |
OlderNewer