diff --git a/README.md b/README.md deleted file mode 100644 index d75c5d3..0000000 --- a/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# MoveIt - -![MoveIt](moveit.png) - -This is MoveIt, a tool for building bag packages from files and folders on your desktop for transfer to repositories! The metadata fields entered into this app will be written into the bag's `bag-info.txt`. Right now, the compiled versions listed under the releases tab are customized for Simon Fraser University (as is one documentation link built into the app), but it's very easy to customize for your local context if you want. - -User properties (those before the "jump" halfway down the app window) are automatically saved between runs and repopulated; bag-specific properties are not. Uses the Library of Congress' Python bagit library. - -## Development -``` -$ pip install -r requirements.txt --user -$ cd gui -$ npm install -$ npm start -``` - -## Building -The Python code needs to be built on its target platform using `pyinstaller`: - -`pyinstaller -w moveit.py --distpath gui` - -(On Mac, this also builds a .app version of the Python code, which you'll actually want to delete -- just keep the folder of CLI tools.) - -After building the crawler, the GUI can be built from the `gui` subdirectory with: - -`electron-packager . --icon=resources/icon.ico` (Windows) - -`electron-packager . --icon=resources/icon.icns` (Mac) - -On Mac, you can sign for distribution with `electron-osx-sign` and `electron-notarize-cli`, and you need to include the embedded Python binaries: - -`IFS=$'\n' && electron-osx-sign sfu-moveit-darwin-x64/sfu-moveit.app/ $(find sfu-moveit-darwin-x64/sfu-moveit.app/Contents/Resources/app/ -type f -perm -u+x) --identity [hash] --entitlements=entitlements.plist --entitlements-inherit=entitlements.plist --hardenedRuntime` - -`electron-notarize --bundle-id ca.sfu.moveit --username my.apple.id@example.com --password @keystore:AC_PASSWORD sfu-moveit-darwin-x64/sfu-moveit.app/` - -Finally, to package for install: - -`electron-installer-windows --src moveit-win32-x64/ --dest install/ --config config.json` (Windows) - -`hdiutil create tmp.dmg -ov -volname "MoveIt" -fs HFS+ -srcfolder moveit-darwin-x64/ && hdiutil convert tmp.dmg -format UDZO -o sfu-moveit.dmg && rm tmp.dmg` (Mac) diff --git a/README.md b/README.md new file mode 120000 index 0000000..652ab14 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +gui/README.md \ No newline at end of file diff --git a/gui/README.md b/gui/README.md new file mode 100644 index 0000000..d75c5d3 --- /dev/null +++ b/gui/README.md @@ -0,0 +1,40 @@ +# MoveIt + +![MoveIt](moveit.png) + +This is MoveIt, a tool for building bag packages from files and folders on your desktop for transfer to repositories! The metadata fields entered into this app will be written into the bag's `bag-info.txt`. Right now, the compiled versions listed under the releases tab are customized for Simon Fraser University (as is one documentation link built into the app), but it's very easy to customize for your local context if you want. + +User properties (those before the "jump" halfway down the app window) are automatically saved between runs and repopulated; bag-specific properties are not. Uses the Library of Congress' Python bagit library. + +## Development +``` +$ pip install -r requirements.txt --user +$ cd gui +$ npm install +$ npm start +``` + +## Building +The Python code needs to be built on its target platform using `pyinstaller`: + +`pyinstaller -w moveit.py --distpath gui` + +(On Mac, this also builds a .app version of the Python code, which you'll actually want to delete -- just keep the folder of CLI tools.) + +After building the crawler, the GUI can be built from the `gui` subdirectory with: + +`electron-packager . --icon=resources/icon.ico` (Windows) + +`electron-packager . --icon=resources/icon.icns` (Mac) + +On Mac, you can sign for distribution with `electron-osx-sign` and `electron-notarize-cli`, and you need to include the embedded Python binaries: + +`IFS=$'\n' && electron-osx-sign sfu-moveit-darwin-x64/sfu-moveit.app/ $(find sfu-moveit-darwin-x64/sfu-moveit.app/Contents/Resources/app/ -type f -perm -u+x) --identity [hash] --entitlements=entitlements.plist --entitlements-inherit=entitlements.plist --hardenedRuntime` + +`electron-notarize --bundle-id ca.sfu.moveit --username my.apple.id@example.com --password @keystore:AC_PASSWORD sfu-moveit-darwin-x64/sfu-moveit.app/` + +Finally, to package for install: + +`electron-installer-windows --src moveit-win32-x64/ --dest install/ --config config.json` (Windows) + +`hdiutil create tmp.dmg -ov -volname "MoveIt" -fs HFS+ -srcfolder moveit-darwin-x64/ && hdiutil convert tmp.dmg -format UDZO -o sfu-moveit.dmg && rm tmp.dmg` (Mac) diff --git a/gui/index.html b/gui/index.html index b94b221..86d419a 100644 --- a/gui/index.html +++ b/gui/index.html @@ -22,6 +22,7 @@
+

MoveIt


@@ -61,28 +62,29 @@

Telephone



+

Transfer Description


+

Record Creator

+ The name of the responsible department or individual. -

-

RRSDA Number

- Internal SFU Users Only. See Overview. +

RRSDA Number(s)

+ Internal SFU Users Only. Separate by commas. -

Transfer Title

+ The name of the records series if known, or a brief descriptor. -

@@ -100,19 +102,11 @@

Records Description


-
-
-

Other Metadata Available?

- e.g. file lists, indices, documentation.
- If so, please provide a brief description. - -
-


- +


diff --git a/gui/makePackage.js b/gui/makePackage.js index 2c7eaed..9fad34f 100644 --- a/gui/makePackage.js +++ b/gui/makePackage.js @@ -27,7 +27,6 @@ function package() { var datefrom = document.getElementById("datefrom").value; var dateto = document.getElementById("dateto").value; var description = document.getElementById("description").value; - var metadata = document.getElementById("metadata").value; if (contactname === "" || email === "" || title === ""){ notifier.notify({"title" : "MoveIt", "message" : "Contact name, email, and transfer title are required fields."}); } else { @@ -54,7 +53,7 @@ function package() { childWindow.once('ready-to-show', () => { childWindow.show() }); - client.invoke("bag_package", contactname, jobtitle, department, email, phone, creator, rrsda, title, datefrom, dateto, description, metadata, JSON.stringify(packageFolder[0]), function(error, res, more) { + client.invoke("bag_package", contactname, jobtitle, department, email, phone, creator, rrsda, title, datefrom, dateto, description, JSON.stringify(packageFolder[0]), function(error, res, more) { childWindow.close(); if (res === true){ notifier.notify({"title" : "MoveIt", "message" : "Transfer package has been created on desktop."}); @@ -63,7 +62,7 @@ function package() { if (err) throw err; }); } else { - notifier.notify({"title" : "MoveIt", "message" : "Error creating transfer package."}); + notifier.notify({"title" : "MoveIt", "message" : "Error creating transfer package. Log added to desktop."}); console.log(error); } }); diff --git a/gui/package.json b/gui/package.json index 98c8822..bbd9290 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,13 +1,13 @@ { - "name": "sfu-moveit", - "version": "2.0.6", - "homepage": "https://github.com/axfelix/moveit", + "name": "@axfelix/moveit", + "version": "2.0.7", + "homepage": "https://github.com/axfelix/moveit-electron", "main": "main.js", - "description": "An app for producing packages for deposit to the Archives", + "description": "An app for producing bag packages for deposit.", "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/axfelix/moveit" + "url": "https://github.com/axfelix/moveit-electron" }, "scripts": { "start": "electron .", @@ -17,7 +17,7 @@ "electron": "~10.1.3", "electron-squirrel-startup": "^1.0.0", "jquery": "~3.5.1", - "node-notifier": "^5.4.0", + "node-notifier": "^10.0.1", "portfinder": "^1.0.20", "update-electron-app": "^1.3.0", "zerorpc": "hokiedsp/zerorpc-node#dev_zmq6" diff --git a/moveit.py b/moveit.py index 64e2438..eda8554 100644 --- a/moveit.py +++ b/moveit.py @@ -11,9 +11,10 @@ import tempfile import zerorpc import json +from datetime import datetime class MoveIt(object): - def bag_package(self, contactname, jobtitle, department, email, phone, creator, rrsda, title, datefrom, dateto, description, metadata, package_folder): + def bag_package(self, contactname, jobtitle, department, email, phone, creator, rrsda, title, datefrom, dateto, description, package_folder): bag_dir_parent = tempfile.mkdtemp() if os.path.isdir(bag_dir_parent): shutil.rmtree(bag_dir_parent) @@ -43,7 +44,6 @@ def bag_package(self, contactname, jobtitle, department, email, phone, creator, bag.info['Year-Start'] = datefrom bag.info['Year-End'] = dateto bag.info['External-Description'] = description - bag.info['Other-Available-Metadata'] = metadata bag.info['Internal-Sender-Identifier'] = '' bag.info['Internal-Sender-Description'] = '' bag.info['Internal-Validation-Date'] = '' @@ -51,6 +51,10 @@ def bag_package(self, contactname, jobtitle, department, email, phone, creator, bag.info['Internal-Validation-Note'] = '' bag.save() except (bagit.BagError, Exception) as e: + desktop_log = os.path.join(os.environ["HOMEPATH"], "Desktop", "moveit_log.txt") + dt = datetime.now() + with open(desktop_log, "a") as logfile: + logfile.write((str(dt) + " " + str(e))) return False bag_destination = os.path.join(str(bag_dir_parent), (title)) @@ -64,4 +68,4 @@ def bag_package(self, contactname, jobtitle, department, email, phone, creator, if __name__ == '__main__': s = zerorpc.Server(MoveIt()) s.bind('tcp://127.0.0.1:' + str(sys.argv[1])) - s.run() \ No newline at end of file + s.run()