Can anyone tell me how to switch my environment for a Settled Batch List Request from SANDBOX to PRODUCTION?
I've looked everywhere for documentation and the source code, and the farthest I've gotten is
settledBatchListRequest = apicontractsv1.getSettledBatchListRequest()
apicontrollersbase.APIOperationBase(settledBatchListRequest).setenvironment(constants.PRODUCTION)
But I still get an 'Invalid Credentials' Error
This is definitely confusing, I ended up looking at the source here:
https://github.com/AuthorizeNet/sdk-python/blob/master/authorizenet/constants.py
This should help:
>>> from authorizenet.constants import constants
>>> constants.PRODUCTION
'https://api2.authorize.net/xml/v1/request.api'
>>> constants.SANDBOX
'https://apitest.authorize.net/xml/v1/request.api'
Ultimately I usually end up setting these in my config files like so:
Production:
AUTH_NET_ENVIRONMENT = "https://api2.authorize.net/xml/v1/request.api"
Dev:
AUTH_NET_ENVIRONMENT = "https://apitest.authorize.net/xml/v1/request.api"
Then in your controller:
controller.setenvironment(settings.AUTH_NET_ENVIRONMENT)
Assuming you are creating the controller correctly, adding this line:
from authorizenet.constants import constants
or replacing setenvironment(constants.PRODUCTION) with:
setenvironment("https://api2.authorize.net/xml/v1/request.api")
should work. Hope this helps!
Using flask, flask-assets, webassets
I am trying to pass a filter specific configuration for a particular filter in webassets, but haven't been able to do so, so far.
Have read the documentation multiple times to no avail. Have also gone through the source code, but that hasn't helped either.
Specifics:
The filter I'm trying to use is cleancss
And the particular configuration I'm trying to pass is --skip-rebase
According to the link to cleancss docs above, I should be able to pass the --skip-rebase option in CLEANCSS_EXTRA_ARGS. But where do I put that?
What I've tried so far, passing as flask config variables:
CLEANCSS_EXTRA_ARGS = ['--skip-rebase'] # actually works, see answer!
CLEANCSS_EXTRA_ARGS = ['skip-rebase'] # doesn't work!
ASSETS_CLEANCSS_EXTRA_ARGS = ['--skip-rebase'] # doesn't work!
FLASK_ASSETS_CLEANCSS_EXTRA_ARGS = ['--skip-rebase'] # doesn't work!
ASSETS_CLEANCSS_EXTRA_ARGS = ['skip-rebase'] # doesn't work!
FLASK_ASSETS_CLEANCSS_EXTRA_ARGS = ['skip-rebase'] # doesn't work!
ps: I also tried modifying the source to check if cleancss parameters are being correctly passed to the command line, and it is, so the problem is only in specifying the option correctly in the app configuration.
On retrying with the first option in question:
CLEANCSS_EXTRA_ARGS = ['--skip-rebase']
It worked!
More info available in the flask assets repo issues.
In my hurry I must have tried with:
CLEANCSS_EXTRA_ARGS = ['skip-rebase']
which didn't work and hence the question.
This feature should be documented though. Will probably submit a pull request for doc improvement.
Also note that this requires version 0.11 (webassets) and above.
I am trying to use Pubnub Access Management with Python by I always get an error message saying that the 'Signature Does not Match'. I know their documentation says that this means that the Secret/Publish/Subscribe keys may be wrong but I have triple checked that they are correct. Also checked in Pubnub developer console and it works fine from there.
Here is the method that I am using:
def get_pubnub_token(request, connector_id):
pubnub = Pubnub(settings.PUBKEY, settings.SUBKEY, secret_key=settings.PUB_SECRET_KEY)
authkey = str(uuid.uuid4())
result = pubnub.grant(channel=connector_id+"-pnpres", auth_key=authkey, read=True, write=True, ttl=60)
if result['error']:
return HttpResponse(status=result['status'])
result = pubnub.grant(channel=connector_id, auth_key=authkey, read=True, write=True, ttl=60)
if result['error']:
return HttpResponse(status=result['status'])
result = pubnub.grant(channel=connector_id+"-stream", auth_key=authkey, read=True, write=True, ttl=60)
if result['error']:
return HttpResponse(status=result['status'])
jsonstr = get_json(authkey)
return HttpResponse(jsonstr, content_type='application/json')
I wonder if anyone has done this before and if they could give me any tips as to why I could be seeing this error.
Which version of the SDK are you on?
Also, this may also happen because your system clock is not set to NTP. Can you verify its set to NTP, and try again?
If it persists, please contact us at support#pubnub.com and we'd be happy to help trace the issue down with you.
geremy
There were problems using version 3.7.1 of the SDK in python 3.4.3. They were addressed by Pubnub's developers some time last night and it seems to have been resolved in their development code. I guess they will put it into the production code some time in the near future.
i started using couchdb with python-couchdb recently. The problem is when i use futon run my views written in python i get the following error message:
Error: os_process_error
{exit_status,1}
even for the default view it crashes.
def fun(doc):
yield None, doc
i haven't yet found much information regarding this issue so at this point im really lost. This is the log i get from couchdb:
{<0.3907.0>,crash_report,
[[{initial_call,{couch_file,init,['Argument__1']}},
{pid,<0.3907.0>},
{registered_name,[]},
{error_info,
{exit,
{os_process_error,{exit_status,1}},
[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}},
{ancestors,
[<0.3906.0>,couch_view,couch_secondary_services,couch_server_sup,
<0.33.0>]},
{messages,[]},
{links,[#Port<0.1483>,<0.3910.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,377},
{stack_size,24},
{reductions,1423}],
[{neighbour,
[{pid,<0.3910.0>},
{registered_name,[]},
{initial_call,{couch_ref_counter,init,['Argument__1']}},
{current_function,{gen_server,loop,6}},
{ancestors,
[<0.3906.0>,couch_view,couch_secondary_services,
couch_server_sup,<0.33.0>]},
{messages,[]},
{links,[#Port<0.1483>,<0.3910.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,377},
{stack_size,24},
{reductions,1423}],
[{neighbour,
[{pid,<0.3910.0>},
{registered_name,[]},
{initial_call,{couch_ref_counter,init,['Argument__1']}},
{current_function,{gen_server,loop,6}},
{ancestors,
[<0.3906.0>,couch_view,couch_secondary_services,
couch_server_sup,<0.33.0>]},
{messages,
[{'DOWN',#Ref<0.0.0.16475>,process,<0.3906.0>,
{os_process_error,{exit_status,1}}}]},
{links,[<0.3907.0>]},
{dictionary,[]},
{trap_exit,false},
{status,runnable},
{heap_size,233},
{stack_size,9},
{reductions,47}]}]]}}
Im running this on Ubuntu 10.04, with Django, couchdb and python-couchdb. The views on javascript works fine.
For couchdb-python query server exit status 1 means some error that.
What version of couchdb/couchdb-python you're uses?
Whats output will be if you run couchpy (or /usr/local/bin/couchpy or whatever you have setted in query_servers section for python key) directly from command line? Example as it should be:
$
~ $ couchpy
["reset"]
true
["add_fun", "def fun(doc): yield None, None"]
true
["map_doc", {}]
[[[null, null]]]
If p.2 works fine, try to enable CouchDB debug log level to trace query server commands and notice when it falls. If you're sure that this is a python query server bug, please write some story about it. Thanks(:
P.S. I hope that you have setup python query server correctly, but double things check never was useless(;
I'm trying to create a python program (using pyUNO ) to make some changes on a OpenOffice calc sheet.
I've launched previously OpenOffice on "accept" mode to be able to connect from an external program. Apparently, should be as easy as:
import uno
# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()
# create the UnoUrlResolver
resolver = localContext.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext)
# connect to the running office
ctx = resolver.resolve("uno:socket,host=localhost,port=2002;"
"urp;StarOffice.ComponentContext")
smgr = ctx.ServiceManager
# get the central desktop object
DESKTOP =smgr.createInstanceWithContext("com.sun.star.frame.Desktop", ctx)
#The calling it's not exactly this way, just to simplify the code
DESKTOP.loadComponentFromURL('file.ods')
But I get an AttributeError when I try to access loadComponentFromURL. If I make a dir(DESKTOP), I've see only the following attributes/methods:
['ActiveFrame', 'DispatchRecorderSupplier', 'ImplementationId', 'ImplementationName',
'IsPlugged', 'PropertySetInfo', 'SupportedServiceNames', 'SuspendQuickstartVeto',
'Title', 'Types', 'addEventListener', 'addPropertyChangeListener',
'addVetoableChangeListener', 'dispose', 'disposing', 'getImplementationId',
'getImplementationName', 'getPropertySetInfo', 'getPropertyValue',
'getSupportedServiceNames', 'getTypes', 'handle', 'queryInterface',
'removeEventListener', 'removePropertyChangeListener', 'removeVetoableChangeListener',
'setPropertyValue', 'supportsService']
I've read that there are where a bug doing the same, but on OpenOffice 3.0 (I'm using OpenOffice 3.1 over Red Hat5.3). I've tried to use the workaround stated here, but they don't seems to be working.
Any ideas?
It has been a long time since I did anything with PyUNO, but looking at the code that worked last time I ran it back in '06, I did my load document like this:
def urlify(path):
return uno.systemPathToFileUrl(os.path.realpath(path))
desktop.loadComponentFromURL(
urlify(tempfilename), "_blank", 0, ())
Your example is a simplified version, and I'm not sure if you've removed the extra arguments intentionally or not intentionally.
If loadComponentFromURL isn't there, then the API has changed or there's something else wrong, I've read through your code and it looks like you're doing all the same things I have.
I don't believe that the dir() of the methods on the desktop object will be useful, as I think there's a __getattr__ method being used to proxy through the requests, and all the methods you've printed out are utility methods used for the stand-in object for the com.sun.star.frame.Desktop.
I think perhaps the failure could be that there's no method named loadComponentFromURL that has exactly 1 argument. Perhaps giving the 4 argument version will result in the method being found and used. This could simply be an impedance mismatch between Python and Java, where Java has call-signature method overloading.
This looks like issue 90701: http://www.openoffice.org/issues/show_bug.cgi?id=90701
See also http://piiis.blogspot.com/2008/10/pyuno-broken-in-ooo-30-with-system.html and http://udk.openoffice.org/python/python-bridge.html