zotero-plugin 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/start.py +20 -3
  2. package/package.json +1 -1
package/bin/start.py CHANGED
@@ -37,9 +37,13 @@ class Config:
37
37
  self.zotero.path = '/Applications/Zotero.app/Contents/MacOS/zotero'
38
38
  elif platform.system() == 'Linux':
39
39
  self.zotero.path = '/usr/lib/zotero/zotero'
40
+ elif platform.system() == 'Windows':
41
+ self.zotero.path = 'C:/Program Files (x86)/Zotero/Zotero.exe'
40
42
  else:
41
43
  assert False, f'{platform.system()} not supported'
42
-
44
+
45
+ self.windows = platform.system() == 'Windows'
46
+
43
47
  if self.zotero.log:
44
48
  self.zotero.log = os.path.expanduser(self.zotero.log)
45
49
 
@@ -137,11 +141,24 @@ for plugin_id in ET.parse(os.path.join(config.plugin.source, 'install.rdf')).get
137
141
  with open(plugin_path, 'w') as f:
138
142
  sources = config.plugin.source
139
143
  if sources[-1] != '/': sources += '/'
144
+
145
+ if config.windows:
146
+ sources = sources.replace('\\', '\\\\').replace('/', '\\\\')
147
+
148
+ print('Writing addon source path to proxy file')
149
+ print('Source path: ' + sources)
150
+ print('Proxy file path: ' + plugin_path)
151
+
140
152
  print(sources, file=f)
141
153
 
142
- cmd = config.zotero.path + ' -purgecaches -P'
154
+ cmd = shlex.quote(config.zotero.path) + ' -purgecaches -P'
143
155
  if config.profile.name: cmd += ' ' + shlex.quote(config.profile.name)
144
- cmd += ' -jsconsole -ZoteroDebugText -datadir profile'
156
+ # per https://www.zotero.org/support/debug_output, use ZoteroDebug instead of ZOteroDebugText for windows
157
+ if config.windows:
158
+ cmd += ' -ZoteroDebug'
159
+ else:
160
+ cmd += ' -ZoteroDebugText'
161
+ cmd += ' -jsconsole -datadir profile'
145
162
  if config.zotero.log: cmd += ' > ' + shlex.quote(config.zotero.log)
146
163
  cmd += ' &'
147
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "bin": {