Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 'ls' and 'ls -d' argument #30

Open
pbmarklf opened this issue Jun 15, 2012 · 5 comments
Open

Fix for 'ls' and 'ls -d' argument #30

pbmarklf opened this issue Jun 15, 2012 · 5 comments

Comments

@pbmarklf
Copy link
Contributor

  1. I've fixed 'ls' so you can look up assets by assetId again. (The code had not been updated since WebGUI::Asset->newById() was renamed to WebGUI::Asset->newByDynamicClass().)

  2. I've added a '-d' argument to 'ls', which lists only the specified asset(s) rather than their children (similar to '-d' for ls(1)).

These fixes are in my GitHub repository git@github.com:pbmarklf/wgdev.git.

Graham, would you have preferred these to be 2 separate commits?

@haarg
Copy link
Owner

haarg commented Jun 15, 2012

I'm not clear on the first issue you listed. newByDynamicClass is the older method from WebGUI 7, and newById was added in WebGUI 8. It should be possible to just use ->new in all cases in WebGUI 7 unless something is broken. Can you describe the problem you can into?

The -d option looks good, so I'd like to have that as a separate commit.

@pbmarklf
Copy link
Contributor Author

The problem is in wG 7, not wG 8. The code at GitHub uses newById(),
which won't work in wG 7.

I'll look at just using new().

Also, I'll break this into 2 commits (I'm still a Git newbie, so I'm not
used to committing as often as works well for Git).

On 6/15/2012 4:54 PM, Graham Knop wrote:

I'm not clear on the first issue you listed. newByDynamicClass is the older method from WebGUI 7, and newById was added in WebGUI 8. It should be possible to just use ->new in all cases in WebGUI 7 unless something is broken. Can you describe the problem you can into?

The -d option looks good, so I'd like to have that as a separate commit.


Reply to this email directly or view it on GitHub:
#30 (comment)

Mark Leighton Fisher
317-220-3687
markleightonfisher@gmail.com

@haarg
Copy link
Owner

haarg commented Jun 16, 2012

In WebGUI 7, you can use either ->new or ->newByDynamicClass. Both will work.
In WebGUI 8, you need to use ->newById.

The existing code uses newById if it exists (in WebGUI 8) and new otherwise (WebGUI 7).

Your proposed change breaks it in WebGUI 8 and doesn't fix anything in WebGUI 7.

If you actually ran into a problem with this, I think the real cause lies elsewhere.

@pbmarklf
Copy link
Contributor Author

I just figured out where I went wrong -- the current 'ls' only displays
anything if the specified Assets have children. So entering an assetId
for a childless Asset will display nothing (as it should). (And of
course, entering the URL for that childless Asset will also display
nothing, but in the project I'm on (cleaning up webgui.log) oftentimes I
only have the assetId to work with.)

Adding the '-d' option should actually help with that case, as it makes
the distinction between displaying parent and child Assets clearer in
the code and the documentation.

Sorry for the confusion -- I'll create a new commit with just the 'ls
-d' option added.

Mark Leighton Fisher
markleightonfisher@gmail.com
317-220-3687
Skype: markleightonfisher

On 6/16/2012 1:59 PM, Graham Knop wrote:

In WebGUI 7, you can use either ->new or ->newByDynamicClass. Both will work.
In WebGUI 8, you need to use ->newById.

The existing code uses newById if it exists (in WebGUI 8) and new otherwise (WebGUI 7).

Your proposed change breaks it in WebGUI 8 and doesn't fix anything in WebGUI 7.

If you actually ran into a problem with this, I think the real cause lies elsewhere.


Reply to this email directly or view it on GitHub:
#30 (comment)

Mark Leighton Fisher
317-220-3687
markleightonfisher@gmail.com

@pbmarklf
Copy link
Contributor Author

https://github.com/pbmarklf/wgdev now has only the 'ls -d' commit
(a7c470d) (and the Batchedit command
commit).

Thanks for your patience.

Mark Leighton Fisher
markleightonfisher@gmail.com
317-220-3687
Skype: markleightonfisher

On 6/18/2012 4:22 PM, Mark Leighton Fisher wrote:

I just figured out where I went wrong -- the current 'ls' only
displays anything if the specified Assets have children. So entering
an assetId for a childless Asset will display nothing (as it should).
(And of course, entering the URL for that childless Asset will also
display nothing, but in the project I'm on (cleaning up webgui.log)
oftentimes I only have the assetId to work with.)

Adding the '-d' option should actually help with that case, as it
makes the distinction between displaying parent and child Assets
clearer in the code and the documentation.

Sorry for the confusion -- I'll create a new commit with just the 'ls
-d' option added.

Mark Leighton Fisher
markleightonfisher@gmail.com
317-220-3687
Skype: markleightonfisher

On 6/16/2012 1:59 PM, Graham Knop wrote:

In WebGUI 7, you can use either ->new or ->newByDynamicClass. Both
will work.
In WebGUI 8, you need to use ->newById.

The existing code uses newById if it exists (in WebGUI 8) and new
otherwise (WebGUI 7).

Your proposed change breaks it in WebGUI 8 and doesn't fix anything
in WebGUI 7.

If you actually ran into a problem with this, I think the real cause
lies elsewhere.


Reply to this email directly or view it on GitHub:
#30 (comment)

Mark Leighton Fisher
317-220-3687
markleightonfisher@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants