MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / formatAutorun

Method formatAutorun

plugins/Trayicon/TrayiconPlugin.py:129–152  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

127 return "%s\\zeronet.cmd" % winfolders.get(winfolders.STARTUP)
128
129 def formatAutorun(self):
130 args = sys.argv[:]
131
132 if not getattr(sys, 'frozen', False): # Not frozen
133 args.insert(0, sys.executable)
134 cwd = os.getcwd()
135 else:
136 cwd = os.path.dirname(sys.executable)
137
138 if sys.platform == 'win32':
139 args = ['"%s"' % arg for arg in args if arg]
140 cmd = " ".join(args)
141
142 # Dont open browser on autorun
143 cmd = cmd.replace("start.py", "zeronet.py").replace('"--open_browser"', "").replace('"default_browser"', "").strip()
144 cmd += ' --open_browser ""'
145
146 return """
147 @echo off
148 chcp 65001 > nul
149 set PYTHONIOENCODING=utf-8
150 cd /D \"%s\"
151 start "" %s
152 """ % (cwd, cmd)
153
154 def isAutorunEnabled(self):
155 path = self.getAutorunPath()

Callers 2

isAutorunEnabledMethod · 0.95
toggleAutorunMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected