SHARE
TWEET

Untitled

a guest Dec 13th, 2016 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os
  2.  
  3. while True:
  4.     service_dir = raw_input("Enter path to service directory [./service]: ")
  5.     if not service_dir:
  6.         break
  7.     elif not os.path.isdir(service_dir):
  8.         print("Service directory is not exist")
  9.         continue
  10.     else:
  11.         break
  12. service_dir = os.path.abspath(service_dir)
  13. while True:
  14.     client_dir = raw_input("Enter path to client directory [./client]: ")
  15.     if not client_dir:
  16.         break
  17.     elif not os.path.isdir(client_dir):
  18.         print("Client directory is not exist")
  19.         continue
  20.     else:
  21.         break
  22. client_dir = os.path.abspath(client_dir)
  23. while True:
  24.     upload_dir = raw_input("Enter path to upload directory [./upload]: ")
  25.     if not upload_dir:
  26.         break
  27.     elif not os.path.isdir(upload_dir):
  28.         print("Upload directory is not exist")
  29.         continue
  30.     else:
  31.         break
  32. upload_dir = os.path.abspath(upload_dir)
  33. host = raw_input("Host [127.0.0.1]: ")
  34. if not host:
  35.     host = "127.0.0.1"
  36. port = raw_input("Port [8080]: ")
  37. if not port:
  38.     port = "8080"
  39.  
  40. config = """ var config = {
  41.   ip: "%s",
  42.   zmqHost: "127.0.0.1",
  43.   port: %s,
  44.   wsport: 50000,
  45.   createAccountEnable: true,
  46.   compression: true,
  47.   // uploading file size limit in bytes
  48.   filesize_limit: 500000000,
  49.   stream_chunk_size: 500000,
  50.   administrators: ["admin"],
  51.   proccess_count: 1,
  52.   adminLogin: "admin@admin.com",
  53.   adminPass: "admin",
  54.  
  55.   service_directory: "%s",
  56.   client_directory: "%s",
  57.  
  58.   zip: "/usr/bin/7z",
  59.  
  60.   td_scheme_path: "./TD.xsd",
  61.  
  62.   upload_directory: "%s",
  63.   shared_path_name: "share",
  64.  
  65.   mongodb: {
  66.     url: "mongodb://127.0.0.1/",
  67.     options: {}
  68.   },
  69.  
  70.   message: {
  71.     class: "alert alert-warning",
  72.     data: "Added info message"
  73.   },
  74.  
  75.   port_pool: [10100, 10120],
  76.  
  77.   engineeringWorks: false,
  78.  
  79.   //settings for admin mail
  80.   mail: {
  81.     host: "smtp.mail.com",
  82.     user: "someuser@mail.com",
  83.     password: "pass",
  84.     sender: "user <someuser@mail.com>",
  85.     ssl: true,
  86.     reset_link: "http:\/\/127.0.0.1:8080\/auth\/reset-password"
  87.   },
  88.  
  89.   after_open: { // injects Teigha RX commands just after drawing is loaded into a context for intermediate data generation
  90.     dwg: {
  91.       low: [ // this command set adjusts different detail level for better performance with .dwg file
  92.         "LOADAPP", "ModelerGeometry",
  93.         "LOADAPP", "ModelerCommands",
  94.         "ModelerProperties", "NormalTolerance", "45", "F", "NO"],
  95.       mid: [
  96.         "LOADAPP", "ModelerGeometry",
  97.         "LOADAPP", "ModelerCommands",
  98.         "ModelerProperties", "NormalTolerance", "40", "F", "NO"],
  99.       high: [
  100.         "LOADAPP", "ModelerGeometry",
  101.         "LOADAPP", "ModelerCommands",
  102.         "ModelerProperties", "NormalTolerance", "15", "F", "NO"]
  103.     },
  104.     dgn: { // Under construction
  105.     low: [
  106.       "REGVAR", "TG_NURBS_GRID", "3",
  107.         "LOADAPP", "TG_ModelerGeometry", "LOADAPP", "ModelerCommands",
  108.         "ModelerProperties", "NormalTolerance", "45", "F", "NO"],
  109.     mid: [
  110.       "REGVAR", "TG_NURBS_GRID", "6",
  111.         "LOADAPP", "TG_ModelerGeometry", "LOADAPP", "ModelerCommands",
  112.         "ModelerProperties", "NormalTolerance", "40", "F", "NO"],
  113.     high: [
  114.       "REGVAR", "TG_NURBS_GRID", "10",
  115.         "LOADAPP", "TG_ModelerGeometry", "LOADAPP", "ModelerCommands",
  116.         "ModelerProperties", "NormalTolerance", "15", "F", "NO"]
  117.   },
  118.     bim: { // Under construction
  119.     low: [
  120.       ],
  121.     mid: [
  122.       ],
  123.     high: [
  124.       ]
  125.   }
  126.   },
  127.  
  128.   extensions_view: [".dwg",".dxf",".dwf",".dgn",".rvt",".rfa",".zip",".7z"]
  129. }
  130. """ % (host, port, service_dir, client_dir, upload_dir)
  131.  
  132. with open('./conf/config.js', 'w') as f:
  133.     f.write(config)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top