NoteWorthy Composer Forum

Forums => Tips & Tricks => User Tools => Topic started by: Opagust on 2020-06-17 05:57 pm

Title: File Organization
Post by: Opagust on 2020-06-17 05:57 pm
The purpose of this tool is to provide a sort of 'version management'.
A possible scenario:
- When you think a draft version of your score is ready to be 'promoted' or secured,
you can register the date last modified in the File Info comments section, create a
read-only copy in a dedicated folder, with one or more suffixes added to the file
name to see at a glance the date last modified, the creation date of the copy and/or
a 'version text'.
- Then you can safely continue working with the original draft version.
- If you want to work again with the secured version, you could unlock it, or leave
it locked and create a new, writable copy in your 'working' folder. 

The tool window:
- The date modified, shown at the top of the window, is extracted from the Windows
file system.
- The 'File Info Comments' frame shows the comment section of the 'File Info' from
the input file. 
- The actions that you select in the 'Actions' frame are not accomplished until you
click one of the buttons 'Save changes' or 'Save copy'.

If you save a copy of the input file, you can add one or more suffixes:
- #m, followed by the date modified
- #c, followed by the creation date of the copy
- #v, followed by a self chosen text
(Remark: Any suffixes of the input file are not retained in the name of the copy.)
Via a popup window you can choose the folder for the copy. (Remark: If the folder
doesn't exist, you'll be ask if it should be created.)

Installation:
Since the script is written in the Python programming language, it can't be run directly in the NWC Tools environment, so I have build an executable file from it (file_organization.exe) and a Windows installation file.
I can't attach it here, bt you can find the zipped installation file in my website: https://www.opagust.be/content/nwc-file-organization. (https://www.opagust.be/content/nwc-file-organization)
In order to download the installation file, you'll now have to be logged in.
You may use an account I created:
- username: 'NWC User'
- password: 'Usertools'
Or you can create your own account, so you can be informed of future updates.
 
After you have downloaded that file, you can unpack and run it. It will install the tool as a Windows application. It will suggest a folder, but you can change that. Copy that folder name.
The next step is the installation in NWC:
- Open the User Tools window (via Tools/User Tool...)
- Click 'New...' and fill in the dialog box:
  - Choose e group and a name
  - In the command line, paste the folder name where the tool is installed, followed by '/file_organization.exe' (without the quotes)
   - Choose 'File Text' as Input Type
   - In the Options section: leave 'Compress Input' unchecked and chek the other ones.
