Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- while True:
- service_dir = raw_input("Enter path to service directory [./service]: ")
- if not service_dir:
- break
- elif not os.path.isdir(service_dir):
- print("Service directory is not exist")
- continue
- else:
- break
- service_dir = os.path.abspath(service_dir)
- while True:
- client_dir = raw_input("Enter path to client directory [./client]: ")
- if not client_dir:
- break
- elif not os.path.isdir(client_dir):
- print("Client directory is not exist")
- continue
- else:
- break
- client_dir = os.path.abspath(client_dir)
- while True:
- upload_dir = raw_input("Enter path to upload directory [./upload]: ")
- if not upload_dir:
- break
- elif not os.path.isdir(upload_dir):
- print("Upload directory is not exist")
- continue
- else:
- break
- upload_dir = os.path.abspath(upload_dir)
- host = raw_input("Host [127.0.0.1]: ")
- if not host:
- host = "127.0.0.1"
- port = raw_input("Port [8080]: ")
- if not port:
- port = "8080"
- config = """ var config = {
- ip: "%s",
- zmqHost: "127.0.0.1",
- port: %s,
- wsport: 50000,
- createAccountEnable: true,
- compression: true,
- // uploading file size limit in bytes
- filesize_limit: 500000000,
- stream_chunk_size: 500000,
- administrators: ["admin"],
- proccess_count: 1,
- adminLogin: "admin@admin.com",
- adminPass: "admin",
- service_directory: "%s",
- client_directory: "%s",
- zip: "/usr/bin/7z",
- td_scheme_path: "./TD.xsd",
- upload_directory: "%s",
- shared_path_name: "share",
- mongodb: {
- url: "mongodb://127.0.0.1/",
- options: {}
- },
- message: {
- class: "alert alert-warning",
- data: "Added info message"
- },
- port_pool: [10100, 10120],
- engineeringWorks: false,
- //settings for admin mail
- mail: {
- host: "smtp.mail.com",
- user: "someuser@mail.com",
- password: "pass",
- sender: "user <someuser@mail.com>",
- ssl: true,
- reset_link: "http:\/\/127.0.0.1:8080\/auth\/reset-password"
- },
- after_open: { // injects Teigha RX commands just after drawing is loaded into a context for intermediate data generation
- dwg: {
- low: [ // this command set adjusts different detail level for better performance with .dwg file
- "LOADAPP", "ModelerGeometry",
- "LOADAPP", "ModelerCommands",
- "ModelerProperties", "NormalTolerance", "45", "F", "NO"],
- mid: [
- "LOADAPP", "ModelerGeometry",
- "LOADAPP", "ModelerCommands",
- "ModelerProperties", "NormalTolerance", "40", "F", "NO"],
- high: [
- "LOADAPP", "ModelerGeometry",
- "LOADAPP", "ModelerCommands",
- "ModelerProperties", "NormalTolerance", "15", "F", "NO"]
- },
- dgn: { // Under construction
- low: [
- "REGVAR", "TG_NURBS_GRID", "3",
- "LOADAPP", "TG_ModelerGeometry", "LOADAPP", "ModelerCommands",
- "ModelerProperties", "NormalTolerance", "45", "F", "NO"],
- mid: [
- "REGVAR", "TG_NURBS_GRID", "6",
- "LOADAPP", "TG_ModelerGeometry", "LOADAPP", "ModelerCommands",
- "ModelerProperties", "NormalTolerance", "40", "F", "NO"],
- high: [
- "REGVAR", "TG_NURBS_GRID", "10",
- "LOADAPP", "TG_ModelerGeometry", "LOADAPP", "ModelerCommands",
- "ModelerProperties", "NormalTolerance", "15", "F", "NO"]
- },
- bim: { // Under construction
- low: [
- ],
- mid: [
- ],
- high: [
- ]
- }
- },
- extensions_view: [".dwg",".dxf",".dwf",".dgn",".rvt",".rfa",".zip",".7z"]
- }
- """ % (host, port, service_dir, client_dir, upload_dir)
- with open('./conf/config.js', 'w') as f:
- f.write(config)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement