F1-help append
Hello!
We'ld like to append specific information to F1-help-text. We work international, so we need these iin different languages available.
We copied the text with change function of SE61 and added a few lines. Unfortunately one has to translate (SE63) the whole text including the original SAP-text because SE61 does only copy one language. The same with dynpro specific additions.
How can one add something to F1-helptext whithout loosing the original text and only to translate the addition?
Many thanks in advance
Helena
Hi,
u can do like this,
Create new Z dataelemnet by giving same domain name which matnr has used and create like this zmatnr1,zmatnr2....like by giving the domain name.Then use it in internal table and u can also do same operation what u have used with matnr field as domain name are same .only u have to assign that.
Regs
Manas Ranjan Panda
Similar Messages
-
Help appending how many times an event ID has occurred next to the unique Event ID.
Hello,
I am trying to figure out how to find how many times an event occurred and then append that next to the single -unique Event ID.
The closest I can find is the Sort-Object Count but I can't figure out how to get that work within the below script.
Any help would be appreciated, the below script works already. but just doesn't have that Event ID count.
Thank you for any help.
Below is the
script to pull all Event Logs for each server, filter them to only display Warnings, Failures, and FailureAudits for Application, System, and Security logs and then remove all duplicate EventIDs so only 1 of each is shown. it then exports that info into a
.CSV per server.
param([string]$days= "31" )
$servers = @("Server1", "Server2" "Server3", "Etc")
$user = Get-Credential
#Set namespace and calculate the date to start from
$namespace = "root\CIMV2"
$BeginDate=[System.Management.ManagementDateTimeConverter]::ToDMTFDateTime((get-date).AddDays(-$days))
$store = "C:\Powershell\MonthlyMaintenance"
foreach ($computer in $servers)
$filter="TimeWritten >= '$BeginDate' AND (type='Warning' OR type='Error' OR type='FailureAudit')"
Echo "Pulling Event Logs for $computer ..."
Get-WmiObject Win32_NTLogEvent -computername $computer -Filter $filter |
sort eventcode -unique |
select Computername,
Logfile,
Type,
@{N='TimeWritten';E={$_.ConvertToDateTime($_.TimeWritten)}},
SourceName,
Message,
Category,
EventCode,
User |
Export-CSV C:\Powershell\MonthlyMaintenance\$computer-Filter.csv
Echo "Done."Unfortunately adding that to the script just outputs a bunch of jargon:
#TYPE Microsoft.PowerShell.Commands.Internal.Format.FormatStartData
ClassId2e4f51ef21dd47e99d3c952918aff9cd
pageHeaderEntry
pageFooterEntry
autosizeInfo
shapeInfo
033ecb2bc07a4d43b5ef94ed5a35d280
Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo
Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo
9e210fe47d09416682b841769c78b8a3
I did try adding it in various ways and removing the initial # Sort EventCode -unique | # and I just get the same jargon
Am I adding it in wrong some how?
Thank you again for any help.
param([string]$days= "31" )
$servers = @("ComputerName")
$user = Get-Credential
#Set namespace and calculate the date to start from
$namespace = "root\CIMV2"
$BeginDate=[System.Management.ManagementDateTimeConverter]::ToDMTFDateTime((get-date).AddDays(-$days))
$store = "C:\Powershell\MonthlyMaintenance"
foreach ($computer in $servers)
$filter="TimeWritten >= '$BeginDate' AND (type='Warning' OR type='Error' OR type='FailureAudit')"
Echo "Pulling Event Logs for $computer ..."
Get-WmiObject Win32_NTLogEvent -computername $computer -Filter $filter |
sort eventcode -unique |
select Computername,
Logfile,
Type,
@{N='TimeWritten';E={$_.ConvertToDateTime($_.TimeWritten)}},
SourceName,
Message,
Category,
User,
EventCode | Select Name,Count | FT -auto|
Export-CSV C:\Powershell\MonthlyMaintenance\$computer-Filter.csv
Echo "Done." -
Help appending dtd's to XML programmatically(SAX parser)
Hi
If i want to validate an xml by writing a dtd and if i want to append that dtd to my xml programattically then how will i do it
i am using java's sax parser currently .
can any one help me out.
Reply will b appritiated
Regards
Geetanjali P.Parsers are for inputting XML data. Your question is about outputting XML data, so your choice of parser is irrelevant. What is relevant is how you are outputting your XML, and you didn't say anything about that. So please do.
-
HELP: Appending new records to File containing 1 Record
Hi, im transferring records to a file, the first line of the file contains the headers (used 'NO END OF LINE'). The problem is that when I write the data records to the file, the first record continues from the end of the Headers line, hence i have a record missing in my statement. I want to append the records below the Headers line. I tried opening the dataset 'for appending' instead of 'for output' but I get the same result.
lv_ds_name_ex = Filename
Code:
Getting field descriptions to use as headers and tranferring to file
open the dataset
OPEN DATASET lv_ds_name_ex FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CLEAR: lt_dfies.
" Get field descriptions from settlement table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'zrl_generic_record'
TABLES
dfies_tab = lt_dfies.
write column headers to the file
LOOP AT lt_dfies.
IF lt_dfies-scrtext_m = 'Char15'.
IF lv_counter < 1.
lt_dfies-scrtext_m = 'Remuneration Amount'.
lv_counter = lv_counter + 1.
ELSE.
lt_dfies-scrtext_m = 'Commission Amount'.
ENDIF.
ENDIF.
TRANSFER lt_dfies-scrtext_m TO lv_ds_name_ex NO END OF LINE.
TRANSFER ';' TO lv_ds_name_ex NO END OF LINE.
ENDLOOP.
Close DATASET lv_ds_name_ex.
Transferring data records to file
open the dataset
OPEN DATASET lv_ds_name_ex FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
write records to the file
LOOP AT lt_generic_record_csv INTO ls_generic_record_csv.
TRANSFER ls_generic_record_csv TO lv_ds_name_ex.
ENDLOOP.
"close the dataset
CLOSE DATASET lv_ds_name_ex.Solution: TRANSFER " " TO lv_ds_name_ex. (This simply adds an empty line/record with an end of line) see code before closing the dataset
open the dataset
OPEN DATASET lv_ds_name_ex FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
CLEAR: lt_dfies.
" Get field descriptions from settlement table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'zrl_generic_record'
TABLES
dfies_tab = lt_dfies.
write column headers to the file
LOOP AT lt_dfies.
IF lt_dfies-scrtext_m = 'Char15'.
IF lv_counter < 1.
lt_dfies-scrtext_m = 'Remuneration Amount'.
lv_counter = lv_counter + 1.
ELSE.
lt_dfies-scrtext_m = 'Commission Amount'.
ENDIF.
ENDIF.
TRANSFER lt_dfies-scrtext_m TO lv_ds_name_ex NO END OF LINE.
TRANSFER ';' TO lv_ds_name_ex NO END OF LINE.
ENDLOOP.
TRANSFER " " TO lv_ds_name_ex.
Close DATASET lv_ds_name_ex.
open the dataset
OPEN DATASET lv_ds_name_ex FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
write records to the file
LOOP AT lt_generic_record_csv INTO ls_generic_record_csv.
TRANSFER ls_generic_record_csv TO lv_ds_name_ex.
ENDLOOP.
"close the dataset
CLOSE DATASET lv_ds_name_ex.
Edited by: Daniel Lebotse on May 15, 2008 5:42 PM -
How to make custom append search help tab default for all users?
I've implemented my own search help append and I need to make the F4 search help to display my tab as default for all users. I know that search help stores the last tab used by the user in memory and when user uses the search help next time the last used tab is displayed but I have to make the system display the tab od my search help append always as default tab. Any idea how to do it?
Message was edited by:
Marcin Milczynskihi
<b>Enhancement using Append structures</b>
Append structures allow you to attach fields to a table without actually having to modify the table itself. You can use the fields in append structures in ABAP programs just as you would any other field in the table.
Click on the append structure tab and opt to create new
structure.
Append structures allow you to enhance tables by adding fields to them that are not part of the standard. With append structures; customers can add their own fields to any table or structure they want.
Append structures are created for use with a specific table. However, a table can have multiple append structures assigned to it
Customers can add their own fields to any table or structure they want.
The customer creates append structures in the customer namespace. The append structure is thus protected against overwriting during an upgrade. The fields in the append structure should also reside in the customer namespace, that is the field names should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP -
Hi,
In BP_CONT component, for address field I need to provide F4 help. And the F4 should contain the addresses with separate fields as (city.street,country).On selecting the row the data should flow as concatenated manner to the address field.
Please provide some idea to achieve this.
Thanks.Hi Ginger,
I would like to add what Vinamra has said, you need to create a search help through se11 transaction. As per your requirement you need to map address field of the selected row to different fields in UI.
In search help we have IMPORTING(IMP) and EXPORTING(EXP) Fields or parameter.
Lets take a simple example, suppose you have three address field house no, street and city. Now you would like to apply F4 help on CITY field so you need to choose CITY field as IMPORTING and EXPORTING parameter in your search help and other fields like HOUSE NO and STREET as EXPORTING parameter only.
Now following code you need write in GET_V_CITY() method
DATA:
lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
ls_map-context_attr = 'STRUCT.CITY'.
ls_map-f4_attr = 'CITY'.
APPEND ls_map TO: lt_inmap, lt_outmap. " map to input and out
ls_map-context_attr = 'STRUCT.HOUSENO. " Context node attribute
ls_map-f4_attr = 'HOUSE_NO'. "corresponding Field in search help
APPEND ls_map TO: lt_outmap.
ls_map-context_attr = 'STRUCT.STREET. " Context node attribute
ls_map-f4_attr = 'STREET'. "corresponding Field in search help
APPEND ls_map TO: lt_outmap.
CREATE OBJECT rv_valuehelp_descriptor
TYPE
cl_bsp_wd_valuehelp_f4descr
EXPORTING
iv_help_id = 'ZSH_ADDRESS'
iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
iv_input_mapping = lt_inmap
iv_output_mapping = lt_outmap.
May this will help you.
Regards
Ajay -
Getting error while adding a custom field (with input help) through AET
Hi All,
I need to add two custom field under Service orders at Item level in component BT140I_SRVP.
One field is required to have the input search help f4 and autopopulates the second field
I am able to add one field(not requiring help) successfully through AET .
I have created one Zsearch_help in se11 and its successfully running while I am testing it
While adding fsecond field through AET,I need to enter following details as -
field label,search relevant ,serach help etc.
When I type the name of my 'Zsearch_help' against field search help it gives me following error
'Search help is not compatible'.
Please help me out.Kindly be detailed as I am new to SAP CRM.Thanks for very helpful reply. After implementing the suggested SAP note, I am able to see the getter and setter methods.
So one of my problem has got solved with your kind help:)
As per your another suggestion,I have created the enhanced fields without the search help from AET in the node BTAdminI with names Plant(ZZPLANT) and Storage Location(ZZStoarge_Loc).
Now I am facing below problem:
Since Plant needs to autopopulated by Storage Location (search Help ZOFI_SHLP_STORAGE_LOC),So I need to Implement Getter setter method.
I have written below code into Get_V_ZZStorage_Loc Method:
method GET_V_ZZSTORAGE_LOC.
DATA:
ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
ls_map-context_attr = 'ZZSTORAGE_LOC'.
ls_map-f4_attr = 'STORAGE_LOC'. (Storage_loc is the parameter defined in search help)
APPEND ls_map TO: lt_inmap, lt_outmap.
CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr
EXPORTING
iv_help_id = 'ZOFI_SHLP_STORAGE_LOC1'
iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_callback
iv_input_mapping = lt_inmap
iv_output_mapping = lt_outmap.
endmethod.
But its not working.Should I write some code in Get_P_XX or some other method also?
Kindly suggest . -
Qtn: I have 10 standard elementary search helps in collective standard search help, how to deactivate the 10th elementary search help?
Hello,
this topic is still a problem for me, does anybody have an idea.
Just to show what's my problem:
Collective Search help KRED does include a SAP append-search help ASH_KRED which holds the elementary search helps KREDC, KREDE, KREDM, KREDW.
The search helps KREDE, KREDM, KREDW should not be displayed, so I added another Serach-Help-Append ZKRED_CUST at the end of CSH KRED which holds these 3 SH's with the hidden flag.
That works, the SH's are not shown anymore.
I also added some other of the Original SAP SH's (e.g. KREDA) with the hidden flag and added changed copies of these (e.g ZKREDA) there to be shown instead.
All this can be done modification free by appends.
The folders of the elementary search helps are shown in the order as they are found included in the KRED SH and the append to this SH.
This means that the not hidden Sh KREDC from ASH_KRED is shown before all the "custimized" ZKREDx -SH's. But we need this SH not very often, so that I want it to displayed al the right-most position of the folders of SH's or at the most down postition of the drop-down-selection of SH's.
But I have not found any way to do this modification free.
The only way to archive this is to modify ASH_KRED by setting the Hidden-Flag for KREDC and add this SH at the end of append-SH ZKRED_CUST again.
But I want avoid this modification.
So, is there any way to do this without modifing any of the original SAP SH's ?
Helmut Fischer -
TS1382 how do I check what generation of ipod touch I have
I'm trying to check what generation of ipod my son has. It's an ipod touch but not sure whether it's a 3 or 4. Please help.
Append the last three characters of its serial number to http://www.everymac.com/ultimate-mac-lookup/?search_keywords= and load the page.
(101223) -
Can you force HTTPService to go to server instead of looking in cache?
I think I've found out the reason my Flex/php/mySQL database test app isn't working. I used the wizard to generate the .php service code to get at the mySQL database and am using the HTTPService to FindAll records, Delete a record and the do a FindAll again. My deleted record shows up again as not deleted (even thought phpMyAdmin confirms that it was indeed deleted), but when I empty my cache in IE 8 and then do the FindAll again, it works and the deleted record is gone. Soooooo....how do I force my HTTPService .send request to always go to the server and not look in the cache
I am new to mySQL and to php, so don't assume I know anything when you post an answer.
Thanks very much in advance to any of you gurus who can help.Append the date/time to the url to make it unique.
http://ria.dzone.com/news/flex-httpservice-browser-cache
If this post answers your question or helps, please mark it as such. -
WebCenter Wikis and Discussions
Hi ,
Please can you guide for the following issue.
I have downloaded the sample code for WebCenter Wikis and Discussions from
http://www.oracle.com/technology/products/webcenter/release11_demos.html
The main URL of ows_wikis
http://10.200.15.118:8890/owc_wiki - Works fine
It is deployed successfully on WebLogic Server. I can see some URLs like
http://10.200.15.118:7001/SamplePortlets_11g/faces/samples/webcenter/portlets/wiki/help.jsp (Help Page) - Success
or
http://10.200.15.118:7001/SamplePortlets_11g/faces/samples/webcenter/portlets/wiki/readme_blog.html - Success
But if I try to run
http://10.200.15.118:7001/SamplePortlets_11g/faces/samples/webcenter/portlets/wiki/views/main.jsp (main Page) - Fails
Are there any configuration or how to run main pages of Wikis or Discussions, etc?
Your co-operation will be appreciated.
Thanks & Regards,
Pandurang
The error log as
Error 500--Internal Server Error
oracle.portlet.server.containerimpl.taglib.ContainerJSPException: Error: portlet render response not available to actionURL tag
at oracle.portlet.server.containerimpl.taglib.PortletURLTag.doStartTag(PortletURLTag.java:82)
at jsp_servlet._samples._webcenter._portlets._wiki._views.__main._jspService(__main.java:454)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:499)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:473)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:141)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
at org.apache.myfaces.portlet.faces.application.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:133)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)I am experiencing the exact same conditions. Looking at the access.log on WLS shows -
"GET /WCWikiBlog/portlet/WCWikis/mode/ HTTP/1.1 500 1935".
The line in the stack trace -
"at com.plumtree.portlet.servlet.BaseServlet.getPortletMode(BaseServlet.java:173)"
suggests that there should be an additional path descriptor specified as "edit/view/help" appended to the GET string.
One of the gatewayed URL's that may correspond to the GET string above shows -
"/WCWikiBlog/pt_action?javax.portlet.PT_PORTLET_NAME_KEY=WCWikis&javax.portlet.mode=view&wiki_page=Documentation"
This appears to specify the portlet mode quite plainly. And, I can't request the pt_action directly because it complains about not being gatewayed. Also, pt_action maps to a plumtree ActionServlet, so I can't see the code. Is there a parameter "name" that is incorrect?
We are using ALUI 6.5 MP1. Any possible compatibility issues?
thanks,
Mike -
Hello,
I'm new to Java programming, I have programmed in other languages. Heres my problem:
At the console someone enters say... "monkee1;monkee2;monkee3 -a -b -c"
how can i trim it to just "monkee1;monkee2;monkee3 -a -b -c" getting rid the white space
Thanks in advanceMy solution asumed that 1 space must be kept.You are probably right, so, my version needs to be upgraded to[...]
String tmp;
String del; // new
else if ( ";".equals(tmp) ) {
// arg delimiter -> reset
helper.append(tmp);
result.add(helper.toString());
helper.delete(0, helper.length());
del = ""; // new
else {
// arg text
helper.append(del); // new
helper.append(tmp);
del = " "; // new -
Call F4 key method ??
hi all ,
When I click search help button in my dynamic alv , I want to open modal diyalog box for help .
gs_fcat-col_pos = mon + 5.
gs_fcat-fieldname = lv_field.
gs_fcat-ref_table = '/DTY/_DNDMM_ATZH'.
gs_fcat-ref_field = 'ATZHL' .
gs_fcat-F4AVAILABL = 'X'. " My search help
APPEND gs_fcat TO lt_fieldcat.
How Can find my search help sy-ucomm . or
What is metod ??
Thanks Reply .
Serkann
Edited by: Serkann Taskann on Nov 3, 2008 4:16 PMHi,
The F1 and F4 events of the SAP textedit are registered using the SET_REGISTERED_EVENTS method to ensure that they are passed to the application server when they occur. F1 is defined as a system event, F4 as an application event.
Where f4 event will act as input help.
Cheers!!
VEnk@ -
Hi,
I've been trying to install pylookup from here: https://github.com/tsgates/pylookup , using README and this http://pygments.org/demo/4772/ sample.
pylookup commands are available, but always 'No matches for "os"' or anything else.
I tried building a base from either python-docs package material
$ ./pylookup.py -u /usr/share/doc/python/html/
or online documentation
$ ./pylookup.py -u http://docs.python.org
but no use. pylookup.db remains empty as it probably should not.
I tried to change the Python version in the makefile (2 to 3 and back)
VER := $(shell python --version 2>&1 | grep -o "[0-9].[0-9].[0-9]")
ZIP := python-${VER}-docs-html.zip
URL := http://docs.python.org/archives/${ZIP}
download:
@if [ ! -e $(ZIP) ] ; then \
echo "Downloading ${URL}"; \
wget ${URL}; \
unzip ${ZIP}; \
fi
./pylookup.py -u $(ZIP:.zip=)
.PHONY: download
but it did not make any difference. I can't understand, BTW, where the makefile file comes into play. Neither do I see how the thing should know about my browser.
This is the relevant part of my .emacs:
;; Pylookup
(setq pylookup-dir "~/src/emacs-repos/pylookup")
(add-to-list 'load-path pylookup-dir)
(eval-when-compile (require 'pylookup))
(setq pylookup-program
(concat pylookup-dir "/pylookup.py"))
(setq pylookup-db-file
(concat pylookup-dir "/pylookup.db"))
(autoload 'pylookup-lookup "pylookup"
"Lookup SEARCH-TERM in the Python HTML indexes." t)
(autoload 'pylookup-update "pylookup"
"Run pylookup-update and create the database at 'pylookup-db-file'." t)
;; bind a key for quick lookups
(global-set-key "\C-ch" 'pylookup-lookup)
UPD:
It occured to me to run make, but it ends up with errors:
$ make
Downloading http://docs.python.org/archives/python-3.2.2-docs-html.zip
--2012-01-08 13:31:06-- http://docs.python.org/archives/python-3.2.2-docs-html.zip
Resolving docs.python.org... 82.94.164.162, 2001:888:2000:d::a2
Connecting to docs.python.org|82.94.164.162|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-01-08 13:31:07 ERROR 404: Not Found.
unzip: cannot find or open python-3.2.2-docs-html.zip, python-3.2.2-docs-html.zip.zip or python-3.2.2-docs-html.zip.ZIP.
make: *** [download] Error 9
The whole make thing seems optional, though. Or does it?
Last edited by Llama (2012-01-08 09:40:59)I tried to run pylookup.py in pdb, on the local doc source:
./pylookup.py -u /usr/share/doc/python/html/
It ran fine until this statement: parser.feed(index), line 227. No exceptions raised (at least I didn't catch any); looks like it silently refused to dump the index into pylookup.db.
I suspect Python 3 incompatibility (at least Python 2.7 examples from my crash course in debugging took some toll, and it wasn't always syntax). Unfortunately, my expertise stops at line 227 .
pylookup.py, exactly as debugged:
#!/usr/bin/env python
Pylookup is to lookup entries from python documentation, especially within
emacs. Pylookup adopts most of ideas from haddoc, lovely toolkit by Martin
Blais.
(usage)
./pylookup.py -l ljust
./pylookup.py -u http://docs.python.org
from __future__ import with_statement
import os
import sys
import re
import pdb
try:
import cPickle as pickle
except:
import pickle
import formatter
from os.path import join, dirname, exists, abspath, expanduser
from contextlib import closing
if sys.version_info[0] == 3:
import html.parser as htmllib
import urllib.parse as urlparse
import urllib.request as urllib
else:
import htmllib, urllib, urlparse
VERBOSE = False
FORMATS = {
"Emacs" : "{entry}\t({desc})\t[{book}];{url}",
"Terminal" : "{entry}\t({desc})\t[{book}]\n{url}"
def build_book(s, num):
Build book identifier from `s`, with `num` links.
for matcher, replacement in (("library", "lib"),
("c-api", "api"),
("reference", "ref"),
("", "etc")):
if matcher in s:
return replacement if num == 1 else "%s/%d" % (replacement, num)
def trim(s):
Add any globle filtering rules here
s = s.replace( "Python Enhancement Proposals!", "")
s = s.replace( "PEP ", "PEP-")
return s
class Element(object):
def __init__(self, entry, desc, book, url):
self.book = book
self.url = url
self.desc = desc
self.entry = entry
def __format__(self, format_spec):
return format_spec.format(entry=self.entry, desc=self.desc,
book=self.book, url=self.url)
def match_insensitive(self, key):
Match key case insensitive against entry and desc.
`key` : Lowercase string.
return key in self.entry.lower() or key in self.desc.lower()
def match_sensitive(self, key):
Match key case sensitive against entry and desc.
`key` : Lowercase string.
return key in self.entry or key in self.desc
def match_in_entry_insensitive(self, key):
Match key case insensitive against entry.
`key` : Lowercase string.
return key in self.entry.lower()
def match_in_entry_sensitive(self, key):
Match key case sensitive against entry.
`key` : Lowercase string.
return key in self.entry
def get_matcher(insensitive=True, desc=True):
Get `Element.match_*` function.
>>> get_matcher(0, 0)
<unbound method Element.match_in_entry_sensitive>
>>> get_matcher(1, 0)
<unbound method Element.match_in_entry_insensitive>
>>> get_matcher(0, 1)
<unbound method Element.match_sensitive>
>>> get_matcher(1, 1)
<unbound method Element.match_insensitive>
_sensitive = "_insensitive" if insensitive else "_sensitive"
_in_entry = "" if desc else "_in_entry"
return getattr(Element, "match{0}{1}".format(_in_entry, _sensitive))
class IndexProcessor( htmllib.HTMLParser ):
Extract the index links from a Python HTML documentation index.
def __init__( self, writer, dirn):
htmllib.HTMLParser.__init__( self, formatter.NullFormatter() )
self.writer = writer
self.dirn = dirn
self.entry = ""
self.desc = ""
self.list_entry = False
self.do_entry = False
self.one_entry = False
self.num_of_a = 0
self.desc_cnt = 0
def start_dd( self, att ):
self.list_entry = True
def end_dd( self ):
self.list_entry = False
def start_dt( self, att ):
self.one_entry = True
self.num_of_a = 0
def end_dt( self ):
self.do_entry = False
def start_a( self, att ):
if self.one_entry:
self.url = join( self.dirn, dict( att )[ 'href' ] )
self.save_bgn()
def end_a( self ):
global VERBOSE
if self.one_entry:
if self.num_of_a == 0 :
self.desc = self.save_end()
if VERBOSE:
self.desc_cnt += 1
if self.desc_cnt % 100 == 0:
sys.stdout.write("%04d %s\r" \
% (self.desc_cnt, self.desc.ljust(80)))
# extract fist element
# ex) __and__() (in module operator)
if not self.list_entry :
self.entry = re.sub( "\([^)]+\)", "", self.desc )
# clean up PEP
self.entry = trim(self.entry)
match = re.search( "\([^)]+\)", self.desc )
if match :
self.desc = match.group(0)
self.desc = trim(re.sub( "[()]", "", self.desc ))
self.num_of_a += 1
book = build_book(self.url, self.num_of_a)
e = Element(self.entry, self.desc, book, self.url)
self.writer(e)
def update(db, urls, append=False):
"""Update database with entries from urls.
`db` : filename to database
`urls` : list of URL
`append` : append to db
mode = "ab" if append else "wb"
with open(db, mode) as f:
writer = lambda e: pickle.dump(e, f)
for url in urls:
# detech 'file' or 'url' schemes
parsed = urlparse.urlparse(url)
if not parsed.scheme or parsed.scheme == "file":
dst = abspath(expanduser(parsed.path))
if not os.path.exists(dst):
print("Error: %s doesn't exist" % dst)
exit(1)
url = "file://%s" % dst
else:
url = parsed.geturl()
# direct to genindex-all.html
if not url.endswith('.html'):
url = url.rstrip("/") + "/genindex-all.html"
print("Wait for a few seconds ..\nFetching htmls from '%s'" % url)
try:
index = urllib.urlopen(url).read()
if not issubclass(type(index), str):
index = index.decode()
parser = IndexProcessor(writer, dirname(url))
with closing(parser):
parser.feed(index)
except IOError:
print("Error: fetching file from the web: '%s'" % sys.exc_info())
def lookup(db, key, format_spec, out=sys.stdout, insensitive=True, desc=True):
"""Lookup key from database and print to out.
`db` : filename to database
`key` : key to lookup
`out` : file-like to write to
`insensitive` : lookup key case insensitive
matcher = get_matcher(insensitive, desc)
if insensitive:
key = key.lower()
with open(db, "rb") as f:
try:
while True:
e = pickle.load(f)
if matcher(e, key):
out.write('%s\n' % format(e, format_spec))
except EOFError:
pass
def cache(db, out=sys.stdout):
"""Print unique entries from db to out.
`db` : filename to database
`out` : file-like to write to
with open(db, "rb") as f:
keys = set()
try:
while True:
e = pickle.load(f)
k = e.entry
k = re.sub( "\([^)]*\)", "", k )
k = re.sub( "\[[^]]*\]", "", k )
keys.add(k)
except EOFError:
pass
for k in keys:
out.write('%s\n' % k)
if __name__ == "__main__":
pdb.set_trace()
import optparse
parser = optparse.OptionParser( __doc__.strip() )
parser.add_option( "-d", "--db",
help="database name",
dest="db", default="pylookup.db" )
parser.add_option( "-l", "--lookup",
help="keyword to search",
dest="key" )
parser.add_option( "-u", "--update",
help="update url or path",
action="append", type="str", dest="url" )
parser.add_option( "-c", "--cache" ,
help="extract keywords, internally used",
action="store_true", default=False, dest="cache")
parser.add_option( "-a", "--append",
help="append to the db from multiple sources",
action="store_true", default=False, dest="append")
parser.add_option( "-f", "--format",
help="type of output formatting, valid: Emacs, Terminal",
choices=["Emacs", "Terminal"],
default="Terminal", dest="format")
parser.add_option( "-i", "--insensitive", default=1, choices=['0', '1'],
help="SEARCH OPTION: insensitive search "
"(valid: 0, 1; default: %default)")
parser.add_option( "-s", "--desc", default=1, choices=['0', '1'],
help="SEARCH OPTION: include description field "
"(valid: 0, 1; default: %default)")
parser.add_option("-v", "--verbose",
help="verbose", action="store_true",
dest="verbose", default=False)
( opts, args ) = parser.parse_args()
VERBOSE = opts.verbose
if opts.url:
update(opts.db, opts.url, opts.append)
if opts.cache:
cache(opts.db)
if opts.key:
lookup(opts.db, opts.key, FORMATS[opts.format],
insensitive=int(opts.insensitive), desc=int(opts.desc)) -
Alright, I have a list of "questions" for a particular
student, testscore, identifier (what the score is associated too,
like h1.1.5) and a testid, I need to list the student with the
scores and questions together, enter the score and if it doesn't
exist insert it and if it does exist update. I need to keep the
score_identifierscore and score_identifier together and insert it
with all the other information and "questions".
Example:
<cfoutput query="stand">
<select name="score_identifierscore"
id="score_identifierscore">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<input name="score_identifier" type="hidden"
id="score_identifier" value="#stand.ident_name#">
#stand.ident_name#
#stand.ident_description#
</cfoutput>
<cfoutput>
<input name="score_teacherid" type="hidden"
id="score_teacherid" value="#session.pstid#">
<input name="score_teachername" type="hidden"
id="score_teachername" value="#session.fname# #session.lname#">
<input name="score_studentid" type="hidden"
id="score_studentid" value="#url.stid#">
<input name="score_vid" type="hidden" id="score_vid"
value="#url.vid#">
<input name="score_staid" type="hidden" id="score_staid"
value="#url.staid#">
<input name="totalrows" type="hidden" id="totalrows"
value="#totalrows#">
<input name="score_studentname" type="hidden"
value="#studentname.first_name#
#studentname.last_name#"></cfoutput>
Any help is appreciated,
Matthew>Just curious to know what extra can be done using power query?
You can, for instance, Append the data from the two databases into a single PowerPivot table. And you don't have to land the data in a worksheet first. Power Query can load it directly into the PowerPivot model.
see
Append queries
The Append operation creates a new query that contains all rows from a first query followed by all rows from a second query.
http://office.microsoft.com/en-us/excel-help/append-queries-HA104149760.aspx?CTT=5&origin=HA103993872
In general, Power Query is intended to eliminate the need to load data into worksheets and manipulate it before reporting.
David
David http://blogs.msdn.com/b/dbrowne/
Maybe you are looking for
-
for itunes 11: movie that are not purchased via itunes are now loaded into and catagorized as "home videos". I want all of my movies in one spot under Movies as they always were. How can i tweak/resolve this?
-
I often get the message that I am being disconnected from chat because i've logged on from another computer. I never use chat, and it just seems to be a problem. How can I get rid of it?
-
Is the hair space non-breaking?
I just started working with Khmer text in InDesign CS 5.5, and in order to use a Khmer hunspell dictionary for spelling I placed a hair space between words and applied a grep style of 1% horizontal width (because Khmer does not use spaces between wor
-
Dell laptop media buttons and iTunes?
I have a dell laptop and love iTunes. However, the media buttons on the front only work when iTunes has focus. I have heard of a plug-in that allows it to grab the commands at anytime. Could anyone here direct me to that plug-in?
-
How can I open a new browser window from an event handler in UIX? Thanks in advance, Martmn Patrici