- Click 'OK'
Title: Re: File Organization
Post by: Flurmy on 2020-06-17 06:24 pm
Quote
Pagina niet gevonden
!
Title: Re: File Organization
Post by: Opagust on 2020-06-17 06:42 pm
:-[ I think it works now (for me it does!)
Title: Re: File Organization
Post by: Flurmy on 2020-06-17 07:54 pm
Yup!
Title: Re: File Organization
Post by: SEBC on 2020-06-19 09:44 am
Thanks for developing this tool. I’m going to try it out later today.
Title: Re: File Organization
Post by: Opagust on 2020-06-24 08:36 am
Thanks for developing this tool. I’m going to try it out later today.
Hi SEBC,
I noticed you've been quite busy these days, but I wonder: have you already found time to try this tool?
I'm curious if it satisfies your needs.
Let me know if it can be improved.
Title: Re: File Organization
Post by: SEBC on 2020-06-25 08:30 pm
Sorry, I’ve been working under Production deadlines but will let you know when I am able to do so. Thanks for checking in.
Title: Re: File Organization
Post by: SEBC on 2020-07-05 11:16 am
I started using this tool today. I like being able to put the date modified in the File info comments.

Can you explain how to use the "create user objects to print date modified" option?

Thanks
Title: Re: File Organization
Post by: Opagust on 2020-07-05 02:46 pm
Can you explain how to use the "create user objects to print date modified" option?
Thanks
If you check this action, and  save the changes, a user object 'PageTxtMaestro.nw' (if not already present) and  'PageTxt.nw' with 'Page Style' = 'Modified' will be inserted in your score.
This will print the date modified in the bottom left corner of each page. If you want it to be printed at another position, you can change the PageTxt object.
I suggest you just try it and do a 'Print Review'.
Title: Re: File Organization
Post by: SEBC on 2020-07-05 09:44 pm
I’m getting an error message when I try to use that function. It asks me if I want to save the change. I say yes. And then it takes me to the screen with my score and I can’t do anything else from there except cancel. I cannot do a print preview. What am I doing wrong?
Title: Re: File Organization
Post by: Opagust on 2020-07-06 08:27 am
I’m getting an error message when I try to use that function. It asks me if I want to save the change. I say yes. And then it takes me to the screen with my score and I can’t do anything else from there except cancel. I cannot do a print preview. What am I doing wrong?
It's not sure that you did something wrong, maybe the program did (wich implies it was me that did something wrong ::) )
Have you tried it on another file with the same result?
You mention you get an error message, what does it exactly say?
Maybe you can include the file, then I can try it myself to search what causes the problem.
Title: Re: File Organization
Post by: SEBC on 2020-07-06 01:48 pm
Have you tried it on another file with the same result?

I actually was able to get that file to work. I was cancelling instead of exiting after I ran the tool.

You mention you get an error message, what does it exactly say?

In a different file, I am getting an error message related to visibility and key signatures. I have a hidden staff for a descant line. Have you tried the tool when there is a hidden staff?

Here's the traceback when I cancel:

Traceback (most recent call last):
  File "file_organization.py", line 68, in read_score
  File "C:\Users\gustv\PycharmProjects\PYNWC\nwc.py", line 612, in __init__
  File "C:\Users\gustv\PycharmProjects\PYNWC\nwc.py", line 127, in __init__
  File "C:\Users\gustv\PycharmProjects\PYNWC\nwc.py", line 138, in check
AssertionError: |Key|Signature:Bb,Eb,Ab|Tonic:E|Visibility:Never: field Visibility not in ['Signature', 'Tonic', 'HideCancels', 'AutoSys']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\gustv\AppData\Local\Programs\Python\Python38\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
  File "C:\Users\gustv\AppData\Local\Programs\Python\Python38\Lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
  File "file_organization.py", line 400, in <module>
  File "file_organization.py", line 71, in read_score
AssertionError: |Key|Signature:Bb,Eb,Ab|Tonic:E|Visibility:Never: field Visibility not in ['Signature', 'Tonic', 'HideCancels', 'AutoSys']
Title: Re: File Organization
Post by: Opagust on 2020-07-06 04:03 pm
I corrected a bug. The program checks the validity of the input file against a list of valid fields per object type. For a key signature, I hadn't included the fields visiblity and color in that list.
You can install the new version via https://www.opagust.be/?q=content/nwc-file-organization (https://www.opagust.be/?q=content/nwc-file-organization)
Title: Re: File Organization
Post by: SEBC on 2020-07-06 06:03 pm
I'm getting a new error message with the new installation. I removed the old one first. Perhaps that was a mistake:

Traceback (most recent call last):
  File "C:\Users\gustv\AppData\Local\Programs\Python\Python38\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
  File "C:\Users\gustv\AppData\Local\Programs\Python\Python38\Lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
  File "file_organization.py", line 400, in <module>
  File "file_organization.py", line 68, in read_score
  File "C:\Users\gustv\PycharmProjects\PYNWC\nwc.py", line 617, in __init__
  File "C:\Users\gustv\PycharmProjects\PYNWC\nwc.py", line 127, in __init__
  File "C:\Users\gustv\PycharmProjects\PYNWC\nwc.py", line 136, in check
AttributeError: module 'nwc_terms' has no attribute 'type_opt_value_list'
Title: Re: File Organization
Post by: Opagust on 2020-07-22 02:38 pm

You can install a new version (hopefully bugfree this time ::) ) via:
 https://www.opagust.be/?q=content/nwc-file-organization
Title: Re: File Organization
Post by: Opagust on 2020-07-28 01:05 pm
28/07/2020: version 1.1 added: see https://www.opagust.be/?q=content/nwc-file-organization

- correction of a bug when reading 'localrepeatclose' bar from the inputfile.

- Added possibility to change the default location of the 'print object' via arguments in the command line of the User Tool Description window.
* Arguments (with the dashes, without the quotes, case sensitive): '-XLoc', '-YLoc', '-X', '-Y', each followed by the desired value.
* Leave a space between the argument names and the values, use no commas.
*Valid values:
   -XLoc: Left, Center, Right (default = Left)
   -YLoc: Top, Bottom (default = Top)
   -X and -Y: horizontal and vertical offset (default = 0)
* Example: With the arguments "-XLoc Left -Yloc Bottom -Y 10", the date modified will be printed at the bottom left of the page, with a vertical offset of 10.
Title: Re: File Organization
Post by: Opagust on 2020-08-06 06:25 pm
In the statistics of my website I noticed that there ware recently some downloads of another tool: NWCTOOLS ENVIRONMENT (https://www.opagust.be/?q=content/nwctools-environment).
This is a tool which is still in development. The version on my website is a test version from two months ago.
I hope I will be able to publish the final version 1.0 in the near future.
But in the mean time: if you downloaded the tesst version an tried it out: all feedback is welcome!
Title: Re: File Organization
Post by: Opagust on 2022-03-03 09:57 am
In order to download the installation file, you'll now have to be logged in.

You may use an account I created:
- username: 'NWC User'
- password: 'Usertools'

Or you can create your own account, so you can be informed of future updates.