Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Desarrollando aplicaciones con Ubuntu One
Search
Roberto Alsina
June 04, 2012
Programming
1
2k
Desarrollando aplicaciones con Ubuntu One
Charla dada en UbuconLA el 3/6/2012
Roberto Alsina
June 04, 2012
Tweet
Share
More Decks by Roberto Alsina
See All by Roberto Alsina
Python en el browser
ralsina
0
79
Python 2 debe morir
ralsina
0
460
Programando Cross-Platform
ralsina
1
2.2k
Haciendo trampa: Trucos para programar menos
ralsina
1
2.2k
Hacer una cosa, pero hacerla bien
ralsina
1
1.3k
libreto.pdf
ralsina
0
97
Other Decks in Programming
See All in Programming
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
140
Package Traits
ikesyo
2
230
Оптимизируем производительность блока Казначейство
lamodatech
0
990
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
3.3k
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
2.4k
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
130
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
390
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
350
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
190
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
8
1.3k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
CNCF Project の作者が考えている OSS の運営
utam0k
5
620
Featured
See All Featured
Speed Design
sergeychernyshev
25
760
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
270
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
600
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
The Invisible Side of Design
smashingmag
299
50k
Agile that works and the tools we love
rasmusluckow
328
21k
YesSQL, Process and Tooling at Scale
rocio
171
14k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
A Tale of Four Properties
chriscoyier
157
23k
The Cult of Friendly URLs
andyhume
78
6.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Transcript
Desarrollando Aplicaciones con Ubuntu One Les Habla: Roberto Alsina Cualquier
cosa, interrumpan, no hay problema. 1
Qué es Ubuntu One • Servicio de storage online •
File sync • Music Store / Music Streaming • U1DB 2
Sync Client 3
APIs • Accounts • Files API • Music Streaming •
U1DB 4
Accounts • Ubuntu Desktop • Websites • Windows • Hagalo
usted mismo 5
Autorización en Ubuntu Usando ubuntuone.platform.credentials: @defer.inlineCallbacks def get_credentials(): tool =
CredentialsManagementTool() creds = yield tool.register() oauth_consumer = oauth2.Consumer( creds['consumer_key'], creds['consumer_secret']) oauth_token = oauth2.Token( creds['token'], creds['token_secret']) 6
Autorización en Django OAuth 1.0a. Usando django_oauth_client: @oauth_token_required('ubuntuone') def create_volume(request):
client = get_client(request.user, 'ubuntuone') response, content = client.request( 'https://one.ubuntu.com/api/file_storage/v1/volumes/~/Shoreham', 'PUT') return redirect('/accounts/profile/') 7
Hágalo Usted Mismo Bueno, es OAuth, fijáte. 8
Files • Volúmenes • Listar/Bajar/Subir/Borrar archivos • Publicar archivos •
Interacción con Sync 9
En Websites @oauth_token_required('ubuntuone') def create_volume(request): client = get_client(request.user, 'ubuntuone') response,
content = client.request( 'https://one.ubuntu.com/api/file_storage/v1/volumes/~/Shoreham', 'PUT') return redirect('/accounts/profile/') 10
En Ubuntu Es Via DBus: /folders method com.ubuntuone.SyncDaemon.Folders.create(path:s) 11
U1DB • Datos estructurados • Sincronizada • Distribuída • Online
y Offline 12
Plataformas • Ubuntu/Windows/OS X - Python - SQLite • Ubuntu
- Vala - SQLite • Ubuntu/Windows/OS X - C - SQLite • Web - javascript - localStorage • Android - Java - SQLite • iOS - Objective-C - SQLite 13
Documentos • create_doc • put_doc • revisiones • delete_doc •
get_doc / get_docs 14
Índices Es un poco más denso, vean el manual? OK!
15
Crear Índices {"firstname": "John", "surname", "Barnes", "position": "left wing"} ID
jb {"firstname": "Jan", "surname", "Molby", "position": "midfield"} ID jm {"firstname": "Alan", "surname", "Hansen", "position": "defence"} ID ah {"firstname": "John", "surname", "Wayne", "position": "filmstar"} ID jw create_index("by-firstname", ["firstname"]) 16
Usar el Índice get_from_index( "by-firstname", [("John", )]) Devuelve una lista
de IDs. 17
Más Ejemplos get_from_index("by_firstname", [("J*")]) get_from_index("by_firstname", [("Jan"), ("Alan")]) 18
Ejemplo import json, u1db db = u1db.open(":memory:", create=True) doc1 =
db.create_doc(json.dumps({"key": "value"}), doc_id="testdoc1") doc2 = db.create_doc(json.dumps({"key": "value"}), doc_id="testdoc2") for doc in db.get_docs(["testdoc2","testdoc1"]): print doc.doc_id Resultado: testdoc1 testdoc2 19
Syncing • API REST • Cliente / Servidor • Conflictos
20
Conflictos • Obtenés un ConflictedDoc • Pensás • Llamás a
resolve_doc 21
Imaginación 22
Preguntas y (Ojalá) Respuestas email:
[email protected]
twitter: @ralsina 23