Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated examples. Removed RPM spec.

  • Loading branch information...
commit ef31c13453c249606505201ca88c9c556eb42d4c 1 parent a1c5437
Max Gutman authored
Showing with 12 additions and 80 deletions.
  1. +9 −9 README.txt
  2. +0 −64 Rpm.spec
  3. +3 −7 examples/__init__.py
View
18 README.txt
@@ -26,7 +26,7 @@ Zendesk Python Library is available on pypi, so installation should be fairly si
Example Use
-----------------------------------------------------------------------------------------------------
- from zendesk import Zendesk, get_id_from_url
+ from zendesk import Zendesk, get_id_from_url
################################################################
## NEW CONNECTION CLIENT
@@ -49,14 +49,14 @@ Example Use
'description': 'please reheat my coffee',
'set_tags': 'coffee drinks',
'ticket_field_entries': [
- {
- 'ticket_field_id': 1,
- 'value': 'venti'
- },
- {
- 'ticket_field_id': 2,
- 'value': '$10'
- }
+ {
+ 'ticket_field_id': 1,
+ 'value': 'venti'
+ },
+ {
+ 'ticket_field_id': 2,
+ 'value': '$10'
+ }
]
}
}
View
64 Rpm.spec
@@ -1,64 +0,0 @@
-#BEGIN_dontchangeme
-%define pythontest %{?pyver:0}%{!?pyver:1}
-%if %pythontest
- %define pyver 2.5
-%endif
-%global __python /usr/bin/python%{pyver}
-%define pyver_no_dot %(echo %pyver | tr -d ".")
-%define python_package python%{pyver_no_dot}
-%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
-%define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
-
-# Turn off the brp-python-bytecompile script, we'll invoke it again later.
-%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
-#END_dontchangeme
-
-%define libname zendesk
-%define name %{python_package}-%{libname}
-%define packagever 1.1.0
-
-Summary: Python Zendesk is wrapper for the Zendesk API.
-Name: %{name}
-Version: %{packagever}
-Release: 1.demonware
-License: DemonWare
-Group: Development/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildArch: noarch
-BuildRequires: %{python_package}
-
-#Source0: %{source}
-Source0: %{name}.tar.gz
-
-Requires: %{python_package}
-Requires: %{python_package}-httplib2
-Requires: %{python_package}-simplejson
-
-%description
-Python Zendesk is wrapper for the Zendesk API. This library provides an
-easy and flexible way for developers to communicate with their Zendesk
-account in their application.
-
-%prep
-%setup -n %name
-
-%build
-%{__python} setup.py build
-
-%install
-rm -rf %{buildroot}
-%{__python} setup.py install -O1 --skip-build --root %{buildroot}
-# Bytecompile with a specific version of Python.
-/usr/lib/rpm/brp-python-bytecompile %{__python}
-
-%clean
-rm -rf %{buildroot}
-
-%files
-%defattr(-,root,root,-)
-%{python_sitelib}/Zendesk-%{version}-py%{pyver}.egg-info
-%{python_sitelib}/%{libname}
-
-%changelog
-* Mon Feb 21 2011 Jonathan Frawley <jonathan@demonware.net> - 1.demonware
-- Initial build.
View
10 examples/__init__.py
@@ -1,12 +1,5 @@
-import re
from zendesk import Zendesk
-def get_id_from_url(url):
- match = re.match(r".*/(?P<identifier>\d+)\.(json|xml)", url)
- if match and match.group('identifier'):
- return match.group('identifier')
-
-
################################################################
## NEW CONNECTION CLIENT
################################################################
@@ -49,6 +42,9 @@ def get_id_from_url(url):
}
}
ticket_url = zendesk.create_ticket(data=new_ticket)
+
+# Need ticket ID?
+from zendesk import get_id_from_url
ticket_id = get_id_from_url(ticket_url)
# Show
Please sign in to comment.
Something went wrong with that request. Please try again.